Skip to content

Commit

Permalink
123
Browse files Browse the repository at this point in the history
  • Loading branch information
gagachang committed Sep 13, 2024
1 parent d360ab4 commit 706191e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/arch/riscv/kernel/thread_rv.S
Original file line number Diff line number Diff line change
Expand Up @@ -708,15 +708,15 @@ FUNC __thread_enter_user_mode , :
/* Move struct thread_ctx_regs *regs to sp to reduce code size */
mv sp, a0

/* Set exception return PC */
load_xregs sp, THREAD_CTX_REG_EPC, REG_S0
csrw CSR_XEPC, s0
/* Set user ie */
load_xregs sp, THREAD_CTX_REG_IE, REG_S0
csrw CSR_XIE, s0
/* Set user status */
load_xregs sp, THREAD_CTX_REG_STATUS, REG_S0
csrw CSR_XSTATUS, s0
/* Set exception program counter */
load_xregs sp, THREAD_CTX_REG_EPC, REG_S0
csrw CSR_XEPC, s0
/* Load the rest of the general purpose registers */
load_xregs sp, THREAD_CTX_REG_RA, REG_RA
load_xregs sp, THREAD_CTX_REG_GP, REG_GP
Expand Down

0 comments on commit 706191e

Please sign in to comment.