Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f9c4650bcfb4b21126525f73f10d635284e16056
Commit:     f9c4650bcfb4b21126525f73f10d635284e16056
Parent:     3b96a56d395a4dcf4c05c48d8f4e74b1f8bd073d
Author:     Mathieu Desnoyers <[EMAIL PROTECTED]>
AuthorDate: Thu Feb 7 00:16:10 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu Feb 7 08:42:30 2008 -0800

    Add cmpxchg64 and cmpxchg64_local to powerpc
    
    Make sure that at least cmpxchg64_local is available on all architectures 
to use
    for unsigned long long values.
    
    Signed-off-by: Mathieu Desnoyers <[EMAIL PROTECTED]>
    Acked-by: Paul Mackerras <[EMAIL PROTECTED]>
    Cc: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 include/asm-powerpc/system.h |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index bc9739d..2a65ae6 100644
--- a/include/asm-powerpc/system.h
+++ b/include/asm-powerpc/system.h
@@ -463,7 +463,7 @@ __cmpxchg_local(volatile void *ptr, unsigned long old, 
unsigned long new,
        return old;
 }
 
-#define cmpxchg(ptr,o,n)                                                \
+#define cmpxchg(ptr, o, n)                                              \
   ({                                                                    \
      __typeof__(*(ptr)) _o_ = (o);                                      \
      __typeof__(*(ptr)) _n_ = (n);                                      \
@@ -472,7 +472,7 @@ __cmpxchg_local(volatile void *ptr, unsigned long old, 
unsigned long new,
   })
 
 
-#define cmpxchg_local(ptr,o,n)                                          \
+#define cmpxchg_local(ptr, o, n)                                        \
   ({                                                                    \
      __typeof__(*(ptr)) _o_ = (o);                                      \
      __typeof__(*(ptr)) _n_ = (n);                                      \
@@ -492,6 +492,20 @@ __cmpxchg_local(volatile void *ptr, unsigned long old, 
unsigned long new,
  */
 #define NET_IP_ALIGN   0
 #define NET_SKB_PAD    L1_CACHE_BYTES
+
+#define cmpxchg64(ptr, o, n)                                           \
+  ({                                                                   \
+       BUILD_BUG_ON(sizeof(*(ptr)) != 8);                              \
+       cmpxchg((ptr), (o), (n));                                       \
+  })
+#define cmpxchg64_local(ptr, o, n)                                     \
+  ({                                                                   \
+       BUILD_BUG_ON(sizeof(*(ptr)) != 8);                              \
+       cmpxchg_local((ptr), (o), (n));                                 \
+  })
+#else
+#include <asm-generic/cmpxchg-local.h>
+#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
 #endif
 
 #define arch_align_stack(x) (x)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to