diff --git a/sys/riscv/riscv/exception.S b/sys/riscv/riscv/exception.S --- a/sys/riscv/riscv/exception.S +++ b/sys/riscv/riscv/exception.S @@ -43,9 +43,9 @@ sd ra, (TF_RA)(sp) sd tp, (TF_TP)(sp) + sd gp, (TF_GP)(sp) .if \mode == 0 /* We came from userspace. */ - sd gp, (TF_GP)(sp) .option push .option norelax /* Load the kernel's global pointer */