aboutsummaryrefslogtreecommitdiffstats
path: root/hw/wdt_ib700.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-10-15 00:57:35 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-27 12:28:48 -0500
commit9958068d6078720d391230da4bbf731c9ae27135 (patch)
tree58b7480ea16e0a876e84c872c3a3eef830d8faf9 /hw/wdt_ib700.c
parente8f27c728cb3a9b98f5e6f65bcafee0fe565698e (diff)
ib700: port to vmstate
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/wdt_ib700.c')
-rw-r--r--hw/wdt_ib700.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/hw/wdt_ib700.c b/hw/wdt_ib700.c
index d2b9b4199..d67bf9eb4 100644
--- a/hw/wdt_ib700.c
+++ b/hw/wdt_ib700.c
@@ -82,31 +82,23 @@ static void ib700_timer_expired(void *vp)
qemu_del_timer(s->timer);
}
-static void ib700_save(QEMUFile *f, void *vp)
-{
- IB700State *s = vp;
-
- qemu_put_timer(f, s->timer);
-}
-
-static int ib700_load(QEMUFile *f, void *vp, int version)
-{
- IB700State *s = vp;
-
- if (version != 0)
- return -EINVAL;
-
- qemu_get_timer(f, s->timer);
-
- return 0;
-}
+static const VMStateDescription vmstate_ib700 = {
+ .name = "ib700_wdt",
+ .version_id = 0,
+ .minimum_version_id = 0,
+ .minimum_version_id_old = 0,
+ .fields = (VMStateField []) {
+ VMSTATE_TIMER(timer, IB700State),
+ VMSTATE_END_OF_LIST()
+ }
+};
static int wdt_ib700_init(ISADevice *dev)
{
IB700State *s = DO_UPCAST(IB700State, dev, dev);
s->timer = qemu_new_timer(vm_clock, ib700_timer_expired, s);
- register_savevm("ib700_wdt", -1, 0, ib700_save, ib700_load, s);
+ vmstate_register(-1, &vmstate_ib700, s);
register_ioport_write(0x441, 2, 1, ib700_write_disable_reg, s);
register_ioport_write(0x443, 2, 1, ib700_write_enable_reg, s);