From cfd3765ad1b6a9c82395e67a1a9ed3da1e27d376 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 7 Feb 2008 00:16:10 -0800 Subject: [PATCH] --- yaml --- r: 83888 b: refs/heads/master c: 32f49eab5e893007c0064f465c857ac7c4d40b77 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/asm-x86/cmpxchg_64.h | 22 ++++++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index d362523c24f1..313cbb148f89 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f9c4650bcfb4b21126525f73f10d635284e16056 +refs/heads/master: 32f49eab5e893007c0064f465c857ac7c4d40b77 diff --git a/trunk/include/asm-x86/cmpxchg_64.h b/trunk/include/asm-x86/cmpxchg_64.h index 5e182062e6ec..56f5b41e071c 100644 --- a/trunk/include/asm-x86/cmpxchg_64.h +++ b/trunk/include/asm-x86/cmpxchg_64.h @@ -124,11 +124,21 @@ static inline unsigned long __cmpxchg_local(volatile void *ptr, return old; } -#define cmpxchg(ptr,o,n)\ - ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\ - (unsigned long)(n),sizeof(*(ptr)))) -#define cmpxchg_local(ptr,o,n)\ - ((__typeof__(*(ptr)))__cmpxchg_local((ptr),(unsigned long)(o),\ - (unsigned long)(n),sizeof(*(ptr)))) +#define cmpxchg(ptr, o, n) \ + ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \ + (unsigned long)(n), sizeof(*(ptr)))) +#define cmpxchg64(ptr, o, n) \ + ({ \ + BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ + cmpxchg((ptr), (o), (n)); \ + }) +#define cmpxchg_local(ptr, o, n) \ + ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \ + (unsigned long)(n), sizeof(*(ptr)))) +#define cmpxchg64_local(ptr, o, n) \ + ({ \ + BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ + cmpxchg_local((ptr), (o), (n)); \ + }) #endif