diff --git a/arch/arm/src/armv6-m/arm_doirq.c b/arch/arm/src/armv6-m/arm_doirq.c index 93703b4512e4a..b9683a57081b2 100644 --- a/arch/arm/src/armv6-m/arm_doirq.c +++ b/arch/arm/src/armv6-m/arm_doirq.c @@ -74,8 +74,18 @@ uint32_t *arm_doirq(int irq, uint32_t *regs) } else { + /* Set current regs for crash dump */ + + up_set_current_regs(regs); + + /* Dispatch irq */ + tcb->xcp.regs = regs; irq_dispatch(irq, regs); + + /* Clear current regs */ + + up_set_current_regs(NULL); } /* If a context switch occurred while processing the interrupt then diff --git a/arch/arm/src/armv7-m/arm_doirq.c b/arch/arm/src/armv7-m/arm_doirq.c index b74414c59a3fa..2f532969a53f0 100644 --- a/arch/arm/src/armv7-m/arm_doirq.c +++ b/arch/arm/src/armv7-m/arm_doirq.c @@ -74,8 +74,18 @@ uint32_t *arm_doirq(int irq, uint32_t *regs) } else { + /* Set current regs for crash dump */ + + up_set_current_regs(regs); + + /* Dispatch irq */ + tcb->xcp.regs = regs; irq_dispatch(irq, regs); + + /* Clear current regs */ + + up_set_current_regs(NULL); } /* If a context switch occurred while processing the interrupt then diff --git a/arch/arm/src/armv8-m/arm_doirq.c b/arch/arm/src/armv8-m/arm_doirq.c index 536d7c4e757c6..d024d1ebad45f 100644 --- a/arch/arm/src/armv8-m/arm_doirq.c +++ b/arch/arm/src/armv8-m/arm_doirq.c @@ -74,8 +74,18 @@ uint32_t *arm_doirq(int irq, uint32_t *regs) } else { + /* Set current regs for crash dump */ + + up_set_current_regs(regs); + + /* Dispatch irq */ + tcb->xcp.regs = regs; irq_dispatch(irq, regs); + + /* Clear current regs */ + + up_set_current_regs(NULL); } /* If a context switch occurred while processing the interrupt then