From 0ecb3fde04135d76545ce55d80abea9aef465b54 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 20 May 2010 18:09:20 -0400 Subject: [PATCH] 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 --- urcu/uatomic_arch_ppc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */ -- 2.34.1