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
This commit is contained in:
Emmanuel Vadot 2020-05-27 10:01:30 +00:00
parent 8287045dde
commit 9b703f3082

View File

@ -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);