eal: memory barriers use intrinsic functions

Signed-off-by: Intel
This commit is contained in:
Intel 2013-06-03 00:00:00 +00:00 committed by Thomas Monjalon
parent 0fa75ccc24
commit d6772940c0

View File

@ -64,7 +64,7 @@ extern "C" {
* Guarantees that the LOAD and STORE operations generated before the * Guarantees that the LOAD and STORE operations generated before the
* barrier occur before the LOAD and STORE operations generated after. * barrier occur before the LOAD and STORE operations generated after.
*/ */
#define rte_mb() asm volatile("mfence;" : : : "memory") #define rte_mb() _mm_mfence()
/** /**
* Write memory barrier. * Write memory barrier.
@ -72,7 +72,7 @@ extern "C" {
* Guarantees that the STORE operations generated before the barrier * Guarantees that the STORE operations generated before the barrier
* occur before the STORE operations generated after. * occur before the STORE operations generated after.
*/ */
#define rte_wmb() asm volatile("sfence;" : : : "memory") #define rte_wmb() _mm_sfence()
/** /**
* Read memory barrier. * Read memory barrier.
@ -80,7 +80,7 @@ extern "C" {
* Guarantees that the LOAD operations generated before the barrier * Guarantees that the LOAD operations generated before the barrier
* occur before the LOAD operations generated after. * occur before the LOAD operations generated after.
*/ */
#define rte_rmb() asm volatile("lfence;" : : : "memory") #define rte_rmb() _mm_lfence()
#include <emmintrin.h> #include <emmintrin.h>