pc: Re-order pc_init1 to initialize the ISA bus before ISA devices
In particular, the i8259 was being initialized before the ISA bus, leading to a crash. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
parent
78e2059352
commit
4bae1efe63
22
hw/pc_piix.c
22
hw/pc_piix.c
|
@ -130,17 +130,7 @@ static void pc_init1(MemoryRegion *system_memory,
|
||||||
pci_enabled ? rom_memory : system_memory, &ram_memory);
|
pci_enabled ? rom_memory : system_memory, &ram_memory);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!xen_enabled()) {
|
|
||||||
cpu_irq = pc_allocate_cpu_irq();
|
|
||||||
i8259 = i8259_init(cpu_irq[0]);
|
|
||||||
} else {
|
|
||||||
i8259 = xen_interrupt_controller_init();
|
|
||||||
}
|
|
||||||
isa_irq_state = g_malloc0(sizeof(*isa_irq_state));
|
isa_irq_state = g_malloc0(sizeof(*isa_irq_state));
|
||||||
isa_irq_state->i8259 = i8259;
|
|
||||||
if (pci_enabled) {
|
|
||||||
ioapic_init(isa_irq_state);
|
|
||||||
}
|
|
||||||
isa_irq = qemu_allocate_irqs(isa_irq_handler, isa_irq_state, 24);
|
isa_irq = qemu_allocate_irqs(isa_irq_handler, isa_irq_state, 24);
|
||||||
|
|
||||||
if (pci_enabled) {
|
if (pci_enabled) {
|
||||||
|
@ -161,6 +151,18 @@ static void pc_init1(MemoryRegion *system_memory,
|
||||||
}
|
}
|
||||||
isa_bus_irqs(isa_irq);
|
isa_bus_irqs(isa_irq);
|
||||||
|
|
||||||
|
if (!xen_enabled()) {
|
||||||
|
cpu_irq = pc_allocate_cpu_irq();
|
||||||
|
i8259 = i8259_init(cpu_irq[0]);
|
||||||
|
} else {
|
||||||
|
i8259 = xen_interrupt_controller_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
isa_irq_state->i8259 = i8259;
|
||||||
|
if (pci_enabled) {
|
||||||
|
ioapic_init(isa_irq_state);
|
||||||
|
}
|
||||||
|
|
||||||
pc_register_ferr_irq(isa_get_irq(13));
|
pc_register_ferr_irq(isa_get_irq(13));
|
||||||
|
|
||||||
pc_vga_init(pci_enabled? pci_bus: NULL);
|
pc_vga_init(pci_enabled? pci_bus: NULL);
|
||||||
|
|
Loading…
Reference in New Issue