diff options
| author | Richard Henderson <richard.henderson@linaro.org> | 2025-07-28 12:29:11 -1000 |
|---|---|---|
| committer | Richard Henderson <richard.henderson@linaro.org> | 2025-08-28 06:39:25 +1000 |
| commit | 7b9efb7aaef9b43b22fce7051861f59fe15ff51a (patch) | |
| tree | 8538681c47ace08b8fd70d7f47fa1d132e2c084f /linux-user/sparc | |
| parent | 2eaaf04ad7f9eb5bd578f3f225d118c9eb0bef1d (diff) | |
| download | focaccia-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/sparc')
| -rw-r--r-- | linux-user/sparc/cpu_loop.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index 68f1e8ecd4..7d30cd1ff2 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -357,14 +357,12 @@ void cpu_loop (CPUSPARCState *env) } } -void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs) +void init_main_thread(CPUState *cs, struct image_info *info) { - int i; - env->pc = regs->pc; - env->npc = regs->npc; - env->y = regs->y; - for(i = 0; i < 8; i++) - env->gregs[i] = regs->u_regs[i]; - for(i = 0; i < 8; i++) - env->regwptr[i] = regs->u_regs[i + 8]; + CPUArchState *env = cpu_env(cs); + + env->pc = info->entry; + env->npc = env->pc + 4; + env->regwptr[WREG_SP] = (info->start_stack - 16 * sizeof(abi_ulong) + - TARGET_STACK_BIAS); } |