summaryrefslogtreecommitdiffstats
path: root/runtime/string.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/string.h')
-rw-r--r--runtime/string.h17
1 files changed, 17 insertions, 0 deletions
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_ */