From: Mathieu Desnoyers Date: Thu, 20 May 2010 22:09:20 +0000 (-0400) Subject: Fix powerpc uatomic 4-byte cmpxchg (cmpd -> cmpw) X-Git-Tag: v0.4.4~1 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=0ecb3fde04135d76545ce55d80abea9aef465b54;p=userspace-rcu.git Fix powerpc uatomic 4-byte cmpxchg (cmpd -> cmpw) Necessary to make it work on 32-bit only powerpc architectures. Was using the 64-bit comparison rather than the 32-bit comparison for 4-byte cmpxchg. Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu/uatomic_arch_ppc.h b/urcu/uatomic_arch_ppc.h index 4db7007..710ce05 100644 --- a/urcu/uatomic_arch_ppc.h +++ b/urcu/uatomic_arch_ppc.h @@ -106,7 +106,7 @@ unsigned long _uatomic_cmpxchg(void *addr, unsigned long old, __asm__ __volatile__( LWSYNC_OPCODE "1:\t" "lwarx %0,0,%1\n" /* load and reserve */ - "cmpd %0,%3\n" /* if load is not equal to */ + "cmpw %0,%3\n" /* if load is not equal to */ "bne 2f\n" /* old, fail */ "stwcx. %2,0,%1\n" /* else store conditional */ "bne- 1b\n" /* retry if lost reservation */