[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 21/32] vmstate: port pxa2xx_i2s
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 21/32] vmstate: port pxa2xx_i2s |
Date: |
Thu, 10 Mar 2011 12:47:57 +0100 |
Signed-off-by: Juan Quintela <address@hidden>
---
hw/pxa2xx.c | 53 ++++++++++++++++++-----------------------------------
1 files changed, 18 insertions(+), 35 deletions(-)
diff --git a/hw/pxa2xx.c b/hw/pxa2xx.c
index 4c7b9e6..9bafe05 100644
--- a/hw/pxa2xx.c
+++ b/hw/pxa2xx.c
@@ -1748,39 +1748,23 @@ static CPUWriteMemoryFunc * const pxa2xx_i2s_writefn[]
= {
pxa2xx_i2s_write,
};
-static void pxa2xx_i2s_save(QEMUFile *f, void *opaque)
-{
- PXA2xxI2SState *s = (PXA2xxI2SState *) opaque;
-
- qemu_put_be32s(f, &s->control[0]);
- qemu_put_be32s(f, &s->control[1]);
- qemu_put_be32s(f, &s->status);
- qemu_put_be32s(f, &s->mask);
- qemu_put_be32s(f, &s->clk);
-
- qemu_put_be32(f, s->enable);
- qemu_put_be32(f, s->rx_len);
- qemu_put_be32(f, s->tx_len);
- qemu_put_be32(f, s->fifo_len);
-}
-
-static int pxa2xx_i2s_load(QEMUFile *f, void *opaque, int version_id)
-{
- PXA2xxI2SState *s = (PXA2xxI2SState *) opaque;
-
- qemu_get_be32s(f, &s->control[0]);
- qemu_get_be32s(f, &s->control[1]);
- qemu_get_be32s(f, &s->status);
- qemu_get_be32s(f, &s->mask);
- qemu_get_be32s(f, &s->clk);
-
- s->enable = qemu_get_be32(f);
- s->rx_len = qemu_get_be32(f);
- s->tx_len = qemu_get_be32(f);
- s->fifo_len = qemu_get_be32(f);
-
- return 0;
-}
+static const VMStateDescription vmstate_pxa2xx_i2s = {
+ .name = "pxa2xx_i2s",
+ .version_id = 0,
+ .minimum_version_id = 0,
+ .minimum_version_id_old = 0,
+ .fields = (VMStateField[]) {
+ VMSTATE_UINT32_ARRAY(control, PXA2xxI2SState, 2),
+ VMSTATE_UINT32(status, PXA2xxI2SState),
+ VMSTATE_UINT32(mask, PXA2xxI2SState),
+ VMSTATE_UINT32(clk, PXA2xxI2SState),
+ VMSTATE_INT32(enable, PXA2xxI2SState),
+ VMSTATE_INT32(rx_len, PXA2xxI2SState),
+ VMSTATE_INT32(tx_len, PXA2xxI2SState),
+ VMSTATE_INT32(fifo_len, PXA2xxI2SState),
+ VMSTATE_END_OF_LIST()
+ }
+};
static void pxa2xx_i2s_data_req(void *opaque, int tx, int rx)
{
@@ -1822,8 +1806,7 @@ static PXA2xxI2SState *pxa2xx_i2s_init(target_phys_addr_t
base,
pxa2xx_i2s_writefn, s, DEVICE_NATIVE_ENDIAN);
cpu_register_physical_memory(base, 0x100000, iomemtype);
- register_savevm(NULL, "pxa2xx_i2s", base, 0,
- pxa2xx_i2s_save, pxa2xx_i2s_load, s);
+ vmstate_register(NULL, base, &vmstate_pxa2xx_i2s, s);
return s;
}
--
1.7.4
- [Qemu-devel] [PATCH 12/32] vmstate: port pl011, (continued)
- [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, 2011/03/10
- [Qemu-devel] [PATCH 21/32] vmstate: port pxa2xx_i2s,
Juan Quintela <=
- [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
- [Qemu-devel] [PATCH 31/32] vmstate: port stellaris gamepad, Juan Quintela, 2011/03/10