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) - -.if \mode == 0 /* We came from userspace. */ sd gp, (TF_GP)(sp) + +.if \mode == 0 /* We came from userspace. */ .option push .option norelax /* Load the kernel's global pointer */