svn commit: r361550 - head/sys/compat/linuxkpi/common/include/linux
Emmanuel Vadot
manu at FreeBSD.org
Wed May 27 10:01:31 UTC 2020
Author: manu
Date: Wed May 27 10:01:30 2020
New Revision: 361550
URL: https://svnweb.freebsd.org/changeset/base/361550
Log:
linuxkpi: Add rcu_swap_protected
This macros swap an rcu pointer with a normal pointer.
The condition only seems to be used for debug/warning under linux, ignore
for now.
Sponsored-by: The FreeBSD Foundation
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D24954
Modified:
head/sys/compat/linuxkpi/common/include/linux/rcupdate.h
Modified: head/sys/compat/linuxkpi/common/include/linux/rcupdate.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/rcupdate.h Wed May 27 09:31:50 2020 (r361549)
+++ head/sys/compat/linuxkpi/common/include/linux/rcupdate.h Wed May 27 10:01:30 2020 (r361550)
@@ -97,6 +97,12 @@
(uintptr_t)(v)); \
} while (0)
+#define rcu_swap_protected(rcu, ptr, c) do { \
+ typeof(ptr) p = rcu_dereference_protected(rcu, c); \
+ rcu_assign_pointer(rcu, ptr); \
+ (ptr) = p; \
+} while (0)
+
/* prototypes */
extern void linux_call_rcu(unsigned type, struct rcu_head *ptr, rcu_callback_t func);
More information about the svn-src-head
mailing list