1 #ifndef __ASM_SH_FUTEX_IRQ_H
2 #define __ASM_SH_FUTEX_IRQ_H
5 static inline int atomic_futex_op_xchg_set(int oparg
, u32 __user
*uaddr
,
11 local_irq_save(flags
);
13 ret
= get_user(*oldval
, uaddr
);
15 ret
= put_user(oparg
, uaddr
);
17 local_irq_restore(flags
);
22 static inline int atomic_futex_op_xchg_add(int oparg
, u32 __user
*uaddr
,
28 local_irq_save(flags
);
30 ret
= get_user(*oldval
, uaddr
);
32 ret
= put_user(*oldval
+ oparg
, uaddr
);
34 local_irq_restore(flags
);
39 static inline int atomic_futex_op_xchg_or(int oparg
, u32 __user
*uaddr
,
45 local_irq_save(flags
);
47 ret
= get_user(*oldval
, uaddr
);
49 ret
= put_user(*oldval
| oparg
, uaddr
);
51 local_irq_restore(flags
);
56 static inline int atomic_futex_op_xchg_and(int oparg
, u32 __user
*uaddr
,
62 local_irq_save(flags
);
64 ret
= get_user(*oldval
, uaddr
);
66 ret
= put_user(*oldval
& oparg
, uaddr
);
68 local_irq_restore(flags
);
73 static inline int atomic_futex_op_xchg_xor(int oparg
, u32 __user
*uaddr
,
79 local_irq_save(flags
);
81 ret
= get_user(*oldval
, uaddr
);
83 ret
= put_user(*oldval
^ oparg
, uaddr
);
85 local_irq_restore(flags
);
90 static inline int atomic_futex_op_cmpxchg_inatomic(u32
*uval
,
92 u32 oldval
, u32 newval
)
98 local_irq_save(flags
);
100 ret
= get_user(prev
, uaddr
);
101 if (!ret
&& oldval
== prev
)
102 ret
= put_user(newval
, uaddr
);
104 local_irq_restore(flags
);
110 #endif /* __ASM_SH_FUTEX_IRQ_H */