cmpxchg_64.h 706 B

123456789101112131415161718192021222324252627282930
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ASM_X86_CMPXCHG_64_H
  3. #define _ASM_X86_CMPXCHG_64_H
  4. static inline void set_64bit(volatile u64 *ptr, u64 val)
  5. {
  6. *ptr = val;
  7. }
  8. #define arch_cmpxchg64(ptr, o, n) \
  9. ({ \
  10. BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
  11. arch_cmpxchg((ptr), (o), (n)); \
  12. })
  13. #define arch_cmpxchg64_local(ptr, o, n) \
  14. ({ \
  15. BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
  16. arch_cmpxchg_local((ptr), (o), (n)); \
  17. })
  18. #define arch_try_cmpxchg64(ptr, po, n) \
  19. ({ \
  20. BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
  21. arch_try_cmpxchg((ptr), (po), (n)); \
  22. })
  23. #define system_has_cmpxchg_double() boot_cpu_has(X86_FEATURE_CX16)
  24. #endif /* _ASM_X86_CMPXCHG_64_H */