mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-04 16:02:02 -06:00
hw/intc/loongarch_extioi: Add pre_save interface
Add vmstate pre_save interface, which can be used extioi kvm driver in future. Signed-off-by: Bibo Mao <maobibo@loongson.cn> Reviewed-by: Song Gao <gaosong@loongson.cn>
This commit is contained in:
parent
272c467a48
commit
ff09444a88
2 changed files with 14 additions and 0 deletions
|
@ -20,6 +20,18 @@ static void loongarch_extioi_common_realize(DeviceState *dev, Error **errp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int loongarch_extioi_common_pre_save(void *opaque)
|
||||||
|
{
|
||||||
|
LoongArchExtIOICommonState *s = (LoongArchExtIOICommonState *)opaque;
|
||||||
|
LoongArchExtIOICommonClass *lecc = LOONGARCH_EXTIOI_COMMON_GET_CLASS(s);
|
||||||
|
|
||||||
|
if (lecc->pre_save) {
|
||||||
|
return lecc->pre_save(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int loongarch_extioi_common_post_load(void *opaque, int version_id)
|
static int loongarch_extioi_common_post_load(void *opaque, int version_id)
|
||||||
{
|
{
|
||||||
LoongArchExtIOICommonState *s = (LoongArchExtIOICommonState *)opaque;
|
LoongArchExtIOICommonState *s = (LoongArchExtIOICommonState *)opaque;
|
||||||
|
@ -46,6 +58,7 @@ static const VMStateDescription vmstate_loongarch_extioi = {
|
||||||
.name = "loongarch.extioi",
|
.name = "loongarch.extioi",
|
||||||
.version_id = 3,
|
.version_id = 3,
|
||||||
.minimum_version_id = 3,
|
.minimum_version_id = 3,
|
||||||
|
.pre_save = loongarch_extioi_common_pre_save,
|
||||||
.post_load = loongarch_extioi_common_post_load,
|
.post_load = loongarch_extioi_common_post_load,
|
||||||
.fields = (const VMStateField[]) {
|
.fields = (const VMStateField[]) {
|
||||||
VMSTATE_UINT32_ARRAY(bounce, LoongArchExtIOICommonState,
|
VMSTATE_UINT32_ARRAY(bounce, LoongArchExtIOICommonState,
|
||||||
|
|
|
@ -92,6 +92,7 @@ struct LoongArchExtIOICommonClass {
|
||||||
SysBusDeviceClass parent_class;
|
SysBusDeviceClass parent_class;
|
||||||
|
|
||||||
DeviceRealize parent_realize;
|
DeviceRealize parent_realize;
|
||||||
|
int (*pre_save)(void *s);
|
||||||
int (*post_load)(void *s, int version_id);
|
int (*post_load)(void *s, int version_id);
|
||||||
};
|
};
|
||||||
#endif /* LOONGARCH_EXTIOI_H */
|
#endif /* LOONGARCH_EXTIOI_H */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue