[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/32] vmstate: port syborg_rtc
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 10/32] vmstate: port syborg_rtc |
Date: |
Thu, 10 Mar 2011 12:47:46 +0100 |
Signed-off-by: Juan Quintela <address@hidden>
---
hw/syborg_rtc.c | 34 ++++++++++++----------------------
1 files changed, 12 insertions(+), 22 deletions(-)
diff --git a/hw/syborg_rtc.c b/hw/syborg_rtc.c
index 329aa42..4e24e52 100644
--- a/hw/syborg_rtc.c
+++ b/hw/syborg_rtc.c
@@ -102,26 +102,17 @@ static CPUWriteMemoryFunc * const syborg_rtc_writefn[] = {
syborg_rtc_write
};
-static void syborg_rtc_save(QEMUFile *f, void *opaque)
-{
- SyborgRTCState *s = opaque;
-
- qemu_put_be64(f, s->offset);
- qemu_put_be64(f, s->data);
-}
-
-static int syborg_rtc_load(QEMUFile *f, void *opaque, int version_id)
-{
- SyborgRTCState *s = opaque;
-
- if (version_id != 1)
- return -EINVAL;
-
- s->offset = qemu_get_be64(f);
- s->data = qemu_get_be64(f);
-
- return 0;
-}
+static const VMStateDescription vmstate_syborg_rtc = {
+ .name = "syborg_keyboard",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .minimum_version_id_old = 1,
+ .fields = (VMStateField[]) {
+ VMSTATE_INT64(offset, SyborgRTCState),
+ VMSTATE_INT64(data, SyborgRTCState),
+ VMSTATE_END_OF_LIST()
+ }
+};
static int syborg_rtc_init(SysBusDevice *dev)
{
@@ -137,8 +128,7 @@ static int syborg_rtc_init(SysBusDevice *dev)
qemu_get_timedate(&tm, 0);
s->offset = (uint64_t)mktime(&tm) * 1000000000;
- register_savevm(&dev->qdev, "syborg_rtc", -1, 1,
- syborg_rtc_save, syborg_rtc_load, s);
+ vmstate_register(&dev->qdev, -1, &vmstate_syborg_rtc, s);
return 0;
}
--
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, 2011/03/10
- [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 <=
- [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
- [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