Commit | Line | Data |
---|---|---|
1965aae3 PA |
1 | #ifndef _ASM_X86_CMPXCHG_64_H |
2 | #define _ASM_X86_CMPXCHG_64_H | |
a436ed9c | 3 | |
00a41546 JF |
4 | static inline void set_64bit(volatile u64 *ptr, u64 val) |
5 | { | |
6 | *ptr = val; | |
7 | } | |
8 | ||
32f49eab | 9 | #define cmpxchg64(ptr, o, n) \ |
e52da357 | 10 | ({ \ |
32f49eab MD |
11 | BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ |
12 | cmpxchg((ptr), (o), (n)); \ | |
e52da357 | 13 | }) |
f3834b9e | 14 | |
32f49eab | 15 | #define cmpxchg64_local(ptr, o, n) \ |
e52da357 | 16 | ({ \ |
32f49eab MD |
17 | BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ |
18 | cmpxchg_local((ptr), (o), (n)); \ | |
e52da357 | 19 | }) |
a436ed9c | 20 | |
362f924b | 21 | #define system_has_cmpxchg_double() boot_cpu_has(X86_FEATURE_CX16) |
3824abd1 | 22 | |
1965aae3 | 23 | #endif /* _ASM_X86_CMPXCHG_64_H */ |