aboutsummaryrefslogtreecommitdiff
path: root/linux-user/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux-user/main.c')
-rw-r--r--linux-user/main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/linux-user/main.c b/linux-user/main.c
index d92702a734..6bd23af2ba 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -3452,8 +3452,8 @@ void init_task_state(TaskState *ts)
CPUArchState *cpu_copy(CPUArchState *env)
{
CPUState *cpu = ENV_GET_CPU(env);
- CPUArchState *new_env = cpu_init(cpu_model);
- CPUState *new_cpu = ENV_GET_CPU(new_env);
+ CPUState *new_cpu = cpu_init(cpu_model);
+ CPUArchState *new_env = cpu->env_ptr;
CPUBreakpoint *bp;
CPUWatchpoint *wp;
@@ -3939,12 +3939,12 @@ int main(int argc, char **argv, char **envp)
cpu_exec_init_all();
/* NOTE: we need to init the CPU at this stage to get
qemu_host_page_size */
- env = cpu_init(cpu_model);
- if (!env) {
+ cpu = cpu_init(cpu_model);
+ if (!cpu) {
fprintf(stderr, "Unable to find CPU definition\n");
exit(1);
}
- cpu = ENV_GET_CPU(env);
+ env = cpu->env_ptr;
cpu_reset(cpu);
thread_cpu = cpu;