X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=urcu%2Farch%2Fx86.h;h=afbf4fad37b68b8cb18f2eccb15f8c308e1eb02d;hp=ccc4ce8aab5235a9c6209867d3e99c15f62c1fc0;hb=f8c43f458c80566d298d539ec518a8be8c7cc861;hpb=2c81778bd92008e5c79173788738f1800cd42e8b diff --git a/urcu/arch/x86.h b/urcu/arch/x86.h index ccc4ce8..afbf4fa 100644 --- a/urcu/arch/x86.h +++ b/urcu/arch/x86.h @@ -24,6 +24,7 @@ #include #include +#include #ifdef __cplusplus extern "C" { @@ -68,6 +69,8 @@ extern "C" { #define caa_cpu_relax() __asm__ __volatile__ ("rep; nop" : : : "memory") +#define HAS_CAA_GET_CYCLES + #define rdtscll(val) \ do { \ unsigned int __a, __d; \ @@ -86,6 +89,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