Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: riscv: Improve the trap handler #6819

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on May 24, 2024

  1. 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 <alvinga@andestech.com>
    Reviewed-by: Yu Chien Peter Lin <peterlin@andestech.com>
    Tested-by: Yu Chien Peter Lin <peterlin@andestech.com>
    gagachang committed May 24, 2024
    Configuration menu
    Copy the full SHA
    ef86480 View commit details
    Browse the repository at this point in the history