* TO BE INCLUDED ONLY IN LGPL-COMPATIBLE CODE. See urcu-pointer.h for
* linking dynamically with the userspace rcu library.
*
- * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
+ * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
* Copyright (c) 2009 Paul E. McKenney, IBM Corporation.
*
* This library is free software; you can redistribute it and/or
#include <urcu/compiler.h>
#include <urcu/arch.h>
#include <urcu/system.h>
-#include <urcu/arch_uatomic.h>
+#include <urcu/uatomic_arch.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
/**
* _rcu_dereference - reads (copy) a RCU-protected pointer to a local variable
* Inserts memory barriers on architectures that require them (currently only
* Alpha) and documents which pointers are protected by RCU.
*
- * The compiler memory barrier in LOAD_SHARED() ensures that value-speculative
+ * The compiler memory barrier in CMM_LOAD_SHARED() ensures that value-speculative
* optimizations (e.g. VSS: Value Speculation Scheduling) does not perform the
* data read before the pointer read by speculating the value of the pointer.
* Correct ordering is ensured because the pointer is read as a volatile access.
*/
#define _rcu_dereference(p) ({ \
- typeof(p) _________p1 = LOAD_SHARED(p); \
- smp_read_barrier_depends(); \
+ typeof(p) _________p1 = CMM_LOAD_SHARED(p); \
+ cmm_smp_read_barrier_depends(); \
(_________p1); \
})
typeof(*p) _________pnew = (_new); \
if (!__builtin_constant_p(_new) || \
((_new) != NULL)) \
- wmb(); \
+ cmm_wmb(); \
uatomic_cmpxchg(p, _________pold, _________pnew); \
})
typeof(*p) _________pv = (v); \
if (!__builtin_constant_p(v) || \
((v) != NULL)) \
- wmb(); \
+ cmm_wmb(); \
uatomic_xchg(p, _________pv); \
})
typeof(*p) _________pv = (v); \
if (!__builtin_constant_p(v) || \
((v) != NULL)) \
- wmb(); \
- STORE_SHARED(*(p), _________pv); \
+ cmm_wmb(); \
+ uatomic_set(p, _________pv); \
})
/**
#define _rcu_assign_pointer(p, v) _rcu_set_pointer(&(p), v)
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _URCU_POINTER_STATIC_H */