aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc
diff options
context:
space:
mode:
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>2008-02-07 03:16:10 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 11:42:30 -0500
commitf9c4650bcfb4b21126525f73f10d635284e16056 (patch)
tree11927048b5ae34472043b894e9646d1e4635ae99 /include/asm-powerpc
parent3b96a56d395a4dcf4c05c48d8f4e74b1f8bd073d (diff)
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 <mathieu.desnoyers@polymtl.ca> Acked-by: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r--include/asm-powerpc/system.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index bc9739dff5e7..2a65ae637204 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,
463 return old; 463 return old;
464} 464}
465 465
466#define cmpxchg(ptr,o,n) \ 466#define cmpxchg(ptr, o, n) \
467 ({ \ 467 ({ \
468 __typeof__(*(ptr)) _o_ = (o); \ 468 __typeof__(*(ptr)) _o_ = (o); \
469 __typeof__(*(ptr)) _n_ = (n); \ 469 __typeof__(*(ptr)) _n_ = (n); \
@@ -472,7 +472,7 @@ __cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new,
472 }) 472 })
473 473
474 474
475#define cmpxchg_local(ptr,o,n) \ 475#define cmpxchg_local(ptr, o, n) \
476 ({ \ 476 ({ \
477 __typeof__(*(ptr)) _o_ = (o); \ 477 __typeof__(*(ptr)) _o_ = (o); \
478 __typeof__(*(ptr)) _n_ = (n); \ 478 __typeof__(*(ptr)) _n_ = (n); \
@@ -492,6 +492,20 @@ __cmpxchg_local(volatile void *ptr, unsigned long old, unsigned long new,
492 */ 492 */
493#define NET_IP_ALIGN 0 493#define NET_IP_ALIGN 0
494#define NET_SKB_PAD L1_CACHE_BYTES 494#define NET_SKB_PAD L1_CACHE_BYTES
495
496#define cmpxchg64(ptr, o, n) \
497 ({ \
498 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
499 cmpxchg((ptr), (o), (n)); \
500 })
501#define cmpxchg64_local(ptr, o, n) \
502 ({ \
503 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
504 cmpxchg_local((ptr), (o), (n)); \
505 })
506#else
507#include <asm-generic/cmpxchg-local.h>
508#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
495#endif 509#endif
496 510
497#define arch_align_stack(x) (x) 511#define arch_align_stack(x) (x)