]> sourceware.org Git - systemtap.git/commitdiff
2007-06-07 Martin Hunt <hunt@redhat.com>
authorhunt <hunt>
Thu, 7 Jun 2007 16:24:39 +0000 (16:24 +0000)
committerhunt <hunt>
Thu, 7 Jun 2007 16:24:39 +0000 (16:24 +0000)
        PR 4075 fix from Ananth Mavinakayanahalli
        * string.h (_stp_get_user): Define.
        * string.c (_stp_text_str): Use _stp_get_user().

runtime/ChangeLog
runtime/string.c
runtime/string.h

index b96623bbd2e922c0c514c4c8be85c43b08ef7f48..f92aa0a1edd0741cb1a2dc0c5a411efa5c5f8096 100644 (file)
@@ -1,3 +1,8 @@
+2007-06-07  Martin Hunt  <hunt@redhat.com>
+       PR 4075 fix from Ananth Mavinakayanahalli 
+       * string.h (_stp_get_user): Define.
+       * string.c (_stp_text_str): Use _stp_get_user().
+
 2007-05-30  Martin Hunt  <hunt@redhat.com>
 
        Patch from Quentin Barnes.
index 0cc169e787af2b1132ee2da847b77d51f607fcc7..804af44545c69fbbd616a59b7f15e2838055626c 100644 (file)
@@ -75,7 +75,7 @@ void _stp_text_str(char *outstr, char *in, int len, int quoted, int user)
        if (user) {
                if (!access_ok(VERIFY_READ, (char __user *)in, 1))
                        goto bad;
-               if (__get_user(c, in))
+               if (__stp_get_user(c, in))
                        goto bad;
        } else
                c = *in;
@@ -143,7 +143,7 @@ void _stp_text_str(char *outstr, char *in, int len, int quoted, int user)
                len -= num;
                in++;
                if (user) {
-                       if (__get_user(c, in))
+                       if (__stp_get_user(c, in))
                                goto bad;
                } else
                        c = *in;
index dc7d65925d942bfe06db8699730602b1d24d61a2..fa4be1259708dbb500ae17ebbe0d62186b6a6d2e 100644 (file)
@@ -16,4 +16,21 @@ static char _stp_stdout[] = "_stdout_";
 void _stp_vsprintf (char *str, const char *fmt, va_list args);
 void _stp_text_str(char *out, char *in, int len, int quoted, int user);
 
+/*
+ * Powerpc uses a paranoid user address check in __get_user() which
+ * spews warnings "BUG: Sleeping function...." when DEBUG_SPINLOCK_SLEEP
+ * is enabled. With 2.6.21 and above, a newer variant __get_user_inatomic
+ * is provided without the paranoid check. Use it if available, fall back
+ * to __get_user() if not. Other archs can use __get_user() as is
+ */
+#ifdef __powerpc64__
+#ifdef __get_user_inatomic(x, ptr)
+#define __stp_get_user(x, ptr) __get_user_inatomic(x, ptr)
+#else /* __get_user_inatomic */
+#define __stp_get_user(x, ptr) __get_user(x, ptr)
+#endif /* __get_user_inatomic */
+#else /* __powerpc64__ */
+#define __stp_get_user(x, ptr) __get_user(x, ptr)
+#endif /* __powerpc64__ */
+
 #endif /* _STRING_H_ */
This page took 0.029993 seconds and 5 git commands to generate.