[PATCH] testdev: adjust for ISA irq changes

Avi Kivity
2011-05-29T12:57:37Z

Recent changes killed the ioapic_irq_hack hack, use the isa_get_irq() API
instead.

Signed-off-by: Avi Kivity <avi@redhat.com>
---
hw/isa-bus.c | 2 +-
hw/testdev.c | 4 +---
2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/isa-bus.c b/hw/isa-bus.c
index 2765543..7e06efc 100644
--- a/hw/isa-bus.c
+++ b/hw/isa-bus.c
@@ -66,7 +66,7 @@ void isa_bus_irqs(qemu_irq *irqs)
*/
qemu_irq isa_get_irq(int isairq)
{
- if (isairq < 0 || isairq > 15) {
+ if (isairq < 0 || isairq > 23) {
hw_error("isa irq %d invalid", isairq);
}
return isabus->irqs[isairq];
diff --git a/hw/testdev.c b/hw/testdev.c
index f0355c8..bf1611c 100644
--- a/hw/testdev.c
+++ b/hw/testdev.c
@@ -28,11 +28,9 @@ static uint32_t test_device_memsize_read(void *opaque, uint32_t addr)
return ram_size;
}

-extern qemu_irq *ioapic_irq_hack;
-
static void test_device_irq_line(void *opaque, uint32_t addr, uint32_t data)
{
- qemu_set_irq(ioapic_irq_hack[addr - 0x2000], !!data);
+ qemu_set_irq(isa_get_irq(addr - 0x2000), !!data);
}

static uint32 test_device_ioport_data;
--
1.7.5.2