diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-i386/futex.h | 23 | ||||
-rw-r--r-- | include/asm-i386/unistd.h | 4 |
2 files changed, 25 insertions, 2 deletions
diff --git a/include/asm-i386/futex.h b/include/asm-i386/futex.h index 1f39ad9d52a1..41184a31885c 100644 --- a/include/asm-i386/futex.h +++ b/include/asm-i386/futex.h | |||
@@ -107,7 +107,28 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | |||
107 | static inline int | 107 | static inline int |
108 | futex_atomic_cmpxchg_inuser(int __user *uaddr, int oldval, int newval) | 108 | futex_atomic_cmpxchg_inuser(int __user *uaddr, int oldval, int newval) |
109 | { | 109 | { |
110 | return -ENOSYS; | 110 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) |
111 | return -EFAULT; | ||
112 | |||
113 | __asm__ __volatile__( | ||
114 | "1: " LOCK_PREFIX "cmpxchgl %3, %1 \n" | ||
115 | |||
116 | "2: .section .fixup, \"ax\" \n" | ||
117 | "3: mov %2, %0 \n" | ||
118 | " jmp 2b \n" | ||
119 | " .previous \n" | ||
120 | |||
121 | " .section __ex_table, \"a\" \n" | ||
122 | " .align 8 \n" | ||
123 | " .long 1b,3b \n" | ||
124 | " .previous \n" | ||
125 | |||
126 | : "=a" (oldval), "=m" (*uaddr) | ||
127 | : "i" (-EFAULT), "r" (newval), "0" (oldval) | ||
128 | : "memory" | ||
129 | ); | ||
130 | |||
131 | return oldval; | ||
111 | } | 132 | } |
112 | 133 | ||
113 | #endif | 134 | #endif |
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h index d8afd0e3b81a..014e3562895b 100644 --- a/include/asm-i386/unistd.h +++ b/include/asm-i386/unistd.h | |||
@@ -316,8 +316,10 @@ | |||
316 | #define __NR_pselect6 308 | 316 | #define __NR_pselect6 308 |
317 | #define __NR_ppoll 309 | 317 | #define __NR_ppoll 309 |
318 | #define __NR_unshare 310 | 318 | #define __NR_unshare 310 |
319 | #define __NR_set_robust_list 311 | ||
320 | #define __NR_get_robust_list 312 | ||
319 | 321 | ||
320 | #define NR_syscalls 311 | 322 | #define NR_syscalls 313 |
321 | 323 | ||
322 | /* | 324 | /* |
323 | * user-visible error numbers are in the range -1 - -128: see | 325 | * user-visible error numbers are in the range -1 - -128: see |