Support sys_membarrier v6 ABI
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Wed, 13 Jan 2010 23:46:53 +0000 (18:46 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Wed, 13 Jan 2010 23:46:53 +0000 (18:46 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
urcu-static.h
urcu.c

index 853c327d5eec3fb49b6e2ea4997c981379925571..44bcd073710e3e98d760c667eb7aa787238bb3ff 100644 (file)
@@ -56,10 +56,12 @@ extern "C" {
 
 /* If the headers do not support SYS_membarrier, statically use RCU_MB */
 #ifdef SYS_membarrier
-#define membarrier(...)                syscall(__NR_membarrier, __VA_ARGS__)
+# define MEMBARRIER_EXPEDITED            (1 << 0)
+# define MEMBARRIER_DELAYED              (1 << 1)
+# define membarrier(...)               syscall(__NR_membarrier, __VA_ARGS__)
 #else
-#undef RCU_MEMBARRIER
-#define RCU_MB
+# undef RCU_MEMBARRIER
+# define RCU_MB
 #endif
 #endif
 
diff --git a/urcu.c b/urcu.c
index 67a3eb21c8996b0751f9fc1d14ed9d71379f8bf5..b8e8b422a5941adab6999979736317a29e2d51f9 100644 (file)
--- a/urcu.c
+++ b/urcu.c
@@ -132,7 +132,7 @@ static void switch_next_rcu_qparity(void)
 static void smp_mb_heavy(void)
 {
        if (likely(has_sys_membarrier))
-               membarrier(1);
+               membarrier(MEMBARRIER_EXPEDITED);
        else
                smp_mb();
 }
@@ -392,7 +392,7 @@ void rcu_init(void)
        if (init_done)
                return;
        init_done = 1;
-       if (!membarrier(1))
+       if (!membarrier(MEMBARRIER_EXPEDITED))
                has_sys_membarrier = 1;
 }
 #endif
This page took 0.027018 seconds and 4 git commands to generate.