mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
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>
This commit is contained in:
parent
e855761ca8
commit
8f04ee0882
28 changed files with 390 additions and 192 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue