[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 04/32] vmstate: port m48t59
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 04/32] vmstate: port m48t59 |
Date: |
Thu, 10 Mar 2011 12:47:40 +0100 |
Signed-off-by: Juan Quintela <address@hidden>
---
hw/m48t59.c | 36 +++++++++++++-----------------------
1 files changed, 13 insertions(+), 23 deletions(-)
diff --git a/hw/m48t59.c b/hw/m48t59.c
index 2020487..82223c9 100644
--- a/hw/m48t59.c
+++ b/hw/m48t59.c
@@ -585,28 +585,18 @@ static CPUReadMemoryFunc * const nvram_read[] = {
&nvram_readl,
};
-static void m48t59_save(QEMUFile *f, void *opaque)
-{
- M48t59State *s = opaque;
-
- qemu_put_8s(f, &s->lock);
- qemu_put_be16s(f, &s->addr);
- qemu_put_buffer(f, s->buffer, s->size);
-}
-
-static int m48t59_load(QEMUFile *f, void *opaque, int version_id)
-{
- M48t59State *s = opaque;
-
- if (version_id != 1)
- return -EINVAL;
-
- qemu_get_8s(f, &s->lock);
- qemu_get_be16s(f, &s->addr);
- qemu_get_buffer(f, s->buffer, s->size);
-
- return 0;
-}
+static const VMStateDescription vmstate_m48t59 = {
+ .name = "m48t59",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .minimum_version_id_old = 1,
+ .fields = (VMStateField[]) {
+ VMSTATE_UINT8(lock, M48t59State),
+ VMSTATE_UINT16(addr, M48t59State),
+ VMSTATE_VBUFFER_UINT32(buffer, M48t59State, 0, NULL, 0, size),
+ VMSTATE_END_OF_LIST()
+ }
+};
static void m48t59_reset_common(M48t59State *NVRAM)
{
@@ -696,7 +686,7 @@ static void m48t59_init_common(M48t59State *s)
}
qemu_get_timedate(&s->alarm, 0);
- register_savevm(NULL, "m48t59", -1, 1, m48t59_save, m48t59_load, s);
+ vmstate_register(NULL, -1, &vmstate_m48t59, s);
}
static int m48t59_init_isa1(ISADevice *dev)
--
1.7.4
- [Qemu-devel] [PATCH 00/32] VMState port of misc devices, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 01/32] vmstate: port adb_kbd, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 02/32] vmstate: port adb_mouse, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 03/32] vmstate: port ads7846, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 04/32] vmstate: port m48t59,
Juan Quintela <=
- [Qemu-devel] [PATCH 06/32] vmstate: port arm sp804, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 05/32] vmstate: port mipsnet, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 07/32] vmstate: port arm_timer, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 09/32] vmstate: port pmtimer, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 10/32] vmstate: port syborg_rtc, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 08/32] vmstate: port sysborg_timer, Juan Quintela, 2011/03/10
- [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