xref: /kernel/linux/linux-5.10/arch/x86/include/asm/cmpxchg_64.h
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /kernel/linux/linux-5.10/arch/x86/include/asm/
18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef _ASM_X86_CMPXCHG_64_H
38c2ecf20Sopenharmony_ci#define _ASM_X86_CMPXCHG_64_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_cistatic inline void set_64bit(volatile u64 *ptr, u64 val)
68c2ecf20Sopenharmony_ci{
78c2ecf20Sopenharmony_ci	*ptr = val;
88c2ecf20Sopenharmony_ci}
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#define arch_cmpxchg64(ptr, o, n)					\
118c2ecf20Sopenharmony_ci({									\
128c2ecf20Sopenharmony_ci	BUILD_BUG_ON(sizeof(*(ptr)) != 8);				\
138c2ecf20Sopenharmony_ci	arch_cmpxchg((ptr), (o), (n));					\
148c2ecf20Sopenharmony_ci})
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#define arch_cmpxchg64_local(ptr, o, n)					\
178c2ecf20Sopenharmony_ci({									\
188c2ecf20Sopenharmony_ci	BUILD_BUG_ON(sizeof(*(ptr)) != 8);				\
198c2ecf20Sopenharmony_ci	arch_cmpxchg_local((ptr), (o), (n));				\
208c2ecf20Sopenharmony_ci})
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#define system_has_cmpxchg_double() boot_cpu_has(X86_FEATURE_CX16)
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci#endif /* _ASM_X86_CMPXCHG_64_H */
25

Indexes created Thu Nov 07 10:32:03 CST 2024