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 12:29:11 -1000
committerRichard Henderson <richard.henderson@linaro.org>2025-08-28 06:39:25 +1000
commit7b9efb7aaef9b43b22fce7051861f59fe15ff51a (patch)
tree8538681c47ace08b8fd70d7f47fa1d132e2c084f /linux-user/elfload.c
parent2eaaf04ad7f9eb5bd578f3f225d118c9eb0bef1d (diff)
downloadfocaccia-qemu-7b9efb7aaef9b43b22fce7051861f59fe15ff51a.tar.gz
focaccia-qemu-7b9efb7aaef9b43b22fce7051861f59fe15ff51a.zip
linux-user/sparc: Create init_main_thread
Merge init_thread and target_cpu_copy_regs.
There's no point going through a target_pt_regs intermediate.

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.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index f93afbdcea..887a3a1cb2 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -438,16 +438,8 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs,
 # define ELF_ARCH   EM_SPARCV9
 #endif
 
-static inline void init_thread(struct target_pt_regs *regs,
-                               struct image_info *infop)
-{
-    /* Note that target_cpu_copy_regs does not read psr/tstate. */
-    regs->pc = infop->entry;
-    regs->npc = regs->pc + 4;
-    regs->y = 0;
-    regs->u_regs[14] = (infop->start_stack - 16 * sizeof(abi_ulong)
-                        - TARGET_STACK_BIAS);
-}
+#define HAVE_INIT_MAIN_THREAD
+
 #endif /* TARGET_SPARC */
 
 #ifdef TARGET_PPC