[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 13/13] vmstate: port mac_dbdma
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 13/13] vmstate: port mac_dbdma |
Date: |
Thu, 10 Mar 2011 12:54:30 +0100 |
Signed-off-by: Juan Quintela <address@hidden>
---
hw/mac_dbdma.c | 46 ++++++++++++++++++++++------------------------
1 files changed, 22 insertions(+), 24 deletions(-)
diff --git a/hw/mac_dbdma.c b/hw/mac_dbdma.c
index c108aee..ed4458e 100644
--- a/hw/mac_dbdma.c
+++ b/hw/mac_dbdma.c
@@ -810,30 +810,28 @@ static CPUReadMemoryFunc * const dbdma_read[] = {
dbdma_readl,
};
-static void dbdma_save(QEMUFile *f, void *opaque)
-{
- DBDMAState *s = opaque;
- unsigned int i, j;
-
- for (i = 0; i < DBDMA_CHANNELS; i++)
- for (j = 0; j < DBDMA_REGS; j++)
- qemu_put_be32s(f, &s->channels[i].regs[j]);
-}
-
-static int dbdma_load(QEMUFile *f, void *opaque, int version_id)
-{
- DBDMAState *s = opaque;
- unsigned int i, j;
-
- if (version_id != 2)
- return -EINVAL;
-
- for (i = 0; i < DBDMA_CHANNELS; i++)
- for (j = 0; j < DBDMA_REGS; j++)
- qemu_get_be32s(f, &s->channels[i].regs[j]);
+static const VMStateDescription vmstate_dbdma_channel = {
+ .name = "dbdma_channel",
+ .version_id = 0,
+ .minimum_version_id = 0,
+ .minimum_version_id_old = 0,
+ .fields = (VMStateField[]) {
+ VMSTATE_UINT32_ARRAY(regs, struct DBDMA_channel, DBDMA_REGS),
+ VMSTATE_END_OF_LIST()
+ }
+};
- return 0;
-}
+static const VMStateDescription vmstate_dbdma = {
+ .name = "dbdma",
+ .version_id = 2,
+ .minimum_version_id = 2,
+ .minimum_version_id_old = 2,
+ .fields = (VMStateField[]) {
+ VMSTATE_STRUCT_ARRAY(channels, DBDMAState, DBDMA_CHANNELS, 1,
+ vmstate_dbdma_channel, DBDMA_channel),
+ VMSTATE_END_OF_LIST()
+ }
+};
static void dbdma_reset(void *opaque)
{
@@ -852,7 +850,7 @@ void* DBDMA_init (int *dbdma_mem_index)
*dbdma_mem_index = cpu_register_io_memory(dbdma_read, dbdma_write, s,
DEVICE_LITTLE_ENDIAN);
- register_savevm(NULL, "dbdma", -1, 1, dbdma_save, dbdma_load, s);
+ vmstate_register(NULL, -1, &vmstate_dbdma, s);
qemu_register_reset(dbdma_reset, s);
dbdma_bh = qemu_bh_new(DBDMA_run_bh, s);
--
1.7.4
- [Qemu-devel] [PATCH 01/13] pxa2xx_lcd: name anonymous struct, (continued)
- [Qemu-devel] [PATCH 01/13] pxa2xx_lcd: name anonymous struct, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 02/13] pxa2xx_lcd: up field is used as a bool and migrated as an uint8_t, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 03/13] vmstate: port pxa2xx_lcd, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 05/13] vmstate: port max111x, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 04/13] max111x: input field is only used as uint8_t, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 07/13] vmstate: port nand, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 09/13] vmstate: port mac_nvram, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 10/13] piix4: create PIIX4State, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 06/13] nand: pin values are uint8_t, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 08/13] mac_nvram: size is a size, no need to be a target dependent type, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 13/13] vmstate: port mac_dbdma,
Juan Quintela <=
- [Qemu-devel] [PATCH 12/13] mac_dbdma: create DBDMAState instead of passing one array around, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 11/13] vmstate: port piix4, Juan Quintela, 2011/03/10