diff options
Diffstat (limited to 'arch/arm/include/asm/futex.h')
-rw-r--r-- | arch/arm/include/asm/futex.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/arch/arm/include/asm/futex.h b/arch/arm/include/asm/futex.h index 8c73900da9ed..253cc86318bf 100644 --- a/arch/arm/include/asm/futex.h +++ b/arch/arm/include/asm/futex.h | |||
@@ -25,17 +25,17 @@ | |||
25 | 25 | ||
26 | #ifdef CONFIG_SMP | 26 | #ifdef CONFIG_SMP |
27 | 27 | ||
28 | #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ | 28 | #define __futex_atomic_op(insn, ret, oldval, tmp, uaddr, oparg) \ |
29 | smp_mb(); \ | 29 | smp_mb(); \ |
30 | __asm__ __volatile__( \ | 30 | __asm__ __volatile__( \ |
31 | "1: ldrex %1, [%2]\n" \ | 31 | "1: ldrex %1, [%3]\n" \ |
32 | " " insn "\n" \ | 32 | " " insn "\n" \ |
33 | "2: strex %1, %0, [%2]\n" \ | 33 | "2: strex %2, %0, [%3]\n" \ |
34 | " teq %1, #0\n" \ | 34 | " teq %2, #0\n" \ |
35 | " bne 1b\n" \ | 35 | " bne 1b\n" \ |
36 | " mov %0, #0\n" \ | 36 | " mov %0, #0\n" \ |
37 | __futex_atomic_ex_table("%4") \ | 37 | __futex_atomic_ex_table("%5") \ |
38 | : "=&r" (ret), "=&r" (oldval) \ | 38 | : "=&r" (ret), "=&r" (oldval), "=&r" (tmp) \ |
39 | : "r" (uaddr), "r" (oparg), "Ir" (-EFAULT) \ | 39 | : "r" (uaddr), "r" (oparg), "Ir" (-EFAULT) \ |
40 | : "cc", "memory") | 40 | : "cc", "memory") |
41 | 41 | ||
@@ -73,14 +73,14 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, | |||
73 | #include <linux/preempt.h> | 73 | #include <linux/preempt.h> |
74 | #include <asm/domain.h> | 74 | #include <asm/domain.h> |
75 | 75 | ||
76 | #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ | 76 | #define __futex_atomic_op(insn, ret, oldval, tmp, uaddr, oparg) \ |
77 | __asm__ __volatile__( \ | 77 | __asm__ __volatile__( \ |
78 | "1: " T(ldr) " %1, [%2]\n" \ | 78 | "1: " T(ldr) " %1, [%3]\n" \ |
79 | " " insn "\n" \ | 79 | " " insn "\n" \ |
80 | "2: " T(str) " %0, [%2]\n" \ | 80 | "2: " T(str) " %0, [%3]\n" \ |
81 | " mov %0, #0\n" \ | 81 | " mov %0, #0\n" \ |
82 | __futex_atomic_ex_table("%4") \ | 82 | __futex_atomic_ex_table("%5") \ |
83 | : "=&r" (ret), "=&r" (oldval) \ | 83 | : "=&r" (ret), "=&r" (oldval), "=&r" (tmp) \ |
84 | : "r" (uaddr), "r" (oparg), "Ir" (-EFAULT) \ | 84 | : "r" (uaddr), "r" (oparg), "Ir" (-EFAULT) \ |
85 | : "cc", "memory") | 85 | : "cc", "memory") |
86 | 86 | ||
@@ -117,7 +117,7 @@ futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr) | |||
117 | int cmp = (encoded_op >> 24) & 15; | 117 | int cmp = (encoded_op >> 24) & 15; |
118 | int oparg = (encoded_op << 8) >> 20; | 118 | int oparg = (encoded_op << 8) >> 20; |
119 | int cmparg = (encoded_op << 20) >> 20; | 119 | int cmparg = (encoded_op << 20) >> 20; |
120 | int oldval = 0, ret; | 120 | int oldval = 0, ret, tmp; |
121 | 121 | ||
122 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) | 122 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) |
123 | oparg = 1 << oparg; | 123 | oparg = 1 << oparg; |
@@ -129,19 +129,19 @@ futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr) | |||
129 | 129 | ||
130 | switch (op) { | 130 | switch (op) { |
131 | case FUTEX_OP_SET: | 131 | case FUTEX_OP_SET: |
132 | __futex_atomic_op("mov %0, %3", ret, oldval, uaddr, oparg); | 132 | __futex_atomic_op("mov %0, %4", ret, oldval, tmp, uaddr, oparg); |
133 | break; | 133 | break; |
134 | case FUTEX_OP_ADD: | 134 | case FUTEX_OP_ADD: |
135 | __futex_atomic_op("add %0, %1, %3", ret, oldval, uaddr, oparg); | 135 | __futex_atomic_op("add %0, %1, %4", ret, oldval, tmp, uaddr, oparg); |
136 | break; | 136 | break; |
137 | case FUTEX_OP_OR: | 137 | case FUTEX_OP_OR: |
138 | __futex_atomic_op("orr %0, %1, %3", ret, oldval, uaddr, oparg); | 138 | __futex_atomic_op("orr %0, %1, %4", ret, oldval, tmp, uaddr, oparg); |
139 | break; | 139 | break; |
140 | case FUTEX_OP_ANDN: | 140 | case FUTEX_OP_ANDN: |
141 | __futex_atomic_op("and %0, %1, %3", ret, oldval, uaddr, ~oparg); | 141 | __futex_atomic_op("and %0, %1, %4", ret, oldval, tmp, uaddr, ~oparg); |
142 | break; | 142 | break; |
143 | case FUTEX_OP_XOR: | 143 | case FUTEX_OP_XOR: |
144 | __futex_atomic_op("eor %0, %1, %3", ret, oldval, uaddr, oparg); | 144 | __futex_atomic_op("eor %0, %1, %4", ret, oldval, tmp, uaddr, oparg); |
145 | break; | 145 | break; |
146 | default: | 146 | default: |
147 | ret = -ENOSYS; | 147 | ret = -ENOSYS; |