mirror of
https://github.com/apache/nuttx.git
synced 2026-08-04 22:00:21 +00:00
arch/risc-v: improve nested interrupt assertion on riscv_doirq
This commit is contained in:
parent
b417495284
commit
becba7153f
1 changed files with 15 additions and 4 deletions
|
|
@ -88,13 +88,24 @@ uintreg_t *riscv_doirq(int irq, uintreg_t *regs)
|
|||
(*running_task)->xcp.regs = regs;
|
||||
}
|
||||
|
||||
/* Nested interrupts are not supported */
|
||||
/* Current regs non-zero indicates that we are processing an interrupt;
|
||||
* current_regs is also used to manage interrupt level context switches.
|
||||
*
|
||||
* Nested interrupts are not supported. But an exception may occur while
|
||||
* processing an interrupt. In this case, current_regs will be non-NULL.
|
||||
*/
|
||||
|
||||
DEBUGASSERT(!up_interrupt_context());
|
||||
DEBUGASSERT(((irq > RISCV_MAX_EXCEPTION) && !up_interrupt_context()) ||
|
||||
(irq <= RISCV_MAX_EXCEPTION));
|
||||
|
||||
/* Set irq flag */
|
||||
/* Don't override current regs if it is already set (which is true if
|
||||
* we were in a interrupt handler).
|
||||
*/
|
||||
|
||||
up_set_interrupt_context(true);
|
||||
if (!up_interrupt_context())
|
||||
{
|
||||
up_set_interrupt_context(true);
|
||||
}
|
||||
|
||||
/* Deliver the IRQ */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue