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:
parent
8287045dde
commit
9b703f3082
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user