21 #include <linux/futex.h>
23 #include <asm/errno.h>
25 #define __futex_atomic_op(insn, ret, oldval, uaddr, tmp, oparg) \
27 "1: ldaxr %w1, %2\n" \
29 "2: stlxr %w3, %w0, %2\n" \
32 " .pushsection .fixup,\"ax\"\n" \
36 " .pushsection __ex_table,\"a\"\n" \
38 " .quad 1b, 4b, 2b, 4b\n" \
40 : "=&r" (ret), "=&r" (oldval), "+Q" (*uaddr), "=&r" (tmp) \
41 : "r" (oparg), "Ir" (-EFAULT) \
47 int op = (encoded_op >> 28) & 7;
48 int cmp = (encoded_op >> 24) & 15;
49 int oparg = (encoded_op << 8) >> 20;
50 int cmparg = (encoded_op << 20) >> 20;
64 ret, oldval, uaddr, tmp, oparg);
68 ret, oldval, uaddr, tmp, oparg);
72 ret, oldval, uaddr, tmp, oparg);
76 ret, oldval, uaddr, tmp, ~oparg);
80 ret, oldval, uaddr, tmp, oparg);
103 futex_atomic_cmpxchg_inatomic(
u32 *uval,
u32 __user *uaddr,
112 asm volatile(
"// futex_atomic_cmpxchg_inatomic\n"
114 " sub %w3, %w1, %w4\n"
116 "2: stlxr %w3, %w5, %2\n"
119 " .pushsection .fixup,\"ax\"\n"
123 " .pushsection __ex_table,\"a\"\n"
125 " .quad 1b, 4b, 2b, 4b\n"
127 :
"+r" (
ret),
"=&r" (val),
"+Q" (*uaddr),
"=&r" (
tmp)
128 :
"r" (oldval),
"r" (newval),
"Ir" (-
EFAULT)