tmedicci commented on code in PR #15815: URL: https://github.com/apache/nuttx/pull/15815#discussion_r1954425944
########## arch/risc-v/src/common/riscv_doirq.c: ########## @@ -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()) || Review Comment: How could the backtrace dump work successfully (if `CONFIG_DEBUG_ASSERTIONS=y`) without it? It would assert there (instead of on the right place, which `riscv_exception`). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org