qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 3/4] move halted state setting to inside of cpu_x86_


From: Glauber Costa
Subject: [Qemu-devel] [PATCH 3/4] move halted state setting to inside of cpu_x86_init
Date: Wed, 6 May 2009 10:49:41 -0400

cpus other than the first one starting at the halted state
is a safe assumption to anyone. Move it to where it belongs.

Signed-off-by: Glauber Costa <address@hidden>
---
 hw/pc.c              |    2 --
 target-i386/helper.c |    3 +++
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index b726c17..06d1fca 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -849,8 +849,6 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size,
             fprintf(stderr, "Unable to find x86 CPU definition\n");
             exit(1);
         }
-        if (i != 0)
-            env->halted = 1;
         if (pci_enabled) {
             apic_init(env);
         }
diff --git a/target-i386/helper.c b/target-i386/helper.c
index 2c11cd3..a0d0273 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -1694,6 +1694,9 @@ CPUX86State *cpu_x86_init(const char *cpu_model)
         cpu_x86_close(env);
         return NULL;
     }
+
+    /* cpu 0 can run, others start at halted state */
+    env->halted = !!env->cpu_index;
     cpu_reset(env);
     qemu_register_reset(main_cpu_reset, env);
 
-- 
1.5.6.6





reply via email to

[Prev in Thread] Current Thread [Next in Thread]