mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
linux-user/riscv: 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:
@@ -849,12 +849,7 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs,
|
||||
#define VDSO_HEADER "vdso-64.c.inc"
|
||||
#endif
|
||||
|
||||
static inline void init_thread(struct target_pt_regs *regs,
|
||||
struct image_info *infop)
|
||||
{
|
||||
regs->sepc = infop->entry;
|
||||
regs->sp = infop->start_stack;
|
||||
}
|
||||
#define HAVE_INIT_MAIN_THREAD
|
||||
|
||||
#define ELF_EXEC_PAGESIZE 4096
|
||||
|
||||
|
||||
@@ -94,14 +94,12 @@ void cpu_loop(CPURISCVState *env)
|
||||
}
|
||||
}
|
||||
|
||||
void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs)
|
||||
void init_main_thread(CPUState *cs, struct image_info *info)
|
||||
{
|
||||
CPUState *cpu = env_cpu(env);
|
||||
TaskState *ts = get_task_state(cpu);
|
||||
struct image_info *info = ts->info;
|
||||
CPUArchState *env = cpu_env(cs);
|
||||
|
||||
env->pc = regs->sepc;
|
||||
env->gpr[xSP] = regs->sp;
|
||||
env->pc = info->entry;
|
||||
env->gpr[xSP] = info->start_stack;
|
||||
env->elf_flags = info->elf_flags;
|
||||
|
||||
if ((env->misa_ext & RVE) && !(env->elf_flags & EF_RISCV_RVE)) {
|
||||
|
||||
Reference in New Issue
Block a user