diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | sysdeps/tile/tilepro/atomic-machine.h | 10 |
2 files changed, 15 insertions, 0 deletions
@@ -1,3 +1,8 @@ +2016-11-10 Chris Metcalf <cmetcalf@mellanox.com> + + * sysdeps/tile/tilepro/atomic-machine.h (atomic_store_relaxed) + (atomic_store_release): Provide tilepro-specific implementations. + 2016-11-10 Joseph Myers <joseph@codesourcery.com> * math/math.h (__MATH_TG): New macro. diff --git a/sysdeps/tile/tilepro/atomic-machine.h b/sysdeps/tile/tilepro/atomic-machine.h index 702e17d77d..5365929c94 100644 --- a/sysdeps/tile/tilepro/atomic-machine.h +++ b/sysdeps/tile/tilepro/atomic-machine.h @@ -83,6 +83,16 @@ int __atomic_update_32 (volatile int *mem, int mask, int addend) ({ __typeof (mask) __att1_v = (mask); \ __atomic_update ((mem), ~__att1_v, __att1_v); }) +/* + * We must use the kernel atomics for atomic_store, since otherwise an + * unsynchronized store could become visible after another core's + * kernel-atomic implementation had read the memory word in question, + * but before it had written the updated value to it, which would + * cause the unsynchronized store to be lost. + */ +#define atomic_store_relaxed(mem, val) atomic_exchange_acq (mem, val) +#define atomic_store_release(mem, val) atomic_exchange_rel (mem, val) + #include <sysdeps/tile/atomic-machine.h> #endif /* atomic-machine.h */ |