mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
vmstate: port pxa2xx_cm
Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
parent
9f5dfe298b
commit
ae1f90de06
1 changed files with 14 additions and 25 deletions
39
hw/pxa2xx.c
39
hw/pxa2xx.c
|
@ -227,29 +227,18 @@ static CPUWriteMemoryFunc * const pxa2xx_cm_writefn[] = {
|
||||||
pxa2xx_cm_write,
|
pxa2xx_cm_write,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void pxa2xx_cm_save(QEMUFile *f, void *opaque)
|
static const VMStateDescription vmstate_pxa2xx_cm = {
|
||||||
{
|
.name = "pxa2xx_cm",
|
||||||
PXA2xxState *s = (PXA2xxState *) opaque;
|
.version_id = 0,
|
||||||
int i;
|
.minimum_version_id = 0,
|
||||||
|
.minimum_version_id_old = 0,
|
||||||
for (i = 0; i < 4; i ++)
|
.fields = (VMStateField[]) {
|
||||||
qemu_put_be32s(f, &s->cm_regs[i]);
|
VMSTATE_UINT32_ARRAY(cm_regs, PXA2xxState, 4),
|
||||||
qemu_put_be32s(f, &s->clkcfg);
|
VMSTATE_UINT32(clkcfg, PXA2xxState),
|
||||||
qemu_put_be32s(f, &s->pmnc);
|
VMSTATE_UINT32(pmnc, PXA2xxState),
|
||||||
}
|
VMSTATE_END_OF_LIST()
|
||||||
|
}
|
||||||
static int pxa2xx_cm_load(QEMUFile *f, void *opaque, int version_id)
|
};
|
||||||
{
|
|
||||||
PXA2xxState *s = (PXA2xxState *) opaque;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < 4; i ++)
|
|
||||||
qemu_get_be32s(f, &s->cm_regs[i]);
|
|
||||||
qemu_get_be32s(f, &s->clkcfg);
|
|
||||||
qemu_get_be32s(f, &s->pmnc);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static uint32_t pxa2xx_clkpwr_read(void *opaque, int op2, int reg, int crm)
|
static uint32_t pxa2xx_clkpwr_read(void *opaque, int op2, int reg, int crm)
|
||||||
{
|
{
|
||||||
|
@ -2171,7 +2160,7 @@ PXA2xxState *pxa270_init(unsigned int sdram_size, const char *revision)
|
||||||
iomemtype = cpu_register_io_memory(pxa2xx_cm_readfn,
|
iomemtype = cpu_register_io_memory(pxa2xx_cm_readfn,
|
||||||
pxa2xx_cm_writefn, s, DEVICE_NATIVE_ENDIAN);
|
pxa2xx_cm_writefn, s, DEVICE_NATIVE_ENDIAN);
|
||||||
cpu_register_physical_memory(s->cm_base, 0x1000, iomemtype);
|
cpu_register_physical_memory(s->cm_base, 0x1000, iomemtype);
|
||||||
register_savevm(NULL, "pxa2xx_cm", 0, 0, pxa2xx_cm_save, pxa2xx_cm_load, s);
|
vmstate_register(NULL, 0, &vmstate_pxa2xx_cm, s);
|
||||||
|
|
||||||
cpu_arm_set_cp_io(s->env, 14, pxa2xx_cp14_read, pxa2xx_cp14_write, s);
|
cpu_arm_set_cp_io(s->env, 14, pxa2xx_cp14_read, pxa2xx_cp14_write, s);
|
||||||
|
|
||||||
|
@ -2307,7 +2296,7 @@ PXA2xxState *pxa255_init(unsigned int sdram_size)
|
||||||
iomemtype = cpu_register_io_memory(pxa2xx_cm_readfn,
|
iomemtype = cpu_register_io_memory(pxa2xx_cm_readfn,
|
||||||
pxa2xx_cm_writefn, s, DEVICE_NATIVE_ENDIAN);
|
pxa2xx_cm_writefn, s, DEVICE_NATIVE_ENDIAN);
|
||||||
cpu_register_physical_memory(s->cm_base, 0x1000, iomemtype);
|
cpu_register_physical_memory(s->cm_base, 0x1000, iomemtype);
|
||||||
register_savevm(NULL, "pxa2xx_cm", 0, 0, pxa2xx_cm_save, pxa2xx_cm_load, s);
|
vmstate_register(NULL, 0, &vmstate_pxa2xx_cm, s);
|
||||||
|
|
||||||
cpu_arm_set_cp_io(s->env, 14, pxa2xx_cp14_read, pxa2xx_cp14_write, s);
|
cpu_arm_set_cp_io(s->env, 14, pxa2xx_cp14_read, pxa2xx_cp14_write, s);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue