X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;ds=sidebyside;f=urcu%2Farch%2Fx86.h;h=ecc4b2d39b4133cb026fbe98be6cace2c5c3e223;hb=c23069c6cf733ed8a39e64300c264285f658ae23;hp=7af1ca524e091fb9f9aaa8b6c2d1d102d3abe270;hpb=b33e85a89e3fab8e58c8932d3d22e802de8d3ab2;p=urcu.git diff --git a/urcu/arch/x86.h b/urcu/arch/x86.h index 7af1ca5..ecc4b2d 100644 --- a/urcu/arch/x86.h +++ b/urcu/arch/x86.h @@ -24,6 +24,7 @@ #include #include +#include #ifdef __cplusplus extern "C" { @@ -66,7 +67,7 @@ extern "C" { #endif #endif -#define caa_cpu_relax() __asm__ __volatile__ ("rep; nop" : : : "memory"); +#define caa_cpu_relax() __asm__ __volatile__ ("rep; nop" : : : "memory") #define rdtscll(val) \ do { \ @@ -86,6 +87,20 @@ static inline cycles_t caa_get_cycles(void) return ret; } +/* + * Define the membarrier system call number if not yet available in the + * system headers. + */ +#if (CAA_BITS_PER_LONG == 32) +#ifndef __NR_membarrier +#define __NR_membarrier 375 +#endif +#else +#ifndef __NR_membarrier +#define __NR_membarrier 324 +#endif +#endif + #ifdef __cplusplus } #endif