mirror of
https://github.com/apache/nuttx.git
synced 2026-06-01 07:45:16 +08:00
arch/risc-v/src: 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.
This commit is contained in:
committed by
Brennan Ashton
parent
2adec1f366
commit
3de85be15a
@@ -159,7 +159,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
CURRENT_REGS[REG_EPC] = (uintptr_t)up_sigdeliver;
|
||||
|
||||
int_ctx = CURRENT_REGS[REG_INT_CTX];
|
||||
int_ctx &= ~MSTATUS_MIE;
|
||||
int_ctx &= ~MSTATUS_MPIE;
|
||||
#ifdef CONFIG_BUILD_PROTECTED
|
||||
int_ctx |= MSTATUS_MPPM;
|
||||
#endif
|
||||
@@ -203,7 +203,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
tcb->xcp.regs[REG_EPC] = (uintptr_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;
|
||||
|
||||
@@ -304,7 +304,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
tcb->xcp.regs[REG_EPC] = (uintptr_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;
|
||||
}
|
||||
@@ -329,7 +329,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
CURRENT_REGS[REG_EPC] = (uintptr_t)up_sigdeliver;
|
||||
|
||||
int_ctx = CURRENT_REGS[REG_INT_CTX];
|
||||
int_ctx &= ~MSTATUS_MIE;
|
||||
int_ctx &= ~MSTATUS_MPIE;
|
||||
#ifdef CONFIG_BUILD_PROTECTED
|
||||
int_ctx |= MSTATUS_MPPM;
|
||||
#endif
|
||||
@@ -400,7 +400,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
tcb->xcp.regs[REG_EPC] = (uintptr_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;
|
||||
}
|
||||
|
||||
@@ -138,7 +138,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;
|
||||
|
||||
@@ -178,7 +178,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;
|
||||
|
||||
|
||||
@@ -139,7 +139,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;
|
||||
|
||||
@@ -179,7 +179,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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user