forked from chipsalliance/riscv-dv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Store user-stack-pointer on kernel stack when pushing/popping GPRs
The current implementation for pushing/popping GPRs stores the USP in xSCRATCH, however this CSR is also used for a counter value by the code section inserted by (cfg.enable_nested_interrupt) within riscv_asm_program_gen::gen_interrupt_handler_section(). This corrupts the program state because the user-program GPRs can no longer be restored. Instead, push the USP onto the kernel stack before pushing the GPRs. Pop it off again after popping the GPRs themselves.
- Loading branch information
1 parent
ada58fc
commit aee6c4d
Showing
1 changed file
with
20 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters