License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[linux-block.git] / arch / x86 / include / asm / cmpxchg_64.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
1965aae3
PA
2#ifndef _ASM_X86_CMPXCHG_64_H
3#define _ASM_X86_CMPXCHG_64_H
a436ed9c 4
00a41546
JF
5static inline void set_64bit(volatile u64 *ptr, u64 val)
6{
7 *ptr = val;
8}
9
32f49eab 10#define cmpxchg64(ptr, o, n) \
e52da357 11({ \
32f49eab
MD
12 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
13 cmpxchg((ptr), (o), (n)); \
e52da357 14})
f3834b9e 15
32f49eab 16#define cmpxchg64_local(ptr, o, n) \
e52da357 17({ \
32f49eab
MD
18 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
19 cmpxchg_local((ptr), (o), (n)); \
e52da357 20})
a436ed9c 21
362f924b 22#define system_has_cmpxchg_double() boot_cpu_has(X86_FEATURE_CX16)
3824abd1 23
1965aae3 24#endif /* _ASM_X86_CMPXCHG_64_H */