Skip to content

Commit 009a3f0

Browse files
committed
opal/asm: fix 32-bit fetch and op atomics
These functions were erroneously returing the new, not the old value. Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
1 parent 7dcab6e commit 009a3f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

opal/include/opal/sys/powerpc/atomic.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Copyright (c) 2004-2005 The Regents of the University of California.
1212
* All rights reserved.
1313
* Copyright (c) 2010-2017 IBM Corporation. All rights reserved.
14-
* Copyright (c) 2015-2017 Los Alamos National Security, LLC. All rights
14+
* Copyright (c) 2015-2018 Los Alamos National Security, LLC. All rights
1515
* reserved.
1616
* $COPYRIGHT$
1717
*
@@ -414,7 +414,7 @@ static inline int32_t opal_atomic_fetch_ ## type ## _32(volatile int32_t* v, int
414414
: "r" (val), "r" OPAL_ASM_ADDR(v), "m" (*v) \
415415
: "cc"); \
416416
\
417-
return t; \
417+
return old; \
418418
}
419419

420420
OPAL_ATOMIC_POWERPC_DEFINE_ATOMIC_32(add, add)

0 commit comments

Comments
 (0)