diff options
| author | Richard Henderson <richard.henderson@linaro.org> | 2025-07-28 22:16:22 -1000 |
|---|---|---|
| committer | Richard Henderson <richard.henderson@linaro.org> | 2025-08-28 06:39:25 +1000 |
| commit | ceff7f9ae996ec9bb78d463f054241c338dc979c (patch) | |
| tree | 8c4dd35d4dfa470e7751d75d0d13ef4d2d0cb941 /linux-user/xtensa/cpu_loop.c | |
| parent | 1aec088719c5646b3117fd3b9c4507830f99f432 (diff) | |
| download | focaccia-qemu-ceff7f9ae996ec9bb78d463f054241c338dc979c.tar.gz focaccia-qemu-ceff7f9ae996ec9bb78d463f054241c338dc979c.zip | |
linux-user/xtensa: 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/xtensa/cpu_loop.c')
| -rw-r--r-- | linux-user/xtensa/cpu_loop.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/linux-user/xtensa/cpu_loop.c b/linux-user/xtensa/cpu_loop.c index c0fcf743e7..43a194fc4a 100644 --- a/linux-user/xtensa/cpu_loop.c +++ b/linux-user/xtensa/cpu_loop.c @@ -238,12 +238,22 @@ void cpu_loop(CPUXtensaState *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->areg[i]; + CPUArchState *env = cpu_env(cs); + + env->sregs[WINDOW_BASE] = 0; + env->sregs[WINDOW_START] = 1; + env->regs[1] = info->start_stack; + env->pc = info->entry; + + if (info_is_fdpic(info)) { + env->regs[4] = info->loadmap_addr; + env->regs[5] = info->interpreter_loadmap_addr; + if (info->interpreter_loadmap_addr) { + env->regs[6] = info->interpreter_pt_dynamic_addr; + } else { + env->regs[6] = info->pt_dynamic_addr; + } } - env->sregs[WINDOW_START] = regs->windowstart; - env->pc = regs->pc; } |