aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2025-07-28 22:03:03 -1000
committerRichard Henderson <richard.henderson@linaro.org>2025-08-28 06:39:25 +1000
commit592f36d13dd32d0a90f71266931a68f522617026 (patch)
treeb0866f55a96b433d084b2931217e5a265dbb265d
parent6b523112baac10747446af9074d1281974767004 (diff)
downloadqemu-592f36d13dd32d0a90f71266931a68f522617026.zip
qemu-592f36d13dd32d0a90f71266931a68f522617026.tar.gz
qemu-592f36d13dd32d0a90f71266931a68f522617026.tar.bz2
linux-user/s390x: 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>
-rw-r--r--linux-user/elfload.c9
-rw-r--r--linux-user/s390x/cpu_loop.c15
2 files changed, 9 insertions, 15 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index a7de852..16aa092 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -798,14 +798,7 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUM68KState *e
#define ELF_DATA ELFDATA2MSB
#define ELF_ARCH EM_S390
-static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop)
-{
- regs->psw.addr = infop->entry;
- regs->psw.mask = PSW_MASK_DAT | PSW_MASK_IO | PSW_MASK_EXT | \
- PSW_MASK_MCHECK | PSW_MASK_PSTATE | PSW_MASK_64 | \
- PSW_MASK_32;
- regs->gprs[15] = infop->start_stack;
-}
+#define HAVE_INIT_MAIN_THREAD
/* See linux kernel: arch/s390/include/uapi/asm/ptrace.h (s390_regs). */
#define ELF_NREG 27
diff --git a/linux-user/s390x/cpu_loop.c b/linux-user/s390x/cpu_loop.c
index c912444..49e4454 100644
--- a/linux-user/s390x/cpu_loop.c
+++ b/linux-user/s390x/cpu_loop.c
@@ -180,12 +180,13 @@ void cpu_loop(CPUS390XState *env)
}
}
-void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs)
+void init_main_thread(CPUState *cs, struct image_info *info)
{
- int i;
- for (i = 0; i < 16; i++) {
- env->regs[i] = regs->gprs[i];
- }
- env->psw.mask = regs->psw.mask;
- env->psw.addr = regs->psw.addr;
+ CPUArchState *env = cpu_env(cs);
+
+ env->psw.addr = info->entry;
+ env->psw.mask = PSW_MASK_DAT | PSW_MASK_IO | PSW_MASK_EXT |
+ PSW_MASK_MCHECK | PSW_MASK_PSTATE | PSW_MASK_64 |
+ PSW_MASK_32;
+ env->regs[15] = info->start_stack;
}