[S390] implement is_compat_task
[linux-block.git] / arch / s390 / include / asm / compat.h
index de065b32381a36867eb7bf6bc58f2b0ba8ddeec2..01a08020bc0e2bb3757e783ca51ee35478bbbc52 100644 (file)
@@ -5,6 +5,7 @@
  */
 #include <linux/types.h>
 #include <linux/sched.h>
+#include <linux/thread_info.h>
 
 #define PSW32_MASK_PER         0x40000000UL
 #define PSW32_MASK_DAT         0x04000000UL
@@ -163,12 +164,28 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)
        return (u32)(unsigned long)uptr;
 }
 
+#ifdef CONFIG_COMPAT
+
+static inline int is_compat_task(void)
+{
+       return test_thread_flag(TIF_31BIT);
+}
+
+#else
+
+static inline int is_compat_task(void)
+{
+       return 0;
+}
+
+#endif
+
 static inline void __user *compat_alloc_user_space(long len)
 {
        unsigned long stack;
 
        stack = KSTK_ESP(current);
-       if (test_thread_flag(TIF_31BIT))
+       if (is_compat_task())
                stack &= 0x7fffffffUL;
        return (void __user *) (stack - len);
 }