summary refs log tree commit diff stats
path: root/linux-user/elfload.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2025-07-28 13:22:48 -1000
committerRichard Henderson <richard.henderson@linaro.org>2025-08-28 06:39:25 +1000
commita2c83f5156324b88cf5c92ed777648fc1aaccf7f (patch)
tree4be62e17c2cad62e476d840a82910ad63d555476 /linux-user/elfload.c
parent88c9adef2b0fff84f0e9cbc728e860cfbad52008 (diff)
downloadfocaccia-qemu-a2c83f5156324b88cf5c92ed777648fc1aaccf7f.tar.gz
focaccia-qemu-a2c83f5156324b88cf5c92ed777648fc1aaccf7f.zip
linux-user/loongarch64: Create init_main_thread
Merge init_thread and target_cpu_copy_regs.
There's no point going through a target_pt_regs intermediate.

Note that init_thread had set crmd in target_pt_regs, but
target_cpu_copy_regs did not copy to env.  This turns out to be
ok because loongarch_cpu_reset_hold initializes CRMD properly.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'linux-user/elfload.c')
-rw-r--r--linux-user/elfload.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index a30431c7a2..0feccfbe91 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -533,14 +533,7 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUPPCState *en
 
 #define VDSO_HEADER "vdso.c.inc"
 
-static inline void init_thread(struct target_pt_regs *regs,
-                               struct image_info *infop)
-{
-    /*Set crmd PG,DA = 1,0 */
-    regs->csr.crmd = 2 << 3;
-    regs->csr.era = infop->entry;
-    regs->regs[3] = infop->start_stack;
-}
+#define HAVE_INIT_MAIN_THREAD
 
 /* See linux kernel: arch/loongarch/include/asm/elf.h */
 #define ELF_NREG 45