X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=urcu-bp.c;fp=urcu-bp.c;h=20684cc4d0972a61427f8ecae0e5fd7eb5072189;hp=6b78af8bd8dfc77545a8a11adcfec997434e57bd;hb=999991c6e4600c410181baea65bda9f406464872;hpb=f541831e757bc5e0143550f5d686bed0de7d41b7 diff --git a/urcu-bp.c b/urcu-bp.c index 6b78af8..20684cc 100644 --- a/urcu-bp.c +++ b/urcu-bp.c @@ -36,6 +36,7 @@ #include #include +#include "urcu/arch.h" #include "urcu/wfcqueue.h" #include "urcu/map/urcu-bp.h" #include "urcu/static/urcu-bp.h" @@ -94,16 +95,9 @@ void *mremap_wrapper(void *old_address, size_t old_size, static int rcu_bp_refcount; -/* - * RCU_MEMBARRIER is only possibly available on Linux. - */ -#ifdef __linux__ -#include -#endif - -/* If the headers do not support SYS_membarrier, fall back on RCU_MB */ -#ifdef SYS_membarrier -# define membarrier(...) syscall(SYS_membarrier, __VA_ARGS__) +/* If the headers do not support membarrier system call, fall back smp_mb. */ +#ifdef __NR_membarrier +# define membarrier(...) syscall(__NR_membarrier, __VA_ARGS__) #else # define membarrier(...) -ENOSYS #endif