| .. | .. |
|---|
| 2 | 2 | #ifndef __ASM_SH_FUTEX_H |
|---|
| 3 | 3 | #define __ASM_SH_FUTEX_H |
|---|
| 4 | 4 | |
|---|
| 5 | | -#ifdef __KERNEL__ |
|---|
| 6 | | - |
|---|
| 7 | 5 | #include <linux/futex.h> |
|---|
| 8 | 6 | #include <linux/uaccess.h> |
|---|
| 9 | 7 | #include <asm/errno.h> |
|---|
| .. | .. |
|---|
| 22 | 20 | futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, |
|---|
| 23 | 21 | u32 oldval, u32 newval) |
|---|
| 24 | 22 | { |
|---|
| 25 | | - if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) |
|---|
| 23 | + if (!access_ok(uaddr, sizeof(u32))) |
|---|
| 26 | 24 | return -EFAULT; |
|---|
| 27 | 25 | |
|---|
| 28 | 26 | return atomic_futex_op_cmpxchg_inatomic(uval, uaddr, oldval, newval); |
|---|
| .. | .. |
|---|
| 33 | 31 | { |
|---|
| 34 | 32 | u32 oldval, newval, prev; |
|---|
| 35 | 33 | int ret; |
|---|
| 36 | | - |
|---|
| 37 | | - pagefault_disable(); |
|---|
| 38 | 34 | |
|---|
| 39 | 35 | do { |
|---|
| 40 | 36 | ret = get_user(oldval, uaddr); |
|---|
| .. | .. |
|---|
| 67 | 63 | ret = futex_atomic_cmpxchg_inatomic(&prev, uaddr, oldval, newval); |
|---|
| 68 | 64 | } while (!ret && prev != oldval); |
|---|
| 69 | 65 | |
|---|
| 70 | | - pagefault_enable(); |
|---|
| 71 | | - |
|---|
| 72 | 66 | if (!ret) |
|---|
| 73 | 67 | *oval = oldval; |
|---|
| 74 | 68 | |
|---|
| 75 | 69 | return ret; |
|---|
| 76 | 70 | } |
|---|
| 77 | 71 | |
|---|
| 78 | | -#endif /* __KERNEL__ */ |
|---|
| 79 | 72 | #endif /* __ASM_SH_FUTEX_H */ |
|---|