Jan Kiszka : nucleus: Fix xnpod_schedule shadow return path for HW_UNLOCKED_SWITCH
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 40 lines · GIT version control
Module: xenomai-jki Branch: for-upstream Commit: 97de95fdb166d731081f08e157674742f24a243b URL: http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=97de95fdb166d731081f08e157674742f24a243bAuthor: Jan Kiszka <[email protected]> Date: Sat Jun 18 15:24:22 2011 +0200nucleus: Fix
xnpod_scheduleshadow return path forHW_UNLOCKED_SWITCHSince
f6af9b831c, thexnpod_scheduleof an interrupt handler may also perform a domain migration. For that case, we must disable interrupts again before returning to a migrated shadow context as the interrupt handler tail depends on that. This only affectsHW_UNLOCKED_SWITCHarchs.Signed-off-by Jan Kiszka <[email protected]>---
ksrc/nucleus/pod.c | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-)ksrc/nucleus/pod.c +1
-2@@ -1473,8 +1473,7 @@ void xnpod_suspend_thread(xnthread_t *thread, xnflags_t mask,* would enter the critical section in xnpod_schedule * while the current Adeos domain is Linux, which * would defeat the purpose of having called -* xnarch_escalate(). xnpod_schedule() is expected to -* return with interrupts on. +* xnarch_escalate(). */ if (mask &XNRELAX ) {xnlock_clear_irqon (&nklock);@@ -2345,9 +2344,12 @@ reschedule:xnshadow_exit (); }
ksrc/nucleus/pod.c reschedule: · line 2352
Quoted 10 lines
ksrc/nucleus/pod.c +6
-3-/* We are returning to xnshadow_relax via -xnpod_suspend_thread, do nothing, -xnpod_suspend_thread will re-enable interrupts. */ +#ifdef CONFIG_XENO_HW_UNLOCKED_SWITCH +/* Callers, specifically the reschedule of an IRQ handler that +hit before we called xnpod_schedule xnpod_suspend_thread, +expect us to return with interrupts disabled. */ +splmax (); +#endif
What about using splexit(s) here instead?
Signature · 1 line
Gilles.