aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2010-06-23 08:20:54 +0200
committerBlue Swirl <blauwirbel@gmail.com>2010-06-27 19:08:34 +0300
commit427bd8d694c8ba4f2288fbfd5afed856e1fcfd30 (patch)
tree3e05c9097aec6110d9449947c68c113e69632bda /hw
parent052be86bc3ee867ed7345513ee947281b8f0e436 (diff)
x86: Clean up CPU reset
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/pc.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/hw/pc.c b/hw/pc.c
index e67eeb4869..25ebafac80 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -810,20 +810,12 @@ void pc_acpi_smi_interrupt(void *opaque, int irq, int level)
}
}
-static void bsp_cpu_reset(void *opaque)
+static void pc_cpu_reset(void *opaque)
{
CPUState *env = opaque;
cpu_reset(env);
- env->halted = 0;
-}
-
-static void ap_cpu_reset(void *opaque)
-{
- CPUState *env = opaque;
-
- cpu_reset(env);
- env->halted = 1;
+ env->halted = !cpu_is_bsp(env);
}
static CPUState *pc_new_cpu(const char *cpu_model)
@@ -837,16 +829,10 @@ static CPUState *pc_new_cpu(const char *cpu_model)
}
if ((env->cpuid_features & CPUID_APIC) || smp_cpus > 1) {
env->cpuid_apic_id = env->cpu_index;
- /* APIC reset callback resets cpu */
env->apic_state = apic_init(env, env->cpuid_apic_id);
}
- if (cpu_is_bsp(env)) {
- qemu_register_reset(bsp_cpu_reset, env);
- env->halted = 0;
- } else {
- qemu_register_reset(ap_cpu_reset, env);
- env->halted = 1;
- }
+ qemu_register_reset(pc_cpu_reset, env);
+ pc_cpu_reset(env);
return env;
}