diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2012-01-24 13:12:29 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-01-27 10:50:50 -0600 |
commit | 999e12bbe85c5dcf49bef13bce4f97399c7105f4 (patch) | |
tree | 73b6ed8633a73134e9f728baa1ed2b1dab58b5b0 /hw/ioapic_internal.h | |
parent | 40021f08882aaef93c66c8c740087b6d3031b63a (diff) |
sysbus: apic: ioapic: convert to QEMU Object Model
This converts three devices because apic and ioapic are subclasses of sysbus.
Converting subclasses independently of their base class is prohibitively hard.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/ioapic_internal.h')
-rw-r--r-- | hw/ioapic_internal.h | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/hw/ioapic_internal.h b/hw/ioapic_internal.h index f8d90c0fda..9dff1a72c6 100644 --- a/hw/ioapic_internal.h +++ b/hw/ioapic_internal.h @@ -73,6 +73,21 @@ typedef struct IOAPICCommonState IOAPICCommonState; +#define TYPE_IOAPIC_COMMON "ioapic-common" +#define IOAPIC_COMMON(obj) \ + OBJECT_CHECK(IOAPICCommonState, (obj), TYPE_IOAPIC_COMMON) +#define IOAPIC_COMMON_CLASS(klass) \ + OBJECT_CLASS_CHECK(IOAPICCommonClass, (klass), TYPE_IOAPIC_COMMON) +#define IOAPIC_COMMON_GET_CLASS(obj) \ + OBJECT_GET_CLASS(IOAPICCommonClass, (obj), TYPE_IOAPIC_COMMON) + +typedef struct IOAPICCommonClass { + SysBusDeviceClass parent_class; + void (*init)(IOAPICCommonState *s, int instance_no); + void (*pre_save)(IOAPICCommonState *s); + void (*post_load)(IOAPICCommonState *s); +} IOAPICCommonClass; + struct IOAPICCommonState { SysBusDevice busdev; MemoryRegion io_memory; @@ -82,16 +97,7 @@ struct IOAPICCommonState { uint64_t ioredtbl[IOAPIC_NUM_PINS]; }; -typedef struct IOAPICCommonInfo IOAPICCommonInfo; - -struct IOAPICCommonInfo { - SysBusDeviceInfo busdev; - void (*init)(IOAPICCommonState *s, int instance_no); - void (*pre_save)(IOAPICCommonState *s); - void (*post_load)(IOAPICCommonState *s); -}; - -void ioapic_qdev_register(IOAPICCommonInfo *info); +void ioapic_qdev_register(DeviceInfo *info); void ioapic_reset_common(DeviceState *dev); #endif /* !QEMU_IOAPIC_INTERNAL_H */ |