diff --git a/arch/arm/src/armv6-m/arm_doirq.c b/arch/arm/src/armv6-m/arm_doirq.c index 93703b4512..b9683a5708 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 b74414c59a..2f532969a5 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 536d7c4e75..d024d1ebad 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