From 2f529f9b558ca1c1bd74be7437a84e4711743404 Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Fri, 01 Nov 2024 02:11:33 +0000 Subject: [PATCH] add xenomai --- kernel/kernel/rcu/update.c | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/kernel/kernel/rcu/update.c b/kernel/kernel/rcu/update.c index 849f0aa9..8e4b48b 100644 --- a/kernel/kernel/rcu/update.c +++ b/kernel/kernel/rcu/update.c @@ -99,6 +99,11 @@ */ static bool rcu_read_lock_held_common(bool *ret) { + if (irqs_pipelined() && + (hard_irqs_disabled() || running_oob())) { + *ret = 1; + return true; + } if (!debug_lockdep_rcu_enabled()) { *ret = true; return true; @@ -209,6 +214,32 @@ #endif /* #ifndef CONFIG_TINY_RCU */ +#ifdef CONFIG_IRQ_PIPELINE + +/* + * Prepare for taking the RCU read lock when running out-of-band. Nop + * otherwise. + */ +void rcu_oob_prepare_lock(void) +{ + if (!on_pipeline_entry() && running_oob()) + rcu_nmi_enter(); +} +EXPORT_SYMBOL_GPL(rcu_oob_prepare_lock); + +/* + * Converse to rcu_oob_prepare_lock(), after dropping the RCU read + * lock. + */ +void rcu_oob_finish_lock(void) +{ + if (!on_pipeline_entry() && running_oob()) + rcu_nmi_exit(); +} +EXPORT_SYMBOL_GPL(rcu_oob_finish_lock); + +#endif /* CONFIG_IRQ_PIPELINE */ + /* * Test each non-SRCU synchronous grace-period wait API. This is * useful just after a change in mode for these primitives, and -- Gitblit v1.6.2