@@ -230,6 +230,7 @@ static inline int32_t opal_atomic_swap_32(volatile int32_t *addr, int32_t newval
230230#if (OPAL_ASSEMBLY_ARCH == OPAL_POWERPC64 )
231231
232232#if OPAL_GCC_INLINE_ASSEMBLY
233+
233234static inline int64_t opal_atomic_add_64 (volatile int64_t * v , int64_t inc )
234235{
235236 int64_t t ;
@@ -239,7 +240,7 @@ static inline int64_t opal_atomic_add_64 (volatile int64_t* v, int64_t inc)
239240 " stdcx. %0, 0, %3 \n\t"
240241 " bne- 1b \n\t"
241242 : "=&r" (t ), "=m" (* v )
242- : "r" (OPAL_ASM_VALUE64 (inc )), "r" OPAL_ASM_ADDR (v )
243+ : "r" (OPAL_ASM_VALUE64 (inc )), "r" OPAL_ASM_ADDR (v ), "m" ( * v )
243244 : "cc ");
244245
245246 return t ;
@@ -256,7 +257,7 @@ static inline int64_t opal_atomic_sub_64 (volatile int64_t* v, int64_t dec)
256257 " stdcx. %0,0,%3 \n\t"
257258 " bne- 1b \n\t"
258259 : "=&r" (t ), "=m" (* v )
259- : "r" (OPAL_ASM_VALUE64 (dec )), "r" OPAL_ASM_ADDR (v )
260+ : "r" (OPAL_ASM_VALUE64 (dec )), "r" OPAL_ASM_ADDR (v ), "m" ( * v )
260261 : "cc ");
261262
262263 return t ;
@@ -275,7 +276,7 @@ static inline int opal_atomic_cmpset_64(volatile int64_t *addr,
275276 " bne- 1b \n\t"
276277 "2:"
277278 : "=&r" (ret ), "=m" (* addr )
278- : "r" (addr ), "r" (OPAL_ASM_VALUE64 (oldval )), "r" (OPAL_ASM_VALUE64 (newval ))
279+ : "r" (addr ), "r" (OPAL_ASM_VALUE64 (oldval )), "r" (OPAL_ASM_VALUE64 (newval )), "m" ( * addr )
279280 : "cc" , "memory" );
280281
281282 return (ret == oldval );
0 commit comments