forked from OP-TEE/optee_os
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In current trap handler, we always save the trapped context into struct thread_trap_regs, and copy to other structures to handle specific traps. For example, we invoke copy_trap_to_scall() to copy the context from thread_trap_regs to thread_scall_regs to handle system call, and copy back again after handling. Obviously, there are some unnecessary copies. This commit determines the specific context structure in early trap handling, by checking the value of CSR XCAUSE. For system call, we use kernel stack to save the context (see ecall_from_user). For interrupts, we use struct thread_ctx_regs to save the context (see interrupt_from_user and interrupt_from_kernel) For other exceptions and aborts, we use abort stack or tamporary stack prepared in thread_core_local structure (see abort_from_user). The unnecessary copies are removed. Signed-off-by: Alvin Chang <alvinga@andestech.com>
- Loading branch information
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.