summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/svm/svm_fifo.h4
-rw-r--r--src/vppinfra/atomics.h1
2 files changed, 3 insertions, 2 deletions
diff --git a/src/svm/svm_fifo.h b/src/svm/svm_fifo.h
index 6c3940dfad5..59d7ee01c8e 100644
--- a/src/svm/svm_fifo.h
+++ b/src/svm/svm_fifo.h
@@ -173,7 +173,7 @@ svm_fifo_set_event (svm_fifo_t * f)
{
/* return __sync_lock_test_and_set (&f->has_event, 1) == 0;
return __sync_bool_compare_and_swap (&f->has_event, 0, 1); */
- return !__atomic_exchange_n (&f->has_event, 1, __ATOMIC_RELEASE);
+ return !clib_atomic_swap_rel_n (&f->has_event, 1);
}
/**
@@ -184,7 +184,7 @@ svm_fifo_set_event (svm_fifo_t * f)
always_inline void
svm_fifo_unset_event (svm_fifo_t * f)
{
- __atomic_exchange_n (&f->has_event, 0, __ATOMIC_ACQUIRE);
+ clib_atomic_swap_acq_n (&f->has_event, 0);
}
svm_fifo_t *svm_fifo_create (u32 data_size_in_bytes);
diff --git a/src/vppinfra/atomics.h b/src/vppinfra/atomics.h
index 8084bdc77d4..6fe3af27d97 100644
--- a/src/vppinfra/atomics.h
+++ b/src/vppinfra/atomics.h
@@ -43,6 +43,7 @@
#define clib_atomic_load_acq_n(a) __atomic_load_n((a), __ATOMIC_ACQUIRE)
#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)
+#define clib_atomic_swap_rel_n(a, b) __atomic_exchange_n ((a), (b), __ATOMIC_RELEASE)
#define clib_atomic_fetch_add_rel(a, b) __atomic_fetch_add((a), (b), __ATOMIC_RELEASE)
#define clib_atomic_fetch_sub_rel(a, b) __atomic_fetch_sub((a), (b), __ATOMIC_RELEASE)