From: Stacey Son <s...@freebsd.org> Function can copy cpu state to create new thread
Signed-off-by: Stacey Son <s...@freebsd.org> Signed-off-by: Ajeet Singh <itac...@freebsd.org> --- bsd-user/aarch64/target_arch_cpu.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 */ -- 2.34.1