Skip to content

Commit

Permalink
core: riscv: Disable traps by clearing XIE CSR
Browse files Browse the repository at this point in the history
Ensure we disable traps by clearing XIE CSR instead of clearing
XSTATUS.IE which is global interrupt enable bit.

Signed-off-by: Alvin Chang <[email protected]>
Reviewed-by: Yu Chien Peter Lin <[email protected]>
  • Loading branch information
gagachang committed Oct 14, 2024
1 parent 136cc65 commit 30ce63c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/arch/riscv/kernel/thread_optee_abi_rv.S
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ FUNC thread_std_abi_entry , :
/* Save return value */
mv s0, a0

/* Disable all interrupts */
csrc CSR_XSTATUS, CSR_XSTATUS_IE
/* Mask all maskable exceptions before switching to temporary stack */
csrw CSR_XIE, x0

/* Switch to temporary stack */
jal thread_get_tmp_sp
Expand Down

0 comments on commit 30ce63c

Please sign in to comment.