diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2008-02-16 08:05:01 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-02-26 06:56:06 -0500 |
commit | f18edc95a37a901ffcbe91f5e05105f916a04fae (patch) | |
tree | 66bb079a44a7bf997207cce8eb6b3c840082c45d /include/asm-x86 | |
parent | 12c247a6719987aad65f83158d2bb3e73c75c1f5 (diff) |
x86: no robust/pi futex for real i386 CPUs
Real i386 CPUs do not have cmpxchg instructions. Catch it before
crashing on an invalid opcode.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/futex.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/asm-x86/futex.h b/include/asm-x86/futex.h index cd9f894dd2d7..c9952ea9f698 100644 --- a/include/asm-x86/futex.h +++ b/include/asm-x86/futex.h | |||
@@ -102,6 +102,13 @@ futex_atomic_op_inuser(int encoded_op, int __user *uaddr) | |||
102 | static inline int | 102 | static inline int |
103 | futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) | 103 | futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) |
104 | { | 104 | { |
105 | |||
106 | #if defined(CONFIG_X86_32) && !defined(CONFIG_X86_BSWAP) | ||
107 | /* Real i386 machines have no cmpxchg instruction */ | ||
108 | if (boot_cpu_data.x86 == 3) | ||
109 | return -ENOSYS; | ||
110 | #endif | ||
111 | |||
105 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) | 112 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) |
106 | return -EFAULT; | 113 | return -EFAULT; |
107 | 114 | ||