From e335d44028664b4788e5898faa4367a996b1cb99 Mon Sep 17 00:00:00 2001 From: Abdelatif Guettouche Date: Fri, 21 Jan 2022 14:00:54 +0100 Subject: [PATCH] esp32c3_irq.c: Skip over ECALL instruction. Signed-off-by: Abdelatif Guettouche --- arch/risc-v/src/esp32c3/esp32c3_irq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/risc-v/src/esp32c3/esp32c3_irq.c b/arch/risc-v/src/esp32c3/esp32c3_irq.c index c90288b46e7..34df411b693 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_irq.c +++ b/arch/risc-v/src/esp32c3/esp32c3_irq.c @@ -376,6 +376,7 @@ void esp32c3_free_cpuint(uint8_t periphid) IRAM_ATTR uintptr_t *esp32c3_dispatch_irq(uintptr_t mcause, uintptr_t *regs) { int irq; + uintptr_t *mepc = regs; if (((MCAUSE_INTERRUPT & mcause) == 0) && (mcause != MCAUSE_ECALL_M)) @@ -428,6 +429,7 @@ IRAM_ATTR uintptr_t *esp32c3_dispatch_irq(uintptr_t mcause, uintptr_t *regs) { if (mcause == MCAUSE_ECALL_M) { + *mepc += 4; irq_dispatch(ESP32C3_IRQ_ECALL_M, regs); } else