1 #ifndef _ASM_ARM_FUTEX_H
2 #define _ASM_ARM_FUTEX_H
6 #if defined(CONFIG_CPU_USE_DOMAINS) && defined(CONFIG_SMP)
11 #include <linux/futex.h>
13 #include <asm/errno.h>
15 #define __futex_atomic_ex_table(err_reg) \
17 " .pushsection __ex_table,\"a\"\n" \
19 " .long 1b, 4f, 2b, 4f\n" \
21 " .pushsection .fixup,\"ax\"\n" \
23 "4: mov %0, " err_reg "\n" \
29 #define __futex_atomic_op(insn, ret, oldval, tmp, uaddr, oparg) \
31 __asm__ __volatile__( \
32 "1: ldrex %1, [%3]\n" \
34 "2: strex %2, %0, [%3]\n" \
38 __futex_atomic_ex_table("%5") \
39 : "=&r" (ret), "=&r" (oldval), "=&r" (tmp) \
40 : "r" (uaddr), "r" (oparg), "Ir" (-EFAULT) \
44 futex_atomic_cmpxchg_inatomic(
u32 *uval,
u32 __user *
uaddr,
54 __asm__ __volatile__(
"@futex_atomic_cmpxchg_inatomic\n"
57 " ite eq @ explicit IT needed for the 2b label\n"
58 "2: strexeq %0, %3, [%4]\n"
62 __futex_atomic_ex_table(
"%5")
63 :
"=&r" (ret),
"=&r" (val)
64 :
"r" (oldval),
"r" (newval),
"r" (uaddr),
"Ir" (-
EFAULT)
77 #define __futex_atomic_op(insn, ret, oldval, tmp, uaddr, oparg) \
78 __asm__ __volatile__( \
79 "1: " TUSER(ldr) " %1, [%3]\n" \
81 "2: " TUSER(str) " %0, [%3]\n" \
83 __futex_atomic_ex_table("%5") \
84 : "=&r" (ret), "=&r" (oldval), "=&r" (tmp) \
85 : "r" (uaddr), "r" (oparg), "Ir" (-EFAULT) \
89 futex_atomic_cmpxchg_inatomic(
u32 *uval,
u32 __user *uaddr,
98 __asm__ __volatile__(
"@futex_atomic_cmpxchg_inatomic\n"
101 " it eq @ explicit IT needed for the 2b label\n"
103 __futex_atomic_ex_table(
"%5")
104 :
"+r" (ret),
"=&r" (val)
105 :
"r" (oldval),
"r" (newval),
"r" (uaddr),
"Ir" (-
EFAULT)
117 int op = (encoded_op >> 28) & 7;
118 int cmp = (encoded_op >> 24) & 15;
119 int oparg = (encoded_op << 8) >> 20;
120 int cmparg = (encoded_op << 20) >> 20;