user: move CPU reset call to main.c for x86/PPC/Sparc
authorBlue Swirl <blauwirbel@gmail.com>
Sat, 7 Nov 2009 10:37:06 +0000 (10:37 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Sat, 7 Nov 2009 10:37:06 +0000 (10:37 +0000)
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
bsd-user/main.c
darwin-user/main.c
linux-user/main.c
target-i386/helper.c
target-ppc/helper.c
target-sparc/helper.c

index 19b7f3a..9f8683d 100644 (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")) {
index 9f0e014..5fd314e 100644 (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);
 
index 81a1ada..bcc36f2 100644 (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")) {
index 3fff1bb..957b3fc 100644 (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);
 
index 8d383e0..b233d4f 100644 (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);
 
index b8e7a5e..d83ba13 100644 (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;