summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorhunt <hunt>2007-06-07 16:24:39 +0000
committerhunt <hunt>2007-06-07 16:24:39 +0000
commit8d2e746e17e36ecbb6678f81c0bcaec4d2db627c (patch)
tree45b054772823414282e11c612ec27f4a26cfb608 /runtime
parente62ffeb978b987ffa7cea29c1d0176276b1e65bd (diff)
downloadsystemtap-steved-8d2e746e17e36ecbb6678f81c0bcaec4d2db627c.tar.gz
systemtap-steved-8d2e746e17e36ecbb6678f81c0bcaec4d2db627c.tar.xz
systemtap-steved-8d2e746e17e36ecbb6678f81c0bcaec4d2db627c.zip
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().
Diffstat (limited to 'runtime')
-rw-r--r--runtime/ChangeLog5
-rw-r--r--runtime/string.c4
-rw-r--r--runtime/string.h17
3 files changed, 24 insertions, 2 deletions
diff --git a/runtime/ChangeLog b/runtime/ChangeLog
index b96623bb..f92aa0a1 100644
--- a/runtime/ChangeLog
+++ b/runtime/ChangeLog
@@ -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.
diff --git a/runtime/string.c b/runtime/string.c
index 0cc169e7..804af445 100644
--- a/runtime/string.c
+++ b/runtime/string.c
@@ -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;
diff --git a/runtime/string.h b/runtime/string.h
index dc7d6592..fa4be125 100644
--- a/runtime/string.h
+++ b/runtime/string.h
@@ -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_ */