diff --git a/arch/risc-v/src/common/riscv_fork.h b/arch/risc-v/src/common/riscv_fork.h index 26a2ec5925d..bfb2560f1fa 100644 --- a/arch/risc-v/src/common/riscv_fork.h +++ b/arch/risc-v/src/common/riscv_fork.h @@ -119,6 +119,11 @@ struct fork_s { /* CPU registers */ +#ifdef CONFIG_RISCV_FRAMEPOINTER + uintreg_t fp; /* Frame pointer */ +#else + uintreg_t s0; /* Saved register s0 */ +#endif uintreg_t s1; /* Saved register s1 */ uintreg_t s2; /* Saved register s2 */ uintreg_t s3; /* Saved register s3 */ @@ -130,11 +135,6 @@ struct fork_s uintreg_t s9; /* Saved register s9 */ uintreg_t s10; /* Saved register s10 */ uintreg_t s11; /* Saved register s11 */ -#ifdef CONFIG_RISCV_FRAMEPOINTER - uintreg_t fp; /* Frame pointer */ -#else - uintreg_t s0; /* Saved register s0 */ -#endif uintreg_t sp; /* Stack pointer */ uintreg_t ra; /* Return address */ #ifdef RISCV_SAVE_GP