diff mbox

[2/4] linux-generic: odp_barrier.h: use odp_atomic_internal.h

Message ID 1416955068-6580-3-git-send-email-ola.liljedahl@linaro.org
State New
Headers show

Commit Message

Ola Liljedahl Nov. 25, 2014, 10:37 p.m. UTC
Signed-off-by: Ola Liljedahl <ola.liljedahl@linaro.org>
---
Use definitions from odp_atomic_internal.h.

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

Comments

Anders Roxell Nov. 27, 2014, 12:48 p.m. UTC | #1
Nit: I think you menat odp_barrier.c and not .h in the message right

On 2014-11-25 23:37, Ola Liljedahl wrote:
> Signed-off-by: Ola Liljedahl <ola.liljedahl@linaro.org>
> ---
> 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..2fef386 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..2fef386 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();
 }