mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
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>
This commit is contained in:
+2
-10
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user