projects
/
userspace-rcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: add missing __cds_wfcq_init for LGPL API
[userspace-rcu.git]
/
urcu
/
static
/
urcu-bp.h
diff --git
a/urcu/static/urcu-bp.h
b/urcu/static/urcu-bp.h
index df25393d06d6a1a19b0b281f81cedf767bd2d470..6e52d84bafe84f75dfd45593a2b58cad6431bcd0 100644
(file)
--- a/
urcu/static/urcu-bp.h
+++ b/
urcu/static/urcu-bp.h
@@
-102,6
+102,16
@@
struct rcu_reader {
*/
extern DECLARE_URCU_TLS(struct rcu_reader *, rcu_reader);
*/
extern DECLARE_URCU_TLS(struct rcu_reader *, rcu_reader);
+extern int urcu_bp_has_sys_membarrier;
+
+static inline void urcu_bp_smp_mb_slave(void)
+{
+ if (caa_likely(urcu_bp_has_sys_membarrier))
+ cmm_barrier();
+ else
+ cmm_smp_mb();
+}
+
static inline enum rcu_state rcu_reader_state(unsigned long *ctr)
{
unsigned long v;
static inline enum rcu_state rcu_reader_state(unsigned long *ctr)
{
unsigned long v;
@@
-131,7
+141,7
@@
static inline void _rcu_read_lock_update(unsigned long tmp)
{
if (caa_likely(!(tmp & RCU_GP_CTR_NEST_MASK))) {
_CMM_STORE_SHARED(URCU_TLS(rcu_reader)->ctr, _CMM_LOAD_SHARED(rcu_gp.ctr));
{
if (caa_likely(!(tmp & RCU_GP_CTR_NEST_MASK))) {
_CMM_STORE_SHARED(URCU_TLS(rcu_reader)->ctr, _CMM_LOAD_SHARED(rcu_gp.ctr));
-
cmm_smp_mb
();
+
urcu_bp_smp_mb_slave
();
} else
_CMM_STORE_SHARED(URCU_TLS(rcu_reader)->ctr, tmp + RCU_GP_COUNT);
}
} else
_CMM_STORE_SHARED(URCU_TLS(rcu_reader)->ctr, tmp + RCU_GP_COUNT);
}
@@
-170,7
+180,7
@@
static inline void _rcu_read_unlock(void)
tmp = URCU_TLS(rcu_reader)->ctr;
urcu_assert(tmp & RCU_GP_CTR_NEST_MASK);
/* Finish using rcu before decrementing the pointer. */
tmp = URCU_TLS(rcu_reader)->ctr;
urcu_assert(tmp & RCU_GP_CTR_NEST_MASK);
/* Finish using rcu before decrementing the pointer. */
-
cmm_smp_mb
();
+
urcu_bp_smp_mb_slave
();
_CMM_STORE_SHARED(URCU_TLS(rcu_reader)->ctr, tmp - RCU_GP_COUNT);
cmm_barrier(); /* Ensure the compiler does not reorder us with mutex */
}
_CMM_STORE_SHARED(URCU_TLS(rcu_reader)->ctr, tmp - RCU_GP_COUNT);
cmm_barrier(); /* Ensure the compiler does not reorder us with mutex */
}
@@
-189,7
+199,7
@@
static inline int _rcu_read_ongoing(void)
return URCU_TLS(rcu_reader)->ctr & RCU_GP_CTR_NEST_MASK;
}
return URCU_TLS(rcu_reader)->ctr & RCU_GP_CTR_NEST_MASK;
}
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
}
#endif
This page took
0.022691 seconds
and
4
git commands to generate.