X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=urcu%2Farch%2Fx86.h;h=aac8ca1384b63f4ce321680cffbcaca661a0f16c;hp=a5b3a23b385f26f7aea6b5daaf70cab762fc4262;hb=2af1c19e6a553878fcb2a5106f050d5ed7ac0f54;hpb=67ecffc0f530a7b5c4dd5111ea7dd3213da8eb91 diff --git a/urcu/arch/x86.h b/urcu/arch/x86.h index a5b3a23..aac8ca1 100644 --- a/urcu/arch/x86.h +++ b/urcu/arch/x86.h @@ -25,6 +25,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { @@ -79,26 +80,24 @@ extern "C" { | (((unsigned long long)__d) << 32); \ } while(0) -typedef unsigned long long cycles_t; +typedef uint64_t caa_cycles_t; -static inline cycles_t caa_get_cycles(void) +static inline caa_cycles_t caa_get_cycles(void) { - cycles_t ret = 0; + caa_cycles_t ret = 0; rdtscll(ret); return ret; } /* - * Define the membarrier system call number if not yet available in the - * system headers. + * On Linux, define the membarrier system call number if not yet available in + * the system headers. */ +#if (defined(__linux__) && !defined(__NR_membarrier)) #if (CAA_BITS_PER_LONG == 32) -#ifndef __NR_membarrier #define __NR_membarrier 375 -#endif #else -#ifndef __NR_membarrier #define __NR_membarrier 324 #endif #endif