1 #ifndef _ASM_MICROBLAZE_FUTEX_H
2 #define _ASM_MICROBLAZE_FUTEX_H
6 #include <linux/futex.h>
10 #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \
12 __asm__ __volatile__ ( \
13 "1: lwx %0, %2, r0; " \
19 .section .fixup,\"ax\"; \
23 .section __ex_table,\"a\"; \
26 : "=&r" (oldval), "=&r" (ret) \
27 : "r" (uaddr), "i" (-EFAULT), "r" (oparg) \
34 int op = (encoded_op >> 28) & 7;
35 int cmp = (encoded_op >> 24) & 15;
36 int oparg = (encoded_op << 8) >> 20;
37 int cmparg = (encoded_op << 20) >> 20;
72 ret = (oldval == cmparg);
75 ret = (oldval != cmparg);
78 ret = (oldval < cmparg);
81 ret = (oldval >= cmparg);
84 ret = (oldval <= cmparg);
87 ret = (oldval > cmparg);
97 futex_atomic_cmpxchg_inatomic(
u32 *uval,
u32 __user *uaddr,
106 __asm__ __volatile__ (
"1: lwx %1, %3, r0; \
113 .section .fixup,\"ax\"; \
117 .section __ex_table,\"a\"; \
120 :
"+r" (ret),
"=&r" (prev),
"=&r"(cmp) \
121 :
"r" (uaddr),
"r" (oldval),
"r" (newval),
"i" (-
EFAULT));