Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/common/include/linux Simplify rcu_* definit...
details: https://anonhg.NetBSD.org/src/rev/0162c3dadd2a
branches: trunk
changeset: 1028352:0162c3dadd2a
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Dec 19 10:47:19 2021 +0000
description:
Simplify rcu_* definitions with atomic_load/store_*.
diffstat:
sys/external/bsd/common/include/linux/rcupdate.h | 21 ++++-----------------
1 files changed, 4 insertions(+), 17 deletions(-)
diffs (42 lines):
diff -r d0331db2300f -r 0162c3dadd2a sys/external/bsd/common/include/linux/rcupdate.h
--- a/sys/external/bsd/common/include/linux/rcupdate.h Sun Dec 19 10:47:13 2021 +0000
+++ b/sys/external/bsd/common/include/linux/rcupdate.h Sun Dec 19 10:47:19 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rcupdate.h,v 1.3 2021/12/19 09:48:29 riastradh Exp $ */
+/* $NetBSD: rcupdate.h,v 1.4 2021/12/19 10:47:19 riastradh Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -42,17 +42,9 @@
#define RCU_INIT_POINTER(P, V) ((P) = (V))
-#define rcu_assign_pointer(P, V) do { \
- __typeof__(*(P)) *__rcu_assign_pointer_tmp = (V); \
- membar_exit(); \
- (P) = __rcu_assign_pointer_tmp; \
-} while (0)
-
-#define rcu_dereference(P) ({ \
- __typeof__(*(P)) *__rcu_dereference_tmp = (P); \
- membar_datadep_consumer(); \
- __rcu_dereference_tmp; \
-})
+#define rcu_assign_pointer(P,V) atomic_store_release(&(P), (V))
+#define rcu_dereference(P) atomic_load_consume(&(P))
+#define rcu_access_pointer(P) atomic_load_relaxed(&(P))
#define rcu_dereference_raw rcu_dereference
@@ -61,11 +53,6 @@
(P); \
})
-#define rcu_access_pointer(P) ({ \
- __typeof__(*(P)) *__rcu_access_pointer_tmp = (P); \
- __insn_barrier(); \
- __rcu_access_pointer_tmp; \
-})
/* kill_dependency */
#define rcu_pointer_handoff(P) (P)
Home |
Main Index |
Thread Index |
Old Index