aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra
diff options
context:
space:
mode:
Diffstat (limited to 'src/vppinfra')
-rw-r--r--src/vppinfra/atomics.h5
-rw-r--r--src/vppinfra/smp.h2
2 files changed, 3 insertions, 4 deletions
diff --git a/src/vppinfra/atomics.h b/src/vppinfra/atomics.h
index 8ddf13801df..420ae837fc0 100644
--- a/src/vppinfra/atomics.h
+++ b/src/vppinfra/atomics.h
@@ -37,9 +37,10 @@
#define clib_atomic_cmp_and_swap(addr,old,new) __sync_val_compare_and_swap(addr, old, new)
#define clib_atomic_bool_cmp_and_swap(addr,old,new) __sync_bool_compare_and_swap(addr, old, new)
-/*Accquire Barrier*/
#define clib_atomic_test_and_set(a) __sync_lock_test_and_set(a, 1)
-/*Release Barrier*/
#define clib_atomic_release(a) __sync_lock_release(a)
+#define clib_atomic_store_rel_n(a, b) __atomic_store_n ((a), (b), __ATOMIC_RELEASE)
+#define clib_atomic_swap_acq_n(a, b) __atomic_exchange_n ((a), (b), __ATOMIC_ACQUIRE)
+
#endif /* included_clib_atomics_h */
diff --git a/src/vppinfra/smp.h b/src/vppinfra/smp.h
index 7146e51ac77..2b3ed548dfa 100644
--- a/src/vppinfra/smp.h
+++ b/src/vppinfra/smp.h
@@ -41,8 +41,6 @@
#include <vppinfra/cache.h>
#include <vppinfra/os.h> /* for os_panic */
-#define clib_smp_swap(addr,new) __sync_lock_test_and_set(addr,new)
-
#if defined (i386) || defined (__x86_64__)
#define clib_smp_pause() do { asm volatile ("pause"); } while (0)
#elif defined (__aarch64__) || defined (__arm__)