diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-15 21:23:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-15 21:23:52 -0400 |
commit | b80cd62b7d4406bbe8c573fe4381dcc71a2850fd (patch) | |
tree | b3fbd9dcaac45feefc554b5a46888b2cbec0c51d /arch/ia64/include | |
parent | c345f60a5f58a65004f22fb0d257d65ec1528310 (diff) | |
parent | 07d5ecae2940ddd77746e2fb597dcf57d3c2e277 (diff) |
Merge branch 'core-futexes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-futexes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
arm: Remove bogus comment in futex_atomic_cmpxchg_inatomic()
futex: Deobfuscate handle_futex_death()
plist: Add priority list test
plist: Shrink struct plist_head
futex,plist: Remove debug lock assignment from plist_node
futex,plist: Pass the real head of the priority list to plist_del()
futex: Sanitize futex ops argument types
futex: Sanitize cmpxchg_futex_value_locked API
futex: Remove redundant pagefault_disable in futex_atomic_cmpxchg_inatomic()
futex: Avoid redudant evaluation of task_pid_vnr()
futex: Update futex_wait_setup comments about locking
Diffstat (limited to 'arch/ia64/include')
-rw-r--r-- | arch/ia64/include/asm/futex.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/ia64/include/asm/futex.h b/arch/ia64/include/asm/futex.h index c7f0f062239c..8428525ddb22 100644 --- a/arch/ia64/include/asm/futex.h +++ b/arch/ia64/include/asm/futex.h | |||
@@ -46,7 +46,7 @@ do { \ | |||
46 | } while (0) | 46 | } while (0) |
47 | 47 | ||
48 | static inline int | 48 | static inline int |
49 | futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | 49 | futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr) |
50 | { | 50 | { |
51 | int op = (encoded_op >> 28) & 7; | 51 | int op = (encoded_op >> 28) & 7; |
52 | int cmp = (encoded_op >> 24) & 15; | 52 | int cmp = (encoded_op >> 24) & 15; |
@@ -56,7 +56,7 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | |||
56 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) | 56 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) |
57 | oparg = 1 << oparg; | 57 | oparg = 1 << oparg; |
58 | 58 | ||
59 | if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) | 59 | if (! access_ok (VERIFY_WRITE, uaddr, sizeof(u32))) |
60 | return -EFAULT; | 60 | return -EFAULT; |
61 | 61 | ||
62 | pagefault_disable(); | 62 | pagefault_disable(); |
@@ -100,23 +100,26 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | |||
100 | } | 100 | } |
101 | 101 | ||
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(u32 *uval, u32 __user *uaddr, |
104 | u32 oldval, u32 newval) | ||
104 | { | 105 | { |
105 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) | 106 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) |
106 | return -EFAULT; | 107 | return -EFAULT; |
107 | 108 | ||
108 | { | 109 | { |
109 | register unsigned long r8 __asm ("r8"); | 110 | register unsigned long r8 __asm ("r8") = 0; |
111 | unsigned long prev; | ||
110 | __asm__ __volatile__( | 112 | __asm__ __volatile__( |
111 | " mf;; \n" | 113 | " mf;; \n" |
112 | " mov ar.ccv=%3;; \n" | 114 | " mov ar.ccv=%3;; \n" |
113 | "[1:] cmpxchg4.acq %0=[%1],%2,ar.ccv \n" | 115 | "[1:] cmpxchg4.acq %0=[%1],%2,ar.ccv \n" |
114 | " .xdata4 \"__ex_table\", 1b-., 2f-. \n" | 116 | " .xdata4 \"__ex_table\", 1b-., 2f-. \n" |
115 | "[2:]" | 117 | "[2:]" |
116 | : "=r" (r8) | 118 | : "=r" (prev) |
117 | : "r" (uaddr), "r" (newval), | 119 | : "r" (uaddr), "r" (newval), |
118 | "rO" ((long) (unsigned) oldval) | 120 | "rO" ((long) (unsigned) oldval) |
119 | : "memory"); | 121 | : "memory"); |
122 | *uval = prev; | ||
120 | return r8; | 123 | return r8; |
121 | } | 124 | } |
122 | } | 125 | } |