target: Fix kref->refcount underflow in transport_cmd_finish_abort
[linux/fpc-iii.git] / arch / sh / include / asm / futex-irq.h
blobab01dbee0a821d04e9b79bd9863c6a2e83de1d3f
1 #ifndef __ASM_SH_FUTEX_IRQ_H
2 #define __ASM_SH_FUTEX_IRQ_H
4 static inline int atomic_futex_op_cmpxchg_inatomic(u32 *uval,
5 u32 __user *uaddr,
6 u32 oldval, u32 newval)
8 unsigned long flags;
9 int ret;
10 u32 prev = 0;
12 local_irq_save(flags);
14 ret = get_user(prev, uaddr);
15 if (!ret && oldval == prev)
16 ret = put_user(newval, uaddr);
18 local_irq_restore(flags);
20 *uval = prev;
21 return ret;
24 #endif /* __ASM_SH_FUTEX_IRQ_H */