From 2adec1f366c4b122b65ede10c04bfda62a7740ce Mon Sep 17 00:00:00 2001 From: Yoshinori Sugino Date: Mon, 28 Sep 2020 16:39:31 +0900 Subject: [PATCH] arch/risc-v/src/fe310: Branch to up_sigdeliver() with interrupts disabled When executing an MRET instruction, MIE is set to MPIE. In order to branch to up_sigdeliver() with interrupts disabled, we need to change MPIE, not MIE. --- arch/risc-v/src/fe310/fe310_schedulesigaction.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/risc-v/src/fe310/fe310_schedulesigaction.c b/arch/risc-v/src/fe310/fe310_schedulesigaction.c index 90338702e1..c2a6936546 100644 --- a/arch/risc-v/src/fe310/fe310_schedulesigaction.c +++ b/arch/risc-v/src/fe310/fe310_schedulesigaction.c @@ -155,7 +155,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) g_current_regs[REG_EPC] = (uint32_t)up_sigdeliver; int_ctx = g_current_regs[REG_INT_CTX]; - int_ctx &= ~MSTATUS_MIE; + int_ctx &= ~MSTATUS_MPIE; g_current_regs[REG_INT_CTX] = int_ctx; @@ -195,7 +195,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver) tcb->xcp.regs[REG_EPC] = (uint32_t)up_sigdeliver; int_ctx = tcb->xcp.regs[REG_INT_CTX]; - int_ctx &= ~MSTATUS_MIE; + int_ctx &= ~MSTATUS_MPIE; tcb->xcp.regs[REG_INT_CTX] = int_ctx;