summaryrefslogtreecommitdiffstats
path: root/hw/isa.h
diff options
context:
space:
mode:
authorAnthony Liguori2011-12-04 18:52:49 +0100
committerAnthony Liguori2012-01-27 17:50:47 +0100
commit8f04ee0882aec9fe91fb70f767edf5dacff59835 (patch)
tree01ebc9678569233858c2343c9cb04e62c2df55ad /hw/isa.h
parentqdev: prepare source tree for code conversion (diff)
downloadqemu-8f04ee0882aec9fe91fb70f767edf5dacff59835.tar.gz
qemu-8f04ee0882aec9fe91fb70f767edf5dacff59835.tar.xz
qemu-8f04ee0882aec9fe91fb70f767edf5dacff59835.zip
isa: pic: convert to QEMU Object Model
This converts two devices at once because PIC subclasses ISA and converting subclasses independently is extremely hard. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/isa.h')
-rw-r--r--hw/isa.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/hw/isa.h b/hw/isa.h
index b11a0be27f..9f5d1588b5 100644
--- a/hw/isa.h
+++ b/hw/isa.h
@@ -10,7 +10,19 @@
#define ISA_NUM_IRQS 16
typedef struct ISADevice ISADevice;
-typedef struct ISADeviceInfo ISADeviceInfo;
+
+#define TYPE_ISA_DEVICE "isa-device"
+#define ISA_DEVICE(obj) \
+ OBJECT_CHECK(ISADevice, (obj), TYPE_ISA_DEVICE)
+#define ISA_DEVICE_CLASS(klass) \
+ OBJECT_CLASS_CHECK(ISADeviceClass, (klass), TYPE_ISA_DEVICE)
+#define ISA_DEVICE_GET_CLASS(obj) \
+ OBJECT_GET_CLASS(ISADeviceClass, (obj), TYPE_ISA_DEVICE)
+
+typedef struct ISADeviceClass {
+ DeviceClass parent_class;
+ int (*init)(ISADevice *dev);
+} ISADeviceClass;
struct ISABus {
BusState qbus;
@@ -25,17 +37,12 @@ struct ISADevice {
int ioport_id;
};
-typedef int (*isa_qdev_initfn)(ISADevice *dev);
-struct ISADeviceInfo {
- DeviceInfo qdev;
- isa_qdev_initfn init;
-};
-
ISABus *isa_bus_new(DeviceState *dev, MemoryRegion *address_space_io);
void isa_bus_irqs(ISABus *bus, qemu_irq *irqs);
qemu_irq isa_get_irq(ISADevice *dev, int isairq);
void isa_init_irq(ISADevice *dev, qemu_irq *p, int isairq);
-void isa_qdev_register(ISADeviceInfo *info);
+void isa_qdev_register(DeviceInfo *info);
+void isa_qdev_register_subclass(DeviceInfo *info, const char *parent);
MemoryRegion *isa_address_space(ISADevice *dev);
ISADevice *isa_create(ISABus *bus, const char *name);
ISADevice *isa_try_create(ISABus *bus, const char *name);