aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-11-25 22:35:49 +0100
committerAndreas Färber <afaerber@suse.de>2013-06-07 14:55:24 +0200
commitd1eebf4e3df8882d7be6377e1251123b6c16b9b0 (patch)
treed61181e077c67aa337e83b1be84d758a5cf5f646 /hw
parenta15d09127b104d1c35fc22bdd65263fe62462b30 (diff)
i8259: QOM'ify some more
Introduce type constant. Prepares for PIC realizefn. Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw')
-rw-r--r--hw/intc/i8259.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/hw/intc/i8259.c b/hw/intc/i8259.c
index fef00fca75..1b513ff279 100644
--- a/hw/intc/i8259.c
+++ b/hw/intc/i8259.c
@@ -41,6 +41,8 @@
//#define DEBUG_IRQ_LATENCY
//#define DEBUG_IRQ_COUNT
+#define TYPE_I8259 "isa-i8259"
+
#if defined(DEBUG_PIC) || defined(DEBUG_IRQ_COUNT)
static int irq_level[16];
#endif
@@ -448,25 +450,28 @@ void irq_info(Monitor *mon, const QDict *qdict)
qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq)
{
qemu_irq *irq_set;
- ISADevice *dev;
+ DeviceState *dev;
+ ISADevice *isadev;
int i;
irq_set = g_malloc(ISA_NUM_IRQS * sizeof(qemu_irq));
- dev = i8259_init_chip("isa-i8259", bus, true);
+ isadev = i8259_init_chip(TYPE_I8259, bus, true);
+ dev = DEVICE(isadev);
- qdev_connect_gpio_out(&dev->qdev, 0, parent_irq);
+ qdev_connect_gpio_out(dev, 0, parent_irq);
for (i = 0 ; i < 8; i++) {
- irq_set[i] = qdev_get_gpio_in(&dev->qdev, i);
+ irq_set[i] = qdev_get_gpio_in(dev, i);
}
- isa_pic = &dev->qdev;
+ isa_pic = dev;
- dev = i8259_init_chip("isa-i8259", bus, false);
+ isadev = i8259_init_chip(TYPE_I8259, bus, false);
+ dev = DEVICE(isadev);
- qdev_connect_gpio_out(&dev->qdev, 0, irq_set[2]);
+ qdev_connect_gpio_out(dev, 0, irq_set[2]);
for (i = 0 ; i < 8; i++) {
- irq_set[i + 8] = qdev_get_gpio_in(&dev->qdev, i);
+ irq_set[i + 8] = qdev_get_gpio_in(dev, i);
}
slave_pic = PIC_COMMON(dev);
@@ -484,7 +489,7 @@ static void i8259_class_init(ObjectClass *klass, void *data)
}
static const TypeInfo i8259_info = {
- .name = "isa-i8259",
+ .name = TYPE_I8259,
.instance_size = sizeof(PICCommonState),
.parent = TYPE_PIC_COMMON,
.class_init = i8259_class_init,