diff options
author | Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> | 2008-02-07 03:16:10 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-07 11:42:31 -0500 |
commit | 32f49eab5e893007c0064f465c857ac7c4d40b77 (patch) | |
tree | dd3a69e196fee7311d61dda8c17dd62a451070b2 /include | |
parent | f9c4650bcfb4b21126525f73f10d635284e16056 (diff) |
Add cmpxchg64 and cmpxchg64_local to x86_64
Make sure that at least cmpxchg64_local is available on all architectures to use
for unsigned long long values.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Andi Kleen <ak@muc.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-x86/cmpxchg_64.h | 22 |
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 |