diff mbox

[PATCHv2,2/5] linux-generic: odp_barrier.c: use odp_atomic_internal.h

Message ID 1417101181-13500-3-git-send-email-ola.liljedahl@linaro.org
State Accepted
Commit 5cfc42b7c6387aee57b200778ca75f5574f0fd5d
Headers show

Commit Message

Ola Liljedahl Nov. 27, 2014, 3:12 p.m. UTC
Signed-off-by: Ola Liljedahl <ola.liljedahl@linaro.org>
---
(This document/code contribution attached is provided under the terms of
agreement LES-LTM-21309)

Use definitions from odp_atomic_internal.h.

 platform/linux-generic/odp_barrier.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Bill Fischofer Nov. 28, 2014, 12:48 p.m. UTC | #1
On Thu, Nov 27, 2014 at 10:12 AM, Ola Liljedahl <ola.liljedahl@linaro.org>
wrote:

> Signed-off-by: Ola Liljedahl <ola.liljedahl@linaro.org>
>

 Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>

---
> (This document/code contribution attached is provided under the terms of
> agreement LES-LTM-21309)
>
> Use definitions from odp_atomic_internal.h.
>
>  platform/linux-generic/odp_barrier.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/platform/linux-generic/odp_barrier.c
> b/platform/linux-generic/odp_barrier.c
> index 3a511b2..c1a01d8 100644
> --- a/platform/linux-generic/odp_barrier.c
> +++ b/platform/linux-generic/odp_barrier.c
> @@ -7,6 +7,7 @@
>  #include <odp_barrier.h>
>  #include <odp_sync.h>
>  #include <odp_spin_internal.h>
> +#include <odp_atomic_internal.h>
>
>  void odp_barrier_init(odp_barrier_t *barrier, int count)
>  {
> @@ -32,7 +33,7 @@ void odp_barrier_wait(odp_barrier_t *barrier)
>         uint32_t count;
>         int wasless;
>
> -       __atomic_thread_fence(__ATOMIC_SEQ_CST);
> +       _ODP_FULL_BARRIER();
>         count   = odp_atomic_fetch_inc_u32(&barrier->bar);
>         wasless = count < barrier->count;
>
> @@ -45,5 +46,5 @@ void odp_barrier_wait(odp_barrier_t *barrier)
>                         odp_spin();
>         }
>
> -       __atomic_thread_fence(__ATOMIC_SEQ_CST);
> +       _ODP_FULL_BARRIER();
>  }
> --
> 1.9.1
>
>
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
diff mbox

Patch

diff --git a/platform/linux-generic/odp_barrier.c b/platform/linux-generic/odp_barrier.c
index 3a511b2..c1a01d8 100644
--- a/platform/linux-generic/odp_barrier.c
+++ b/platform/linux-generic/odp_barrier.c
@@ -7,6 +7,7 @@ 
 #include <odp_barrier.h>
 #include <odp_sync.h>
 #include <odp_spin_internal.h>
+#include <odp_atomic_internal.h>
 
 void odp_barrier_init(odp_barrier_t *barrier, int count)
 {
@@ -32,7 +33,7 @@  void odp_barrier_wait(odp_barrier_t *barrier)
 	uint32_t count;
 	int wasless;
 
-	__atomic_thread_fence(__ATOMIC_SEQ_CST);
+	_ODP_FULL_BARRIER();
 	count   = odp_atomic_fetch_inc_u32(&barrier->bar);
 	wasless = count < barrier->count;
 
@@ -45,5 +46,5 @@  void odp_barrier_wait(odp_barrier_t *barrier)
 			odp_spin();
 	}
 
-	__atomic_thread_fence(__ATOMIC_SEQ_CST);
+	_ODP_FULL_BARRIER();
 }