[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 13/32] vmstate: port armv7m nvic
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 13/32] vmstate: port armv7m nvic |
Date: |
Thu, 10 Mar 2011 12:47:49 +0100 |
Signed-off-by: Juan Quintela <address@hidden>
---
hw/armv7m_nvic.c | 39 ++++++++++++++-------------------------
1 files changed, 14 insertions(+), 25 deletions(-)
diff --git a/hw/armv7m_nvic.c b/hw/armv7m_nvic.c
index 6c7ce01..397f5c9 100644
--- a/hw/armv7m_nvic.c
+++ b/hw/armv7m_nvic.c
@@ -365,30 +365,19 @@ static void nvic_writel(void *opaque, uint32_t offset,
uint32_t value)
}
}
-static void nvic_save(QEMUFile *f, void *opaque)
-{
- nvic_state *s = (nvic_state *)opaque;
-
- qemu_put_be32(f, s->systick.control);
- qemu_put_be32(f, s->systick.reload);
- qemu_put_be64(f, s->systick.tick);
- qemu_put_timer(f, s->systick.timer);
-}
-
-static int nvic_load(QEMUFile *f, void *opaque, int version_id)
-{
- nvic_state *s = (nvic_state *)opaque;
-
- if (version_id != 1)
- return -EINVAL;
-
- s->systick.control = qemu_get_be32(f);
- s->systick.reload = qemu_get_be32(f);
- s->systick.tick = qemu_get_be64(f);
- qemu_get_timer(f, s->systick.timer);
-
- return 0;
-}
+static const VMStateDescription vmstate_nvic = {
+ .name = "armv7m_nvic",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .minimum_version_id_old = 1,
+ .fields = (VMStateField[]) {
+ VMSTATE_UINT32(systick.control, nvic_state),
+ VMSTATE_UINT32(systick.reload, nvic_state),
+ VMSTATE_INT64(systick.tick, nvic_state),
+ VMSTATE_TIMER(systick.timer, nvic_state),
+ VMSTATE_END_OF_LIST()
+ }
+};
static int armv7m_nvic_init(SysBusDevice *dev)
{
@@ -397,7 +386,7 @@ static int armv7m_nvic_init(SysBusDevice *dev)
gic_init(&s->gic);
cpu_register_physical_memory(0xe000e000, 0x1000, s->gic.iomemtype);
s->systick.timer = qemu_new_timer(vm_clock, systick_timer_tick, s);
- register_savevm(&dev->qdev, "armv7m_nvic", -1, 1, nvic_save, nvic_load, s);
+ vmstate_register(&dev->qdev, -1, &vmstate_nvic, s);
return 0;
}
--
1.7.4
- [Qemu-devel] [PATCH 01/32] vmstate: port adb_kbd, (continued)
- [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, 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 <=
- [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