diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2011-10-07 09:19:35 +0200 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2011-10-16 11:10:48 +0000 |
commit | b881fbe9f7a60ceaef20b7a234c49473d009bf4d (patch) | |
tree | aaa660e442e54b245389a8237e10bfe3aa7a216b /hw/pc.c | |
parent | 2e9947d2eaf1e9cbeb22ff15064bc70e7c9afe1e (diff) | |
download | qemu-b881fbe9f7a60ceaef20b7a234c49473d009bf4d.zip qemu-b881fbe9f7a60ceaef20b7a234c49473d009bf4d.tar.gz qemu-b881fbe9f7a60ceaef20b7a234c49473d009bf4d.tar.bz2 |
pc: Generalize ISA IRQs to GSIs
The ISA bus IRQ range is 0..15. What isa_irq_handler and IsaIrqState are
actually dealing with are the Global System Interrupts. Refactor the
code to clarify this.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/pc.c')
-rw-r--r-- | hw/pc.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -88,15 +88,15 @@ struct e820_table { static struct e820_table e820_table; struct hpet_fw_config hpet_cfg = {.count = UINT8_MAX}; -void isa_irq_handler(void *opaque, int n, int level) +void gsi_handler(void *opaque, int n, int level) { - IsaIrqState *isa = (IsaIrqState *)opaque; + GSIState *s = opaque; - DPRINTF("isa_irqs: %s irq %d\n", level? "raise" : "lower", n); - if (n < 16) { - qemu_set_irq(isa->i8259[n], level); + DPRINTF("pc: %s GSI %d\n", level ? "raising" : "lowering", n); + if (n < ISA_NUM_IRQS) { + qemu_set_irq(s->i8259_irq[n], level); } - qemu_set_irq(isa->ioapic[n], level); + qemu_set_irq(s->ioapic_irq[n], level); } static void ioport80_write(void *opaque, uint32_t addr, uint32_t data) @@ -1125,7 +1125,7 @@ static void cpu_request_exit(void *opaque, int irq, int level) } } -void pc_basic_device_init(qemu_irq *isa_irq, +void pc_basic_device_init(qemu_irq *gsi, ISADevice **rtc_state, bool no_vmport) { @@ -1144,8 +1144,8 @@ void pc_basic_device_init(qemu_irq *isa_irq, DeviceState *hpet = sysbus_try_create_simple("hpet", HPET_BASE, NULL); if (hpet) { - for (i = 0; i < 24; i++) { - sysbus_connect_irq(sysbus_from_qdev(hpet), i, isa_irq[i]); + for (i = 0; i < GSI_NUM_PINS; i++) { + sysbus_connect_irq(sysbus_from_qdev(hpet), i, gsi[i]); } rtc_irq = qdev_get_gpio_in(hpet, 0); } |