uatomic compat: complete i386 support
[urcu.git] / urcu-pointer-static.h
index c2ba80025a2703b7edd69ac017ecc5cb9b57d1bc..eb073afa18683c5a6d1a626397aef70a21678d2c 100644 (file)
@@ -32,7 +32,7 @@
 #include <urcu/compiler.h>
 #include <urcu/arch.h>
 #include <urcu/system.h>
-#include <urcu/arch_uatomic.h>
+#include <urcu/uatomic_arch.h>
 
 /**
  * _rcu_dereference - reads (copy) a RCU-protected pointer to a local variable
  * should not be freed !).
  */
 
-#define _rcu_cmpxchg_pointer(p, old, _new)             \
-       ({                                              \
-               if (!__builtin_constant_p(_new) ||      \
-                   ((_new) != NULL))                   \
-                       wmb();                          \
-               uatomic_cmpxchg(p, old, _new);          \
+#define _rcu_cmpxchg_pointer(p, old, _new)                             \
+       ({                                                              \
+               typeof(*p) _________pold = (old);                       \
+               typeof(*p) _________pnew = (_new);                      \
+               if (!__builtin_constant_p(_new) ||                      \
+                   ((_new) != NULL))                                   \
+                       wmb();                                          \
+               uatomic_cmpxchg(p, _________pold, _________pnew);       \
        })
 
 /**
 
 #define _rcu_xchg_pointer(p, v)                                \
        ({                                              \
+               typeof(*p) _________pv = (v);           \
                if (!__builtin_constant_p(v) ||         \
                    ((v) != NULL))                      \
                        wmb();                          \
-               uatomic_xchg(p, v);                     \
+               uatomic_xchg(p, _________pv);           \
        })
 
 
 #define _rcu_set_pointer(p, v)                         \
        ({                                              \
+               typeof(*p) _________pv = (v);           \
                if (!__builtin_constant_p(v) ||         \
                    ((v) != NULL))                      \
                        wmb();                          \
-               STORE_SHARED(*(p), v);                  \
-       })
-
-/*
- * _rcu_publish_content - Exchanges the pointer and waits for quiescent state.
- *
- * The pointer returned can be freed.
- */
-#define _rcu_publish_content(p, v)                     \
-       ({                                              \
-               void *oldptr;                           \
-               oldptr = _rcu_xchg_pointer(p, v);       \
-               synchronize_rcu();                      \
-               oldptr;                                 \
+               uatomic_set(p, _________pv);            \
        })
 
 /**
This page took 0.023014 seconds and 4 git commands to generate.