projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add extern "C" to support linking userspace RCU library with C++ applications
[urcu.git]
/
urcu
/
uatomic_arch_ppc.h
diff --git
a/urcu/uatomic_arch_ppc.h
b/urcu/uatomic_arch_ppc.h
index 68b5faaf7c0510f41455bb4ac1b08edbccda8102..b732b08c42389a465db3b72d8b18386357dd120f 100644
(file)
--- a/
urcu/uatomic_arch_ppc.h
+++ b/
urcu/uatomic_arch_ppc.h
@@
-21,6
+21,11
@@
*/
#include <urcu/compiler.h>
*/
#include <urcu/compiler.h>
+#include <urcu/system.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
#ifndef __SIZEOF_LONG__
#ifdef __powerpc64__
#ifndef __SIZEOF_LONG__
#ifdef __powerpc64__
@@
-36,12
+41,8
@@
#define ILLEGAL_INSTR ".long 0xd00d00"
#define ILLEGAL_INSTR ".long 0xd00d00"
-#define uatomic_set(addr, v) \
-do { \
- ACCESS_ONCE(*(addr)) = (v); \
-} while (0)
-
-#define uatomic_read(addr) ACCESS_ONCE(*(addr))
+#define uatomic_set(addr, v) STORE_SHARED(*(addr), (v))
+#define uatomic_read(addr) LOAD_SHARED(*(addr))
/*
* Using a isync as second barrier for exchange to provide acquire semantic.
/*
* Using a isync as second barrier for exchange to provide acquire semantic.
@@
-228,7
+229,10
@@
unsigned long _uatomic_add_return(void *addr, unsigned long val,
#define uatomic_inc(addr) uatomic_add((addr), 1)
#define uatomic_dec(addr) uatomic_add((addr), -1)
#define uatomic_inc(addr) uatomic_add((addr), 1)
#define uatomic_dec(addr) uatomic_add((addr), -1)
-#define URCU_CAS_AVAIL() 1
#define compat_uatomic_cmpxchg(ptr, old, _new) uatomic_cmpxchg(ptr, old, _new)
#define compat_uatomic_cmpxchg(ptr, old, _new) uatomic_cmpxchg(ptr, old, _new)
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _URCU_ARCH_UATOMIC_PPC_H */
#endif /* _URCU_ARCH_UATOMIC_PPC_H */
This page took
0.023333 seconds
and
4
git commands to generate.