diff --git a/arch/risc-v/src/common/fork.S b/arch/risc-v/src/common/fork.S index 37d4bc9cfe..9070e93b21 100644 --- a/arch/risc-v/src/common/fork.S +++ b/arch/risc-v/src/common/fork.S @@ -117,8 +117,8 @@ up_fork: REGSTORE s0, FORK_S0_OFFSET(sp) #endif - addi s0, sp, FORK_SIZEOF - REGSTORE s0, FORK_SP_OFFSET(sp) /* original SP */ + addi a0, sp, FORK_SIZEOF + REGSTORE a0, FORK_SP_OFFSET(sp) /* original SP */ REGSTORE x1, FORK_RA_OFFSET(sp) /* return address */ /* Floating point registers */