cmpxchg.h 537 B

1234567891011121314151617181920212223
  1. #ifndef __ASM_GENERIC_CMPXCHG_H
  2. #define __ASM_GENERIC_CMPXCHG_H
  3. /*
  4. * Generic cmpxchg
  5. *
  6. * Uses the local cmpxchg. Does not support SMP.
  7. */
  8. #ifdef CONFIG_SMP
  9. #error "Cannot use generic cmpxchg on SMP"
  10. #endif
  11. /*
  12. * Atomic compare and exchange.
  13. *
  14. * Do not define __HAVE_ARCH_CMPXCHG because we want to use it to check whether
  15. * a cmpxchg primitive faster than repeated local irq save/restore exists.
  16. */
  17. #define cmpxchg(ptr, o, n) cmpxchg_local((ptr), (o), (n))
  18. #define cmpxchg64(ptr, o, n) cmpxchg64_local((ptr), (o), (n))
  19. #endif