From c2d0d01202e07f87bf17ec9a9f43232c982aa1c2 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Wed, 10 Aug 2011 15:28:11 -0700 Subject: isa: Pass i/o address space to isa_bus_new Not used yet, but at least we're provided with the correct region. Signed-off-by: Richard Henderson Signed-off-by: Avi Kivity --- hw/pc_piix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/pc_piix.c') diff --git a/hw/pc_piix.c b/hw/pc_piix.c index 0144534e82..1056cc79cc 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c @@ -156,7 +156,7 @@ static void pc_init1(MemoryRegion *system_memory, } else { pci_bus = NULL; i440fx_state = NULL; - isa_bus_new(NULL); + isa_bus_new(NULL, system_io); no_hpet = 1; } isa_bus_irqs(isa_irq); -- cgit 1.4.1 From 4bae1efe63a507b99cad4f8c8b8cf6fa8d203881 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Wed, 10 Aug 2011 15:28:13 -0700 Subject: 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 Signed-off-by: Avi Kivity --- hw/pc_piix.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'hw/pc_piix.c') diff --git a/hw/pc_piix.c b/hw/pc_piix.c index 1056cc79cc..ce1c87fba9 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c @@ -130,17 +130,7 @@ static void pc_init1(MemoryRegion *system_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->i8259 = i8259; - if (pci_enabled) { - ioapic_init(isa_irq_state); - } isa_irq = qemu_allocate_irqs(isa_irq_handler, isa_irq_state, 24); if (pci_enabled) { @@ -161,6 +151,18 @@ static void pc_init1(MemoryRegion *system_memory, } 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_vga_init(pci_enabled? pci_bus: NULL); -- cgit 1.4.1