mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
linux-user/aarch64: 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:
@@ -137,10 +137,10 @@ void cpu_loop(CPUARMState *env)
|
||||
}
|
||||
}
|
||||
|
||||
void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs)
|
||||
void init_main_thread(CPUState *cs, struct image_info *info)
|
||||
{
|
||||
CPUARMState *env = cpu_env(cs);
|
||||
ARMCPU *cpu = env_archcpu(env);
|
||||
int i;
|
||||
|
||||
if (!(arm_feature(env, ARM_FEATURE_AARCH64))) {
|
||||
fprintf(stderr,
|
||||
@@ -148,14 +148,12 @@ void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
for (i = 0; i < 31; i++) {
|
||||
env->xregs[i] = regs->regs[i];
|
||||
}
|
||||
env->pc = regs->pc;
|
||||
env->xregs[31] = regs->sp;
|
||||
env->pc = info->entry & ~0x3ULL;
|
||||
env->xregs[31] = info->start_stack;
|
||||
|
||||
#if TARGET_BIG_ENDIAN
|
||||
env->cp15.sctlr_el[1] |= SCTLR_E0E;
|
||||
for (i = 1; i < 4; ++i) {
|
||||
for (int i = 1; i < 4; ++i) {
|
||||
env->cp15.sctlr_el[i] |= SCTLR_EE;
|
||||
}
|
||||
arm_rebuild_hflags(env);
|
||||
|
||||
@@ -395,15 +395,7 @@ static const VdsoImageInfo *vdso_image_info(uint32_t elf_flags)
|
||||
#define ELF_ARCH EM_AARCH64
|
||||
#define ELF_CLASS ELFCLASS64
|
||||
|
||||
static inline void init_thread(struct target_pt_regs *regs,
|
||||
struct image_info *infop)
|
||||
{
|
||||
abi_long stack = infop->start_stack;
|
||||
memset(regs, 0, sizeof(*regs));
|
||||
|
||||
regs->pc = infop->entry & ~0x3ULL;
|
||||
regs->sp = stack;
|
||||
}
|
||||
#define HAVE_INIT_MAIN_THREAD
|
||||
|
||||
#define ELF_NREG 34
|
||||
typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG];
|
||||
|
||||
Reference in New Issue
Block a user