diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-04 11:52:49 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-01-27 10:50:47 -0600 |
commit | 8f04ee0882aec9fe91fb70f767edf5dacff59835 (patch) | |
tree | 01ebc9678569233858c2343c9cb04e62c2df55ad /hw/i8259_internal.h | |
parent | e855761ca8fa08ebe29c1e69abc6f0863a453f92 (diff) |
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/i8259_internal.h')
-rw-r--r-- | hw/i8259_internal.h | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/hw/i8259_internal.h b/hw/i8259_internal.h index 13deb14b63..e9d1732759 100644 --- a/hw/i8259_internal.h +++ b/hw/i8259_internal.h @@ -31,6 +31,22 @@ typedef struct PICCommonState PICCommonState; +#define TYPE_PIC_COMMON "pic-common" +#define PIC_COMMON(obj) \ + OBJECT_CHECK(PICCommon, (obj), TYPE_PIC_COMMON) +#define PIC_COMMON_CLASS(klass) \ + OBJECT_CLASS_CHECK(PICCommonClass, (klass), TYPE_PIC_COMMON) +#define PIC_COMMON_GET_CLASS(obj) \ + OBJECT_GET_CLASS(PICCommonClass, (obj), TYPE_PIC_COMMON) + +typedef struct PICCommonClass +{ + ISADeviceClass parent_class; + void (*init)(PICCommonState *s); + void (*pre_save)(PICCommonState *s); + void (*post_load)(PICCommonState *s); +} PICCommonClass; + struct PICCommonState { ISADevice dev; uint8_t last_irr; /* edge detection */ @@ -58,19 +74,10 @@ struct PICCommonState { MemoryRegion elcr_io; }; -typedef struct PICCommonInfo PICCommonInfo; - -struct PICCommonInfo { - ISADeviceInfo isadev; - void (*init)(PICCommonState *s); - void (*pre_save)(PICCommonState *s); - void (*post_load)(PICCommonState *s); -}; - void pic_reset_common(PICCommonState *s); ISADevice *i8259_init_chip(const char *name, ISABus *bus, bool master); -void pic_qdev_register(PICCommonInfo *info); +void pic_qdev_register(DeviceInfo *info); #endif /* !QEMU_I8259_INTERNAL_H */ |