diff options
Diffstat (limited to 'src/arch/riscv/trap_util.S')
-rw-r--r-- | src/arch/riscv/trap_util.S | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/arch/riscv/trap_util.S b/src/arch/riscv/trap_util.S index c5691c595f..d7b1250b7a 100644 --- a/src/arch/riscv/trap_util.S +++ b/src/arch/riscv/trap_util.S @@ -121,7 +121,12 @@ trap_entry: save_tf move a0,sp - jal trap_handler + + # store pointer to stack frame (moved out from trap_handler) + csrw mscratch, sp + + LOAD t0, trap_handler + jalr t0 trap_return: csrr a0, mscratch |