Module Name: src
Committed By: riastradh
Date: Sun Dec 19 11:33:17 UTC 2021
Modified Files:
src/sys/external/bsd/common/include/linux: rcupdate.h
Log Message:
linux: rcu_replace_pointer
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/common/include/linux/rcupdate.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/external/bsd/common/include/linux/rcupdate.h
diff -u src/sys/external/bsd/common/include/linux/rcupdate.h:1.5 src/sys/external/bsd/common/include/linux/rcupdate.h:1.6
--- src/sys/external/bsd/common/include/linux/rcupdate.h:1.5 Sun Dec 19 11:31:04 2021
+++ src/sys/external/bsd/common/include/linux/rcupdate.h Sun Dec 19 11:33:17 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: rcupdate.h,v 1.5 2021/12/19 11:31:04 riastradh Exp $ */
+/* $NetBSD: rcupdate.h,v 1.6 2021/12/19 11:33:17 riastradh Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -53,6 +53,14 @@
(P); \
})
+#define rcu_replace_pointer(PTRP, NEWPTR, C) ({ \
+ __typeof__(PTRP) __rrp_ptrp = (PTRP); \
+ __typeof__(PTRP) __rrp_oldptr = \
+ rcu_dereference_protected(__rrp_ptrp, C); \
+ rcu_assign_pointer(__rrp_ptrp, NEWPTR); \
+ __rrp_oldptr; \
+})
+
/* kill_dependency */
#define rcu_pointer_handoff(P) (P)