summaryrefslogtreecommitdiff
path: root/arch/s390/include/asm/compat.h
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-06-15 00:36:54 (GMT)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-06-15 00:36:54 (GMT)
commit7dafd239ab522d38979ebe44d79aa68ad7b1a383 (patch)
tree04754a0c6495e57c1fe5f417fbfc99272d353c0e /arch/s390/include/asm/compat.h
parentbc47ab0241c7c86da4f5e5f82fbca7d45387c18d (diff)
parent45e3e1935e2857c54783291107d33323b3ef33c8 (diff)
downloadlinux-7dafd239ab522d38979ebe44d79aa68ad7b1a383.tar.xz
Merge commit 'origin/master' into next
Diffstat (limited to 'arch/s390/include/asm/compat.h')
-rw-r--r--arch/s390/include/asm/compat.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h
index de065b3..01a0802 100644
--- a/arch/s390/include/asm/compat.h
+++ b/arch/s390/include/asm/compat.h
@@ -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);
}