risc-v/vfork: Save FPU registers

Save the callee saved FPU registers
This commit is contained in:
Ville Juven 2022-05-19 12:21:18 +03:00 committed by Alan Carvalho de Assis
parent ef42b7c31e
commit 1ec70bc704
2 changed files with 45 additions and 16 deletions

View File

@ -226,6 +226,20 @@ pid_t up_vfork(const struct vfork_s *context)
#ifdef RISCV_SAVE_GP
child->cmn.xcp.regs[REG_GP] = newsp; /* Global pointer */
#endif
#ifdef CONFIG_ARCH_FPU
child->cmn.xcp.regs[REG_FS0] = context->fs0; /* Saved register fs1 */
child->cmn.xcp.regs[REG_FS1] = context->fs1; /* Saved register fs1 */
child->cmn.xcp.regs[REG_FS2] = context->fs2; /* Saved register fs2 */
child->cmn.xcp.regs[REG_FS3] = context->fs3; /* Saved register fs3 */
child->cmn.xcp.regs[REG_FS4] = context->fs4; /* Saved register fs4 */
child->cmn.xcp.regs[REG_FS5] = context->fs5; /* Saved register fs5 */
child->cmn.xcp.regs[REG_FS6] = context->fs6; /* Saved register fs6 */
child->cmn.xcp.regs[REG_FS7] = context->fs7; /* Saved register fs7 */
child->cmn.xcp.regs[REG_FS8] = context->fs8; /* Saved register fs8 */
child->cmn.xcp.regs[REG_FS9] = context->fs9; /* Saved register fs9 */
child->cmn.xcp.regs[REG_FS10] = context->fs10; /* Saved register fs10 */
child->cmn.xcp.regs[REG_FS11] = context->fs11; /* Saved register fs11 */
#endif
#ifdef CONFIG_LIB_SYSCALL
/* If we got here via a syscall, then we are going to have to setup some

View File

@ -118,7 +118,22 @@ struct vfork_s
uintptr_t gp; /* Global pointer */
#endif
/* Floating point registers (not yet) */
/* Floating point registers */
#ifdef CONFIG_ARCH_FPU
uintptr_t fs0; /* Saved register fs0 */
uintptr_t fs1; /* Saved register fs1 */
uintptr_t fs2; /* Saved register fs2 */
uintptr_t fs3; /* Saved register fs3 */
uintptr_t fs4; /* Saved register fs4 */
uintptr_t fs5; /* Saved register fs5 */
uintptr_t fs6; /* Saved register fs6 */
uintptr_t fs7; /* Saved register fs7 */
uintptr_t fs8; /* Saved register fs8 */
uintptr_t fs9; /* Saved register fs9 */
uintptr_t fs10; /* Saved register fs10 */
uintptr_t fs11; /* Saved register fs11 */
#endif
};
#endif