Revert "Create per RCU flavor CDS libraries"
[urcu.git] / urcu / map / urcu.h
index 5942fad207102784e0c0f7f14f53734807c1de88..3f436a7375120366bca0898aafd3debdc45a48a5 100644 (file)
 #define RCU_MEMBARRIER
 #endif
 
+/*
+ * RCU_MEMBARRIER is only possibly available on Linux. Fallback to
+ * RCU_MB
+ * otherwise.
+ */
+#if !defined(__linux__) && defined(RCU_MEMBARRIER)
+#undef RCU_MEMBARRIER
+#define RCU_MB
+#endif
+
+#ifdef RCU_MEMBARRIER
+#include <syscall.h>
+
+/* If the headers do not support SYS_membarrier, statically use RCU_MB */
+#ifdef SYS_membarrier
+# define MEMBARRIER_EXPEDITED          (1 << 0)
+# define MEMBARRIER_DELAYED            (1 << 1)
+# define MEMBARRIER_QUERY              (1 << 16)
+# define membarrier(...)               syscall(SYS_membarrier, __VA_ARGS__)
+#else
+# undef RCU_MEMBARRIER
+# define RCU_MB
+#endif
+#endif
+
 #ifdef RCU_MEMBARRIER
 
 #define rcu_read_lock                  rcu_read_lock_memb
This page took 0.022436 seconds and 4 git commands to generate.