1 #ifndef _ASM_HEXAGON_FUTEX_H
2 #define _ASM_HEXAGON_FUTEX_H
6 #include <linux/futex.h>
12 #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \
14 "1: %0 = memw_locked(%3);\n" \
17 "2: memw_locked(%3,p2) = %1;\n" \
18 " if !p2 jump 1b;\n" \
21 ".section .fixup,\"ax\"\n" \
25 ".section __ex_table,\"a\"\n" \
26 ".long 1b,4b,2b,4b\n" \
28 : "=&r" (oldval), "=&r" (ret), "+m" (*uaddr) \
29 : "r" (uaddr), "r" (oparg), "i" (-EFAULT) \
36 int op = (encoded_op >> 28) & 7;
37 int cmp = (encoded_op >> 24) & 15;
38 int oparg = (encoded_op << 8) >> 20;
39 int cmparg = (encoded_op << 20) >> 20;
63 oldval, uaddr, oparg);
78 ret = (oldval == cmparg);
81 ret = (oldval != cmparg);
84 ret = (oldval < cmparg);
87 ret = (oldval >= cmparg);
90 ret = (oldval <= cmparg);
93 ret = (oldval > cmparg);
103 futex_atomic_cmpxchg_inatomic(
u32 *uval,
u32 __user *uaddr,
u32 oldval,
113 "1: %1 = memw_locked(%3)\n"
115 " p2 = cmp.eq(%1,%4)\n"
116 " if !p2.new jump:NT 3f\n"
118 "2: memw_locked(%3,p2) = %5\n"
121 ".section .fixup,\"ax\"\n"
125 ".section __ex_table,\"a\"\n"
126 ".long 1b,4b,2b,4b\n"
128 :
"+r" (ret),
"=&r" (prev),
"+m" (*uaddr)
129 :
"r" (uaddr),
"r" (oldval),
"r" (newval),
"i"(-
EFAULT)