aboutsummaryrefslogtreecommitdiff
path: root/hw/pc.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-08-09 19:44:56 +0300
committerAnthony Liguori <aliguori@us.ibm.com>2009-08-24 08:01:42 -0500
commit1632dc6a8f6e8662f4a203b6fb8c0371ca216946 (patch)
tree49edaaf0dd65f87b02300f33cd0b3bb97bb774ce /hw/pc.c
parent1452411b25fb207e7f442e5a5128f34b4939d31c (diff)
Route IOAPIC interrupts via ISA bus
Instead of calling the IOAPIC from the PIC, raise IOAPIC irqs via the ISA bus. As a side effect, IOAPIC lines 16-23 are enabled. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pc.c')
-rw-r--r--hw/pc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/hw/pc.c b/hw/pc.c
index 902d0cae81..1a1f5a914b 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -61,7 +61,6 @@
static fdctrl_t *floppy_controller;
static RTCState *rtc_state;
static PITState *pit;
-static IOAPICState *ioapic;
static PCIDevice *i440fx_state;
typedef struct rom_reset_data {
@@ -90,14 +89,18 @@ static void option_rom_setup_reset(target_phys_addr_t addr, unsigned size)
typedef struct isa_irq_state {
qemu_irq *i8259;
+ qemu_irq *ioapic;
} IsaIrqState;
static void isa_irq_handler(void *opaque, int n, int level)
{
IsaIrqState *isa = (IsaIrqState *)opaque;
- qemu_set_irq(isa->i8259[n], level);
-}
+ if (n < 16) {
+ qemu_set_irq(isa->i8259[n], level);
+ }
+ qemu_set_irq(isa->ioapic[n], level);
+};
static void ioport80_write(void *opaque, uint32_t addr, uint32_t data)
{
@@ -1282,7 +1285,7 @@ static void pc_init1(ram_addr_t ram_size,
i8259 = i8259_init(cpu_irq[0]);
isa_irq_state = qemu_mallocz(sizeof(*isa_irq_state));
isa_irq_state->i8259 = i8259;
- isa_irq = qemu_allocate_irqs(isa_irq_handler, isa_irq_state, 16);
+ isa_irq = qemu_allocate_irqs(isa_irq_handler, isa_irq_state, 24);
ferr_irq = isa_irq[13];
if (pci_enabled) {
@@ -1324,16 +1327,13 @@ static void pc_init1(ram_addr_t ram_size,
register_ioport_write(0x92, 1, 1, ioport92_write, NULL);
if (pci_enabled) {
- ioapic = ioapic_init();
+ isa_irq_state->ioapic = ioapic_init();
}
pit = pit_init(0x40, isa_irq[0]);
pcspk_init(pit);
if (!no_hpet) {
hpet_init(isa_irq);
}
- if (pci_enabled) {
- pic_set_alt_irq_func(isa_pic, ioapic_set_irq, ioapic);
- }
for(i = 0; i < MAX_SERIAL_PORTS; i++) {
if (serial_hds[i]) {