mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
hw/intc/loongarch_extioi: Inherit from loongarch_extioi_common
Set TYPE_LOONGARCH_EXTIOI inherit from TYPE_LOONGARCH_EXTIOI_COMMON object, it shares vmsate and property of TYPE_LOONGARCH_EXTIOI_COMMON, and has its own realize() function. Signed-off-by: Bibo Mao <maobibo@loongson.cn> Reviewed-by: Song Gao <gaosong@loongson.cn>
This commit is contained in:
parent
6b69f77817
commit
272c467a48
5 changed files with 85 additions and 24 deletions
|
@ -10,7 +10,20 @@
|
|||
|
||||
#include "hw/intc/loongarch_extioi_common.h"
|
||||
|
||||
#define LoongArchExtIOI LoongArchExtIOICommonState
|
||||
#define TYPE_LOONGARCH_EXTIOI "loongarch.extioi"
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(LoongArchExtIOI, LOONGARCH_EXTIOI)
|
||||
OBJECT_DECLARE_TYPE(LoongArchExtIOIState, LoongArchExtIOIClass, LOONGARCH_EXTIOI)
|
||||
|
||||
struct LoongArchExtIOIState {
|
||||
LoongArchExtIOICommonState parent_obj;
|
||||
};
|
||||
|
||||
struct LoongArchExtIOIClass {
|
||||
LoongArchExtIOICommonClass parent_class;
|
||||
|
||||
DeviceRealize parent_realize;
|
||||
DeviceUnrealize parent_unrealize;
|
||||
};
|
||||
|
||||
#define LoongArchExtIOI LoongArchExtIOICommonState
|
||||
#define LOONGARCH_EXTIOI(obj) ((LoongArchExtIOICommonState *)obj)
|
||||
#endif /* LOONGARCH_EXTIOI_H */
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#ifndef LOONGARCH_EXTIOI_COMMON_H
|
||||
#define LOONGARCH_EXTIOI_COMMON_H
|
||||
|
||||
#include "qom/object.h"
|
||||
#include "hw/sysbus.h"
|
||||
#include "hw/loongarch/virt.h"
|
||||
|
||||
|
@ -56,6 +57,10 @@
|
|||
#define EXTIOI_VIRT_COREMAP_START (0x40)
|
||||
#define EXTIOI_VIRT_COREMAP_END (0x240)
|
||||
|
||||
#define TYPE_LOONGARCH_EXTIOI_COMMON "loongarch_extioi_common"
|
||||
OBJECT_DECLARE_TYPE(LoongArchExtIOICommonState,
|
||||
LoongArchExtIOICommonClass, LOONGARCH_EXTIOI_COMMON)
|
||||
|
||||
typedef struct ExtIOICore {
|
||||
uint32_t coreisr[EXTIOI_IRQS_GROUP_COUNT];
|
||||
DECLARE_BITMAP(sw_isr[LS3A_INTC_IP], EXTIOI_IRQS);
|
||||
|
@ -82,4 +87,11 @@ struct LoongArchExtIOICommonState {
|
|||
MemoryRegion extioi_system_mem;
|
||||
MemoryRegion virt_extend;
|
||||
};
|
||||
|
||||
struct LoongArchExtIOICommonClass {
|
||||
SysBusDeviceClass parent_class;
|
||||
|
||||
DeviceRealize parent_realize;
|
||||
int (*post_load)(void *s, int version_id);
|
||||
};
|
||||
#endif /* LOONGARCH_EXTIOI_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue