diff --git a/include/spdk/barrier.h b/include/spdk/barrier.h index cd670abf29..20a4cacd59 100644 --- a/include/spdk/barrier.h +++ b/include/spdk/barrier.h @@ -113,8 +113,10 @@ extern "C" { #define spdk_smp_mb() spdk_mb() #elif defined(__aarch64__) #define spdk_smp_mb() __asm volatile("dmb ish" ::: "memory") -#elif defined(__i386__) || defined(__x86_64__) -#define spdk_smp_mb() spdk_mb() +#elif defined(__x86_64__) +#define spdk_smp_mb() __asm volatile("lock addl $0, -128(%%rsp); " ::: "memory"); +#elif defined(__i386__) +#define spdk_smp_mb() __asm volatile("lock addl $0, -128(%%esp); " ::: "memory"); #else #define spdk_smp_mb() #error Unknown architecture