diff options
author | Gleb Natapov <gleb@redhat.com> | 2009-06-18 16:29:18 +0300 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-06-22 10:15:29 -0500 |
commit | cd57c0f317c75cad3f553c76dbf59f261b69e33b (patch) | |
tree | ca36f5dfb291233b3a3b52e87d627b0d67d46123 | |
parent | c2cc47a449c3e16f7dd4d19a536c649ec56a9ac9 (diff) | |
download | qemu-cd57c0f317c75cad3f553c76dbf59f261b69e33b.zip qemu-cd57c0f317c75cad3f553c76dbf59f261b69e33b.tar.gz qemu-cd57c0f317c75cad3f553c76dbf59f261b69e33b.tar.bz2 |
Don't register cpu reset handler for cpu with APIC.
APIC reset handler already resets cpu, no need to reset it twice.
Also register cpu_reset handler directly to make it impossible to
add additional code to main_cpu_reset() by mistake.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r-- | hw/pc.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -751,12 +751,6 @@ static void load_linux(target_phys_addr_t option_rom, generate_bootsect(option_rom, gpr, seg, 0); } -static void main_cpu_reset(void *opaque) -{ - CPUState *env = opaque; - cpu_reset(env); -} - static const int ide_iobase[2] = { 0x1f0, 0x170 }; static const int ide_iobase2[2] = { 0x3f6, 0x376 }; static const int ide_irq[2] = { 14, 15 }; @@ -884,9 +878,11 @@ static void pc_init1(ram_addr_t ram_size, } if ((env->cpuid_features & CPUID_APIC) || smp_cpus > 1) { env->cpuid_apic_id = env->cpu_index; + /* APIC reset callback resets cpu */ apic_init(env); + } else { + qemu_register_reset((QEMUResetHandler*)cpu_reset, 0, env); } - qemu_register_reset(main_cpu_reset, 0, env); } vmport_init(); |