aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/futex.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/include/asm/futex.h')
-rw-r--r--arch/arm/include/asm/futex.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/arm/include/asm/futex.h b/arch/arm/include/asm/futex.h
index 4e78065a16aa..5eed82809d82 100644
--- a/arch/arm/include/asm/futex.h
+++ b/arch/arm/include/asm/futex.h
@@ -93,6 +93,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
93 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) 93 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
94 return -EFAULT; 94 return -EFAULT;
95 95
96 preempt_disable();
96 __asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n" 97 __asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n"
97 "1: " TUSER(ldr) " %1, [%4]\n" 98 "1: " TUSER(ldr) " %1, [%4]\n"
98 " teq %1, %2\n" 99 " teq %1, %2\n"
@@ -104,6 +105,8 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
104 : "cc", "memory"); 105 : "cc", "memory");
105 106
106 *uval = val; 107 *uval = val;
108 preempt_enable();
109
107 return ret; 110 return ret;
108} 111}
109 112
@@ -124,7 +127,10 @@ futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr)
124 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) 127 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
125 return -EFAULT; 128 return -EFAULT;
126 129
127 pagefault_disable(); /* implies preempt_disable() */ 130#ifndef CONFIG_SMP
131 preempt_disable();
132#endif
133 pagefault_disable();
128 134
129 switch (op) { 135 switch (op) {
130 case FUTEX_OP_SET: 136 case FUTEX_OP_SET:
@@ -146,7 +152,10 @@ futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr)
146 ret = -ENOSYS; 152 ret = -ENOSYS;
147 } 153 }
148 154
149 pagefault_enable(); /* subsumes preempt_enable() */ 155 pagefault_enable();
156#ifndef CONFIG_SMP
157 preempt_enable();
158#endif
150 159
151 if (!ret) { 160 if (!ret) {
152 switch (cmp) { 161 switch (cmp) {