]> git.neil.brown.name Git - history.git/commitdiff
ppc64: Fix nasty bug in cmpxchg where we would sign extend the old value.
authorAnton Blanchard <anton@samba.org>
Mon, 10 Feb 2003 21:45:43 +0000 (08:45 +1100)
committerAnton Blanchard <anton@samba.org>
Mon, 10 Feb 2003 21:45:43 +0000 (08:45 +1100)
include/asm-ppc64/system.h

index 0e8a106ac123e8705a634958ee8aed9c8ebdec33..6e5ddfaf9614ea7eb588232b2cd2ef022c8b8577 100644 (file)
@@ -196,7 +196,7 @@ __xchg(volatile void *ptr, unsigned long x, int size)
 static __inline__ unsigned long
 __cmpxchg_u32(volatile int *p, int old, int new)
 {
-       int prev;
+       unsigned int prev;
 
        __asm__ __volatile__ (
        EIEIO_ON_SMP
@@ -218,7 +218,7 @@ __cmpxchg_u32(volatile int *p, int old, int new)
 static __inline__ unsigned long
 __cmpxchg_u64(volatile long *p, unsigned long old, unsigned long new)
 {
-       int prev;
+       unsigned long prev;
 
        __asm__ __volatile__ (
        EIEIO_ON_SMP