提交 b55a37c9 编写于 作者: B Blue Swirl

user: move CPU reset call to main.c for x86/PPC/Sparc

Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
上级 d84bda46
......@@ -891,6 +891,9 @@ int main(int argc, char **argv)
fprintf(stderr, "Unable to find CPU definition\n");
exit(1);
}
#if defined(TARGET_I386) || defined(TARGET_SPARC) || defined(TARGET_PPC)
cpu_reset(env);
#endif
thread_env = env;
if (getenv("QEMU_STRACE")) {
......
......@@ -846,6 +846,7 @@ int main(int argc, char **argv)
/* NOTE: we need to init the CPU at this stage to get
qemu_host_page_size */
env = cpu_init(cpu_model);
cpu_reset(env);
printf("Starting %s with qemu\n----------------\n", filename);
......
......@@ -2618,6 +2618,10 @@ int main(int argc, char **argv, char **envp)
fprintf(stderr, "Unable to find CPU definition\n");
exit(1);
}
#if defined(TARGET_I386) || defined(TARGET_SPARC) || defined(TARGET_PPC)
cpu_reset(env);
#endif
thread_env = env;
if (getenv("QEMU_STRACE")) {
......
......@@ -1885,9 +1885,6 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
return NULL;
}
mce_init(env);
#ifdef CONFIG_USER_ONLY
cpu_reset(env);
#endif
qemu_init_vcpu(env);
......
......@@ -2810,9 +2810,6 @@ CPUPPCState *cpu_ppc_init (const char *cpu_model)
ppc_translate_init();
env->cpu_model_str = cpu_model;
cpu_ppc_register_internal(env, def);
#if defined(CONFIG_USER_ONLY)
cpu_reset(env);
#endif
qemu_init_vcpu(env);
......
......@@ -762,9 +762,6 @@ CPUSPARCState *cpu_sparc_init(const char *cpu_model)
cpu_sparc_close(env);
return NULL;
}
#if defined(CONFIG_USER_ONLY)
cpu_reset(env);
#endif
qemu_init_vcpu(env);
return env;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册