blob: 1af94697aae510fb8eee5699b96895622975f5ec [file] [log] [blame]
H. Peter Anvin1965aae2008-10-22 22:26:29 -07001#ifndef _ASM_X86_CMPXCHG_64_H
2#define _ASM_X86_CMPXCHG_64_H
Jeff Dikea436ed92007-05-08 00:35:02 -07003
Jeremy Fitzhardinge00a41542011-08-18 11:40:22 -07004static inline void set_64bit(volatile u64 *ptr, u64 val)
5{
6 *ptr = val;
7}
8
Mathieu Desnoyers32f49eab2008-02-07 00:16:10 -08009#define cmpxchg64(ptr, o, n) \
Joe Perchese52da352008-03-23 01:01:52 -070010({ \
Mathieu Desnoyers32f49eab2008-02-07 00:16:10 -080011 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
12 cmpxchg((ptr), (o), (n)); \
Joe Perchese52da352008-03-23 01:01:52 -070013})
Peter Zijlstraf3834b92009-10-09 10:12:46 +020014
Mathieu Desnoyers32f49eab2008-02-07 00:16:10 -080015#define cmpxchg64_local(ptr, o, n) \
Joe Perchese52da352008-03-23 01:01:52 -070016({ \
Mathieu Desnoyers32f49eab2008-02-07 00:16:10 -080017 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
18 cmpxchg_local((ptr), (o), (n)); \
Joe Perchese52da352008-03-23 01:01:52 -070019})
Jeff Dikea436ed92007-05-08 00:35:02 -070020
Christoph Lameter3824abd2011-06-01 12:25:47 -050021#define system_has_cmpxchg_double() cpu_has_cx16
22
H. Peter Anvin1965aae2008-10-22 22:26:29 -070023#endif /* _ASM_X86_CMPXCHG_64_H */