linux-user: Create do_init_main_thread

Provide a unified function to initialize the main thread.
Keep target_pt_regs isolated to this function.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2025-07-28 10:00:36 -10:00
parent d8329660b2
commit 1f2f4c0fbc
4 changed files with 12 additions and 16 deletions

View file

@ -139,8 +139,7 @@ abi_ulong loader_build_argptr(int envc, int argc, abi_ulong sp,
}
int loader_exec(int fdexec, const char *filename, char **argv, char **envp,
struct target_pt_regs *regs, struct image_info *infop,
struct linux_binprm *bprm)
struct image_info *infop, struct linux_binprm *bprm)
{
int retval;
@ -175,8 +174,7 @@ int loader_exec(int fdexec, const char *filename, char **argv, char **envp,
return retval;
}
/* Success. Initialize important registers. */
do_init_thread(regs, infop);
/* Success. */
return 0;
}