Skip to content
Unverified Commit dc58a24d authored by Jamie Iles's avatar Jamie Iles Committed by Palmer Dabbelt
Browse files

RISC-V: preserve a1 in mcount



The RISC-V ELF psABI states that both a0 and a1 are used for return
values so we should preserve them both in return_to_handler.  This is
especially important for RV32 for functions returning a 64-bit quantity
otherwise the return value can be corrupted and undefined behaviour
results.

Reviewed-by: default avatarAndrew Jones <ajones@ventanamicro.com>
Signed-off-by: default avatarJamie Iles <jamie@jamieiles.com>
Link: https://lore.kernel.org/r/20221115200832.706370-4-jamie@jamieiles.com


Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
parent 3bd7743f
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