aboutsummaryrefslogtreecommitdiff
path: root/hw/i8254.h
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2012-02-01 20:31:40 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2012-02-17 09:58:22 -0600
commit319ba9f52737fc79de5c2c6abd059933398b72d5 (patch)
tree4a75cc9962156d27d4b17955b4cbac19bb211ab1 /hw/i8254.h
parentb1277b03d46b2aeb22f0829aaa1c0f5fe6dd38fe (diff)
i8254: Pass alternative IRQ output object on initialization
HPET legacy emulation will require control over the PIT IRQ output. To enable this, add support for an alternative IRQ output object to the PIT factory function. If the isa_irq number is < 0, this object will be used. This also removes the IRQ number property from the PIT class as we now use a generic GPIO output pin that is connected by the factory function. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/i8254.h')
-rw-r--r--hw/i8254.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/i8254.h b/hw/i8254.h
index cd3111c550..fc64a6301c 100644
--- a/hw/i8254.h
+++ b/hw/i8254.h
@@ -30,14 +30,16 @@
#define PIT_FREQ 1193182
-static inline ISADevice *pit_init(ISABus *bus, int base, int irq)
+static inline ISADevice *pit_init(ISABus *bus, int base, int isa_irq,
+ qemu_irq alt_irq)
{
ISADevice *dev;
dev = isa_create(bus, "isa-pit");
qdev_prop_set_uint32(&dev->qdev, "iobase", base);
- qdev_prop_set_uint32(&dev->qdev, "irq", irq);
qdev_init_nofail(&dev->qdev);
+ qdev_connect_gpio_out(&dev->qdev, 0,
+ isa_irq >= 0 ? isa_get_irq(dev, isa_irq) : alt_irq);
return dev;
}