diff options
author | Andreas Färber <afaerber@suse.de> | 2013-06-07 13:49:13 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-06-07 14:55:33 +0200 |
commit | 4a17cc4f285d7ffe41847bf728cd88c736237416 (patch) | |
tree | 8660ca33cdb5f9852502a9287587ff27b5a529bc /include | |
parent | 2ae0e48d5fd2cb7c5bc5c392edf2dc33ac2959d0 (diff) |
isa: QOM'ify ISADevice
Rename its parent field and use DEVICE() where necessary.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/hw/audio/pcspk.h | 14 | ||||
-rw-r--r-- | include/hw/i386/pc.h | 30 | ||||
-rw-r--r-- | include/hw/isa/isa.h | 5 |
3 files changed, 29 insertions, 20 deletions
diff --git a/include/hw/audio/pcspk.h b/include/hw/audio/pcspk.h index 7625137991..ef95dd1360 100644 --- a/include/hw/audio/pcspk.h +++ b/include/hw/audio/pcspk.h @@ -32,14 +32,16 @@ static inline ISADevice *pcspk_init(ISABus *bus, ISADevice *pit) { - ISADevice *dev; + DeviceState *dev; + ISADevice *isadev; - dev = isa_create(bus, TYPE_PC_SPEAKER); - qdev_prop_set_uint32(&dev->qdev, "iobase", 0x61); - qdev_prop_set_ptr(&dev->qdev, "pit", pit); - qdev_init_nofail(&dev->qdev); + isadev = isa_create(bus, TYPE_PC_SPEAKER); + dev = DEVICE(isadev); + qdev_prop_set_uint32(dev, "iobase", 0x61); + qdev_prop_set_ptr(dev, "pit", pit); + qdev_init_nofail(dev); - return dev; + return isadev; } #endif /* !HW_PCSPK_H */ diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 61540587a4..5d883eb647 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -14,15 +14,17 @@ /* parallel.c */ static inline bool parallel_init(ISABus *bus, int index, CharDriverState *chr) { - ISADevice *dev; + DeviceState *dev; + ISADevice *isadev; - dev = isa_try_create(bus, "isa-parallel"); - if (!dev) { + isadev = isa_try_create(bus, "isa-parallel"); + if (!isadev) { return false; } - qdev_prop_set_uint32(&dev->qdev, "index", index); - qdev_prop_set_chr(&dev->qdev, "chardev", chr); - if (qdev_init(&dev->qdev) < 0) { + dev = DEVICE(isadev); + qdev_prop_set_uint32(dev, "index", index); + qdev_prop_set_chr(dev, "chardev", chr); + if (qdev_init(dev) < 0) { return false; } return true; @@ -155,18 +157,20 @@ int isa_vga_mm_init(hwaddr vram_base, /* ne2000.c */ static inline bool isa_ne2000_init(ISABus *bus, int base, int irq, NICInfo *nd) { - ISADevice *dev; + DeviceState *dev; + ISADevice *isadev; qemu_check_nic_model(nd, "ne2k_isa"); - dev = isa_try_create(bus, "ne2k_isa"); - if (!dev) { + isadev = isa_try_create(bus, "ne2k_isa"); + if (!isadev) { return false; } - qdev_prop_set_uint32(&dev->qdev, "iobase", base); - qdev_prop_set_uint32(&dev->qdev, "irq", irq); - qdev_set_nic_properties(&dev->qdev, nd); - qdev_init_nofail(&dev->qdev); + dev = DEVICE(isadev); + qdev_prop_set_uint32(dev, "iobase", base); + qdev_prop_set_uint32(dev, "irq", irq); + qdev_set_nic_properties(dev, nd); + qdev_init_nofail(dev); return true; } diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index da731d7bc7..e1bf96ca69 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -34,7 +34,10 @@ struct ISABus { }; struct ISADevice { - DeviceState qdev; + /*< private >*/ + DeviceState parent_obj; + /*< public >*/ + uint32_t isairq[2]; int nirqs; int ioport_id; |