futex-irq.h 443 B

123456789101112131415161718192021222324
  1. #ifndef __ASM_SH_FUTEX_IRQ_H
  2. #define __ASM_SH_FUTEX_IRQ_H
  3. static inline int atomic_futex_op_cmpxchg_inatomic(u32 *uval,
  4. u32 __user *uaddr,
  5. u32 oldval, u32 newval)
  6. {
  7. unsigned long flags;
  8. int ret;
  9. u32 prev = 0;
  10. local_irq_save(flags);
  11. ret = get_user(prev, uaddr);
  12. if (!ret && oldval == prev)
  13. ret = put_user(newval, uaddr);
  14. local_irq_restore(flags);
  15. *uval = prev;
  16. return ret;
  17. }
  18. #endif /* __ASM_SH_FUTEX_IRQ_H */