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

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Blue Swirl 2009-11-07 10:37:06 +00:00
parent d84bda46de
commit b55a37c981
6 changed files with 8 additions and 9 deletions

View File

@ -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")) {

View File

@ -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);

View File

@ -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")) {

View File

@ -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);

View File

@ -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);

View File

@ -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;