From: Warner Losh Date: Thu, 23 Sep 2021 14:44:05 +0000 (-0600) Subject: bsd-user/arm/target_arch_cpu.h: Implement target_cpu_clone_regs X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e17d4c9a3701ca22170cd3bbbd42c9eddad97e84;p=qemu.git bsd-user/arm/target_arch_cpu.h: Implement target_cpu_clone_regs Implement target_cpu_clone_regs to clone the resister state on a fork. Signed-off-by: Stacey Son Signed-off-by: Warner Losh Reviewed-by: Kyle Evans Reviewed-by: Richard Henderson --- diff --git a/bsd-user/arm/target_arch_cpu.h b/bsd-user/arm/target_arch_cpu.h index 66215684d6..fa45d9335d 100644 --- a/bsd-user/arm/target_arch_cpu.h +++ b/bsd-user/arm/target_arch_cpu.h @@ -36,6 +36,14 @@ static inline void target_cpu_init(CPUARMState *env, } } +static inline void target_cpu_clone_regs(CPUARMState *env, target_ulong newsp) +{ + if (newsp) { + env->regs[13] = newsp; + } + env->regs[0] = 0; +} + static inline void target_cpu_reset(CPUArchState *cpu) { }