Skip to content
Commit c48e9f31 authored by Heinrich Schuchardt's avatar Heinrich Schuchardt
Browse files

riscv: restore global data pointer in trap handler



The gp register is used to store U-Boot's global data pointer. We should
not assume that an UEFI application leaves the gp register unchanged as
the UEFI specifications does not define who is the owner of the gp and tp
registers.

So the following sequence should be followed in the trap handler:

* save the caller's gp register
* restore the global data pointer
* serve interrupts or print crash dump and reset
* restore the caller's gp register

Cc: Abner Chang <abner.chang@hpe.com>
Signed-off-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: default avatarBin Meng <bin.meng@windriver.com>
Reviewed-by: default avatarRick Chen <rick@andestech.com>
parent b59c13d4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment