mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-09 08:15:46 +00:00
vmstate: port ppc4xx_pci
Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
parent
e0433ecc6e
commit
b605f22212
@ -285,50 +285,48 @@ static void ppc4xx_pci_set_irq(void *opaque, int irq_num, int level)
|
|||||||
qemu_set_irq(pci_irqs[irq_num], level);
|
qemu_set_irq(pci_irqs[irq_num], level);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ppc4xx_pci_save(QEMUFile *f, void *opaque)
|
static const VMStateDescription vmstate_pci_master_map = {
|
||||||
{
|
.name = "pci_master_map",
|
||||||
PPC4xxPCIState *controller = opaque;
|
.version_id = 0,
|
||||||
int i;
|
.minimum_version_id = 0,
|
||||||
|
.minimum_version_id_old = 0,
|
||||||
pci_device_save(controller->pci_dev, f);
|
.fields = (VMStateField[]) {
|
||||||
|
VMSTATE_UINT32(la, struct PCIMasterMap),
|
||||||
for (i = 0; i < PPC4xx_PCI_NR_PMMS; i++) {
|
VMSTATE_UINT32(ma, struct PCIMasterMap),
|
||||||
qemu_put_be32s(f, &controller->pmm[i].la);
|
VMSTATE_UINT32(pcila, struct PCIMasterMap),
|
||||||
qemu_put_be32s(f, &controller->pmm[i].ma);
|
VMSTATE_UINT32(pciha, struct PCIMasterMap),
|
||||||
qemu_put_be32s(f, &controller->pmm[i].pcila);
|
VMSTATE_END_OF_LIST()
|
||||||
qemu_put_be32s(f, &controller->pmm[i].pciha);
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
for (i = 0; i < PPC4xx_PCI_NR_PTMS; i++) {
|
static const VMStateDescription vmstate_pci_target_map = {
|
||||||
qemu_put_be32s(f, &controller->ptm[i].ms);
|
.name = "pci_target_map",
|
||||||
qemu_put_be32s(f, &controller->ptm[i].la);
|
.version_id = 0,
|
||||||
|
.minimum_version_id = 0,
|
||||||
|
.minimum_version_id_old = 0,
|
||||||
|
.fields = (VMStateField[]) {
|
||||||
|
VMSTATE_UINT32(ms, struct PCITargetMap),
|
||||||
|
VMSTATE_UINT32(la, struct PCITargetMap),
|
||||||
|
VMSTATE_END_OF_LIST()
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
static int ppc4xx_pci_load(QEMUFile *f, void *opaque, int version_id)
|
static const VMStateDescription vmstate_ppc4xx_pci = {
|
||||||
{
|
.name = "ppc4xx_pci",
|
||||||
PPC4xxPCIState *controller = opaque;
|
.version_id = 1,
|
||||||
int i;
|
.minimum_version_id = 1,
|
||||||
|
.minimum_version_id_old = 1,
|
||||||
if (version_id != 1)
|
.fields = (VMStateField[]) {
|
||||||
return -EINVAL;
|
VMSTATE_PCI_DEVICE_POINTER(pci_dev, PPC4xxPCIState),
|
||||||
|
VMSTATE_STRUCT_ARRAY(pmm, PPC4xxPCIState, PPC4xx_PCI_NR_PMMS, 1,
|
||||||
pci_device_load(controller->pci_dev, f);
|
vmstate_pci_master_map,
|
||||||
|
struct PCIMasterMap),
|
||||||
for (i = 0; i < PPC4xx_PCI_NR_PMMS; i++) {
|
VMSTATE_STRUCT_ARRAY(ptm, PPC4xxPCIState, PPC4xx_PCI_NR_PTMS, 1,
|
||||||
qemu_get_be32s(f, &controller->pmm[i].la);
|
vmstate_pci_target_map,
|
||||||
qemu_get_be32s(f, &controller->pmm[i].ma);
|
struct PCITargetMap),
|
||||||
qemu_get_be32s(f, &controller->pmm[i].pcila);
|
VMSTATE_END_OF_LIST()
|
||||||
qemu_get_be32s(f, &controller->pmm[i].pciha);
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
for (i = 0; i < PPC4xx_PCI_NR_PTMS; i++) {
|
|
||||||
qemu_get_be32s(f, &controller->ptm[i].ms);
|
|
||||||
qemu_get_be32s(f, &controller->ptm[i].la);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* XXX Interrupt acknowledge cycles not supported. */
|
/* XXX Interrupt acknowledge cycles not supported. */
|
||||||
PCIBus *ppc4xx_pci_init(CPUState *env, qemu_irq pci_irqs[4],
|
PCIBus *ppc4xx_pci_init(CPUState *env, qemu_irq pci_irqs[4],
|
||||||
@ -381,8 +379,8 @@ PCIBus *ppc4xx_pci_init(CPUState *env, qemu_irq pci_irqs[4],
|
|||||||
qemu_register_reset(ppc4xx_pci_reset, controller);
|
qemu_register_reset(ppc4xx_pci_reset, controller);
|
||||||
|
|
||||||
/* XXX load/save code not tested. */
|
/* XXX load/save code not tested. */
|
||||||
register_savevm(&controller->pci_dev->qdev, "ppc4xx_pci", ppc4xx_pci_id++,
|
vmstate_register(&controller->pci_dev->qdev, ppc4xx_pci_id++,
|
||||||
1, ppc4xx_pci_save, ppc4xx_pci_load, controller);
|
&vmstate_ppc4xx_pci, controller);
|
||||||
|
|
||||||
return controller->pci_state.bus;
|
return controller->pci_state.bus;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user