xref: /openbmc/linux/arch/x86/include/asm/cmpxchg_64.h (revision 74e6a79f)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_X86_CMPXCHG_64_H
3 #define _ASM_X86_CMPXCHG_64_H
4 
5 #define arch_cmpxchg64(ptr, o, n)					\
6 ({									\
7 	BUILD_BUG_ON(sizeof(*(ptr)) != 8);				\
8 	arch_cmpxchg((ptr), (o), (n));					\
9 })
10 
11 #define arch_cmpxchg64_local(ptr, o, n)					\
12 ({									\
13 	BUILD_BUG_ON(sizeof(*(ptr)) != 8);				\
14 	arch_cmpxchg_local((ptr), (o), (n));				\
15 })
16 
17 #define arch_try_cmpxchg64(ptr, po, n)					\
18 ({									\
19 	BUILD_BUG_ON(sizeof(*(ptr)) != 8);				\
20 	arch_try_cmpxchg((ptr), (po), (n));				\
21 })
22 
23 #define system_has_cmpxchg_double() boot_cpu_has(X86_FEATURE_CX16)
24 
25 #endif /* _ASM_X86_CMPXCHG_64_H */
26