[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 22/32] vmstate: port pxa2xx_cm
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 22/32] vmstate: port pxa2xx_cm |
Date: |
Thu, 10 Mar 2011 12:47:58 +0100 |
Signed-off-by: Juan Quintela <address@hidden>
---
hw/pxa2xx.c | 39 ++++++++++++++-------------------------
1 files changed, 14 insertions(+), 25 deletions(-)
diff --git a/hw/pxa2xx.c b/hw/pxa2xx.c
index 9bafe05..a3ba30a 100644
--- a/hw/pxa2xx.c
+++ b/hw/pxa2xx.c
@@ -227,29 +227,18 @@ static CPUWriteMemoryFunc * const pxa2xx_cm_writefn[] = {
pxa2xx_cm_write,
};
-static void pxa2xx_cm_save(QEMUFile *f, void *opaque)
-{
- PXA2xxState *s = (PXA2xxState *) opaque;
- int i;
-
- for (i = 0; i < 4; i ++)
- qemu_put_be32s(f, &s->cm_regs[i]);
- qemu_put_be32s(f, &s->clkcfg);
- qemu_put_be32s(f, &s->pmnc);
-}
-
-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 const VMStateDescription vmstate_pxa2xx_cm = {
+ .name = "pxa2xx_cm",
+ .version_id = 0,
+ .minimum_version_id = 0,
+ .minimum_version_id_old = 0,
+ .fields = (VMStateField[]) {
+ VMSTATE_UINT32_ARRAY(cm_regs, PXA2xxState, 4),
+ VMSTATE_UINT32(clkcfg, PXA2xxState),
+ VMSTATE_UINT32(pmnc, PXA2xxState),
+ VMSTATE_END_OF_LIST()
+ }
+};
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,
pxa2xx_cm_writefn, s, DEVICE_NATIVE_ENDIAN);
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);
@@ -2307,7 +2296,7 @@ PXA2xxState *pxa255_init(unsigned int sdram_size)
iomemtype = cpu_register_io_memory(pxa2xx_cm_readfn,
pxa2xx_cm_writefn, s, DEVICE_NATIVE_ENDIAN);
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);
--
1.7.4
- [Qemu-devel] [PATCH 13/32] vmstate: port armv7m nvic, (continued)
- [Qemu-devel] [PATCH 13/32] vmstate: port armv7m nvic, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 12/32] vmstate: port pl011, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 14/32] vmstate: port stellaris i2c, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 11/32] vmstate: port pxa2xx_keypad, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 15/32] vmstate: port stellaris ssi bus, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 19/32] vmstate: port cuda, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 16/32] vmstate: port stellaris sys, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 18/32] vmstate: port heathrow_pic, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 17/32] vmstate: port pl022 ssp, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 20/32] vmstate: port stellaris gptm, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 22/32] vmstate: port pxa2xx_cm,
Juan Quintela <=
- [Qemu-devel] [PATCH 21/32] vmstate: port pxa2xx_i2s, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 23/32] vmstate: port pxa2xx_mm, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 24/32] vmstate: port pxa2xx_pm, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 26/32] vmstate: port ppc4xx_pci, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 25/32] vmstate: port ppce500_pci, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 27/32] vmstate: port syborg_pointer, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 28/32] vmstate: port stellaris_adc, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 29/32] vmstate: port syborg_serial, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 30/32] vmstate: port syborg_keyboard, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 32/32] vmstate: stellaris use unused for placeholder entries, Juan Quintela, 2011/03/10