aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/cmpxchg_64.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86/cmpxchg_64.h')
-rw-r--r--include/asm-x86/cmpxchg_64.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/include/asm-x86/cmpxchg_64.h b/include/asm-x86/cmpxchg_64.h
index 5e182062e6ec..56f5b41e071c 100644
--- a/include/asm-x86/cmpxchg_64.h
+++ b/include/asm-x86/cmpxchg_64.h
@@ -124,11 +124,21 @@ static inline unsigned long __cmpxchg_local(volatile void *ptr,
124 return old; 124 return old;
125} 125}
126 126
127#define cmpxchg(ptr,o,n)\ 127#define cmpxchg(ptr, o, n) \
128 ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\ 128 ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \
129 (unsigned long)(n),sizeof(*(ptr)))) 129 (unsigned long)(n), sizeof(*(ptr))))
130#define cmpxchg_local(ptr,o,n)\ 130#define cmpxchg64(ptr, o, n) \
131 ((__typeof__(*(ptr)))__cmpxchg_local((ptr),(unsigned long)(o),\ 131 ({ \
132 (unsigned long)(n),sizeof(*(ptr)))) 132 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
133 cmpxchg((ptr), (o), (n)); \
134 })
135#define cmpxchg_local(ptr, o, n) \
136 ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \
137 (unsigned long)(n), sizeof(*(ptr))))
138#define cmpxchg64_local(ptr, o, n) \
139 ({ \
140 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
141 cmpxchg_local((ptr), (o), (n)); \
142 })
133 143
134#endif 144#endif