summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorH. Peter Anvin2012-03-05 22:39:29 +0100
committerH. Peter Anvin2012-03-06 00:35:18 +0100
commita628b684d27d22631d1819890f13047ae9075241 (patch)
tree996e8dcce2ff1f460d85acbc82d5bcc1ae3715d8 /arch/x86
parentx86, mtrr: Use explicit sizing and padding for the 64-bit ioctls (diff)
downloadkernel-qcow2-linux-a628b684d27d22631d1819890f13047ae9075241.tar.gz
kernel-qcow2-linux-a628b684d27d22631d1819890f13047ae9075241.tar.xz
kernel-qcow2-linux-a628b684d27d22631d1819890f13047ae9075241.zip
x32: Provide separate is_ia32_task() and is_x32_task() predicates
The is_compat_task() test is composed of two predicates already, so make each of them available separately. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: H. J. Lu <hjl.tools@gmail.com> Link: http://lkml.kernel.org/r/1329696488-16970-1-git-send-email-hpa@zytor.com
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/include/asm/compat.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/x86/include/asm/compat.h b/arch/x86/include/asm/compat.h
index e7f68b49c01a..355edc091604 100644
--- a/arch/x86/include/asm/compat.h
+++ b/arch/x86/include/asm/compat.h
@@ -235,12 +235,17 @@ static inline void __user *arch_compat_alloc_user_space(long len)
return (void __user *)round_down(sp - len, 16);
}
-static inline bool is_compat_task(void)
+static inline bool is_ia32_task(void)
{
#ifdef CONFIG_IA32_EMULATION
if (current_thread_info()->status & TS_COMPAT)
return true;
#endif
+ return false;
+}
+
+static inline bool is_x32_task(void)
+{
#ifdef CONFIG_X86_X32_ABI
if (task_pt_regs(current)->orig_ax & __X32_SYSCALL_BIT)
return true;
@@ -248,4 +253,9 @@ static inline bool is_compat_task(void)
return false;
}
+static inline bool is_compat_task(void)
+{
+ return is_ia32_task() || is_x32_task();
+}
+
#endif /* _ASM_X86_COMPAT_H */