From 97801028ba87af18c7bd0274a13c62262da188ac Mon Sep 17 00:00:00 2001 From: "Nysal Jan K.A" Date: Wed, 11 Jan 2017 10:36:19 -0500 Subject: [PATCH] asm/ppc: Fix a regression in powerpc atomics Add a missing constraint to the input operand list. This fixes a regression caused by d4be138a7b. Thanks to Orion Poplawski for reporting the issue. Refs #2610 Signed-off-by: Nysal Jan K.A --- opal/include/opal/sys/powerpc/atomic.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/opal/include/opal/sys/powerpc/atomic.h b/opal/include/opal/sys/powerpc/atomic.h index d8f5aa18aef..019b44edb49 100644 --- a/opal/include/opal/sys/powerpc/atomic.h +++ b/opal/include/opal/sys/powerpc/atomic.h @@ -230,6 +230,7 @@ static inline int32_t opal_atomic_swap_32(volatile int32_t *addr, int32_t newval #if (OPAL_ASSEMBLY_ARCH == OPAL_POWERPC64) #if OPAL_GCC_INLINE_ASSEMBLY + static inline int64_t opal_atomic_add_64 (volatile int64_t* v, int64_t inc) { int64_t t; @@ -239,7 +240,7 @@ static inline int64_t opal_atomic_add_64 (volatile int64_t* v, int64_t inc) " stdcx. %0, 0, %3 \n\t" " bne- 1b \n\t" : "=&r" (t), "=m" (*v) - : "r" (OPAL_ASM_VALUE64(inc)), "r" OPAL_ASM_ADDR(v) + : "r" (OPAL_ASM_VALUE64(inc)), "r" OPAL_ASM_ADDR(v), "m" (*v) : "cc"); return t; @@ -256,7 +257,7 @@ static inline int64_t opal_atomic_sub_64 (volatile int64_t* v, int64_t dec) " stdcx. %0,0,%3 \n\t" " bne- 1b \n\t" : "=&r" (t), "=m" (*v) - : "r" (OPAL_ASM_VALUE64(dec)), "r" OPAL_ASM_ADDR(v) + : "r" (OPAL_ASM_VALUE64(dec)), "r" OPAL_ASM_ADDR(v), "m" (*v) : "cc"); return t; @@ -275,7 +276,7 @@ static inline int opal_atomic_cmpset_64(volatile int64_t *addr, " bne- 1b \n\t" "2:" : "=&r" (ret), "=m" (*addr) - : "r" (addr), "r" (OPAL_ASM_VALUE64(oldval)), "r" (OPAL_ASM_VALUE64(newval)) + : "r" (addr), "r" (OPAL_ASM_VALUE64(oldval)), "r" (OPAL_ASM_VALUE64(newval)), "m" (*addr) : "cc", "memory"); return (ret == oldval);