Skip to content

Commit 4bbc2a7

Browse files
ycsinaescolar
authored andcommitted
arch: riscv: isr.S: restore s0 before jumping to z_riscv_fatal_error_csf
Restore the s0 we saved early in ISR entry so it shows up properly in the CSF. Signed-off-by: David Reiss <[email protected]> Signed-off-by: Yong Cong Sin <[email protected]>
1 parent fe5bfc9 commit 4bbc2a7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/riscv/core/isr.S

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,12 @@ do_fault:
443443
1: mv a1, sp
444444

445445
#ifdef CONFIG_EXCEPTION_DEBUG
446+
/*
447+
* Restore the s0 we saved early in ISR entry
448+
* so it shows up properly in the CSF.
449+
*/
450+
lr s0, __struct_arch_esf_s0_OFFSET(sp)
451+
446452
/* Allocate space for caller-saved registers on current thread stack */
447453
addi sp, sp, -__callee_saved_t_SIZEOF
448454

0 commit comments

Comments
 (0)