From cb1cc66d811dd558126bf98d1c05673cfc9745fa Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 23 Dec 2016 11:39:44 -0600 Subject: [PATCH] Implement deferred IRQ locking. Adds partial support for Xtensa. More is needed. --- arch/xtensa/src/common/xtensa_irqdispatch.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/xtensa/src/common/xtensa_irqdispatch.c b/arch/xtensa/src/common/xtensa_irqdispatch.c index 813846e76e..be494df6e2 100644 --- a/arch/xtensa/src/common/xtensa_irqdispatch.c +++ b/arch/xtensa/src/common/xtensa_irqdispatch.c @@ -52,6 +52,7 @@ #include "group/group.h" #include "sched/sched.h" +#include "irq/irq.h" /**************************************************************************** * Public Functions @@ -129,6 +130,17 @@ uint32_t *xtensa_irq_dispatch(int irq, uint32_t *regs) (void)group_addrenv(NULL); #endif + +#ifdef CONFIG_SMP + /* In the SMP configuration, critical section management uses a + * "voting" algorithm with current task on each CPU casting its + * "vote" by the state of the TCB irqcount flag. That irqcount + * for the current task on this CPU will be different is a + * context switch occurrred. + */ + + irq_restore_lock(); +#endif } #endif