Message ID | 20240617185804.25075-4-itachis@FreeBSD.org |
---|---|
State | New |
Headers | show |
Series | ARM AArch64 Support for BSD | expand |
On 6/17/24 11:57, Ajeet Singh wrote: > From: Stacey Son<sson@FreeBSD.org> > > Function can copy cpu state to create new thread > > Signed-off-by: Stacey Son<sson@FreeBSD.org> > Signed-off-by: Ajeet Singh<itachis@FreeBSD.org> > --- > bsd-user/aarch64/target_arch_cpu.h | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) Reviewed-by: Richard Henderson <richard.henderson@linaro.org> r~
diff --git a/bsd-user/aarch64/target_arch_cpu.h b/bsd-user/aarch64/target_arch_cpu.h index 1962d2c99b..4e950305d3 100644 --- a/bsd-user/aarch64/target_arch_cpu.h +++ b/bsd-user/aarch64/target_arch_cpu.h @@ -171,4 +171,21 @@ static inline void target_cpu_loop(CPUARMState *env) } /* for (;;) */ } + +/* See arm64/arm64/vm_machdep.c cpu_fork() */ +static inline void target_cpu_clone_regs(CPUARMState *env, target_ulong newsp) +{ + if (newsp) { + env->xregs[31] = newsp; + } + env->regs[0] = 0; + env->regs[1] = 0; + pstate_write(env, 0); +} + +static inline void target_cpu_reset(CPUArchState *env) +{ +} + + #endif /* TARGET_ARCH_CPU_H */