linux-user/openrisc: 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:
parent
2ffaa3f70d
commit
83411d840c
2 changed files with 5 additions and 13 deletions
|
|
@ -673,12 +673,7 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUMBState *env
|
|||
#define ELF_CLASS ELFCLASS32
|
||||
#define ELF_DATA ELFDATA2MSB
|
||||
|
||||
static inline void init_thread(struct target_pt_regs *regs,
|
||||
struct image_info *infop)
|
||||
{
|
||||
regs->pc = infop->entry;
|
||||
regs->gpr[1] = infop->start_stack;
|
||||
}
|
||||
#define HAVE_INIT_MAIN_THREAD
|
||||
|
||||
#define USE_ELF_CORE_DUMP
|
||||
#define ELF_EXEC_PAGESIZE 8192
|
||||
|
|
|
|||
|
|
@ -83,13 +83,10 @@ void cpu_loop(CPUOpenRISCState *env)
|
|||
}
|
||||
}
|
||||
|
||||
void target_cpu_copy_regs(CPUArchState *env, target_pt_regs *regs)
|
||||
void init_main_thread(CPUState *cs, struct image_info *info)
|
||||
{
|
||||
int i;
|
||||
CPUArchState *env = cpu_env(cs);
|
||||
|
||||
for (i = 0; i < 32; i++) {
|
||||
cpu_set_gpr(env, i, regs->gpr[i]);
|
||||
}
|
||||
env->pc = regs->pc;
|
||||
cpu_set_sr(env, regs->sr);
|
||||
env->pc = info->entry;
|
||||
cpu_set_gpr(env, 1, info->start_stack);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue