-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core: riscv: Improve the trap handler
In current RISC-V trap handler, we always save the context into struct thread_trap_regs first, and copy the saved context into another specific structure to handle that trap. For example, thread_user_ecall_handler() copies the struct thread_trap_regs to be struct thread_scall_regs before handling this system call. In fact, such copies may drop the performance and they should be eliminated. In this commit, the specific data structure used to save the context is determined early in the trap handler by checking the type of the trap from CSR XCAUSE. Thus, the copies between context structures are eliminated. Signed-off-by: Alvin Chang <[email protected]> Reviewed-by: Yu Chien Peter Lin <[email protected]> Reviewed-by: Marouene Boubakri <[email protected]> Tested-by: Yu Chien Peter Lin <[email protected]> Tested-by: Marouene Boubakri <[email protected]>
- Loading branch information
1 parent
bf87039
commit 5e26ef8
Showing
5 changed files
with
483 additions
and
292 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
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
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
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
Oops, something went wrong.