Use full memory barrier from API instead of the internal function. Signed-off-by: Petri Savolainen <petri.savolai...@nokia.com> --- platform/linux-generic/include/odp_atomic_internal.h | 6 ------ platform/linux-generic/odp_barrier.c | 8 ++++---- 2 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/platform/linux-generic/include/odp_atomic_internal.h b/platform/linux-generic/include/odp_atomic_internal.h index ce62368..ff3813f 100644 --- a/platform/linux-generic/include/odp_atomic_internal.h +++ b/platform/linux-generic/include/odp_atomic_internal.h @@ -64,12 +64,6 @@ typedef enum { _ODP_MEMMODEL_SC = __ATOMIC_SEQ_CST } _odp_memmodel_t; -/** - * Insert a full memory barrier (fence) in the compiler and instruction - * sequence. - */ -#define _ODP_FULL_BARRIER() __atomic_thread_fence(__ATOMIC_SEQ_CST) - /***************************************************************************** * Operations on 32-bit atomics * _odp_atomic_u32_load_mm - return current value diff --git a/platform/linux-generic/odp_barrier.c b/platform/linux-generic/odp_barrier.c index 0bfc0f0..f3525e2 100644 --- a/platform/linux-generic/odp_barrier.c +++ b/platform/linux-generic/odp_barrier.c @@ -7,7 +7,7 @@ #include <odp/barrier.h> #include <odp/sync.h> #include <odp/cpu.h> -#include <odp_atomic_internal.h> +#include <odp/atomic.h> void odp_barrier_init(odp_barrier_t *barrier, int count) { @@ -27,13 +27,13 @@ void odp_barrier_init(odp_barrier_t *barrier, int count) * the cycle the barrier was in upon entry. Exit is when the * barrier crosses to the other half of the cycle. */ - void odp_barrier_wait(odp_barrier_t *barrier) { uint32_t count; int wasless; - _ODP_FULL_BARRIER(); + odp_mb_full(); + count = odp_atomic_fetch_inc_u32(&barrier->bar); wasless = count < barrier->count; @@ -46,5 +46,5 @@ void odp_barrier_wait(odp_barrier_t *barrier) odp_cpu_pause(); } - _ODP_FULL_BARRIER(); + odp_mb_full(); } -- 2.6.3 _______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org https://lists.linaro.org/mailman/listinfo/lng-odp