X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=urcu%2Farch_x86.h;h=4abac2bb304de37a42855924de0c7bedbb8bab78;hp=d455b89b15671fe9a2da8be8dd570907cc01f984;hb=02be55611d3b1c7bf4fdfcb3a9c98f621882d417;hpb=b4e52e3e9e563d38607a8e0ab0aa72e7ab2b47b4 diff --git a/urcu/arch_x86.h b/urcu/arch_x86.h index d455b89..4abac2b 100644 --- a/urcu/arch_x86.h +++ b/urcu/arch_x86.h @@ -23,19 +23,17 @@ */ #include -#include +#include + +#ifdef __cplusplus +extern "C" { +#endif -/* Assume P4 or newer */ -#define CONFIG_HAVE_FENCE 1 #define CONFIG_HAVE_MEM_COHERENCY #define CACHE_LINE_SIZE 128 -#ifndef BITS_PER_LONG -#define BITS_PER_LONG (__SIZEOF_LONG__ * 8) -#endif - -#ifdef CONFIG_HAVE_FENCE +#ifdef CONFIG_RCU_HAVE_FENCE #define mb() asm volatile("mfence":::"memory") #define rmb() asm volatile("lfence":::"memory") #define wmb() asm volatile("sfence"::: "memory") @@ -64,10 +62,7 @@ #define rmc() barrier() #define wmc() barrier() -/* Assume SMP machine, given we don't have this information */ -#define CONFIG_SMP 1 - -#ifdef CONFIG_SMP +#ifdef CONFIG_RCU_SMP #define smp_mb() mb() #define smp_rmb() rmb() #define smp_wmb() wmb() @@ -134,4 +129,8 @@ static inline cycles_t get_cycles(void) return ret; } +#ifdef __cplusplus +} +#endif + #endif /* _URCU_ARCH_X86_H */