aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeel Chauhan <nc@FreeBSD.org>2021-04-28 15:04:52 +0000
committerNeel Chauhan <nc@FreeBSD.org>2021-04-28 15:04:52 +0000
commitefe7f12cd37bf8f2538df387d565e7849112a598 (patch)
tree865c23010b2b5619fe002c567054a10da7a8e763
parentd1e9441583fd85c7de5f48197d80c287f1a9494b (diff)
downloadsrc-efe7f12cd37bf8f2538df387d565e7849112a598.tar.gz
src-efe7f12cd37bf8f2538df387d565e7849112a598.zip
linuxkpi: Implement rcu_replace_pointer() macro
This is needed for the drm-kmod 5.5 update. Reviewed by: hselasky (src) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D30025
-rw-r--r--sys/compat/linuxkpi/common/include/linux/rcupdate.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/rcupdate.h b/sys/compat/linuxkpi/common/include/linux/rcupdate.h
index a43736e0285f..ea97fecee53b 100644
--- a/sys/compat/linuxkpi/common/include/linux/rcupdate.h
+++ b/sys/compat/linuxkpi/common/include/linux/rcupdate.h
@@ -97,6 +97,13 @@
(uintptr_t)(v)); \
} while (0)
+#define rcu_replace_pointer(rcu, ptr, c) \
+({ \
+ typeof(ptr) __tmp = rcu_dereference_protected(rcu, c); \
+ rcu_assign_pointer(rcu, ptr); \
+ __tmp; \
+})
+
#define rcu_swap_protected(rcu, ptr, c) do { \
typeof(ptr) p = rcu_dereference_protected(rcu, c); \
rcu_assign_pointer(rcu, ptr); \