[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 18/32] vmstate: port heathrow_pic
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 18/32] vmstate: port heathrow_pic |
Date: |
Thu, 10 Mar 2011 12:47:54 +0100 |
Signed-off-by: Juan Quintela <address@hidden>
---
hw/heathrow_pic.c | 62 +++++++++++++++++++++-------------------------------
1 files changed, 25 insertions(+), 37 deletions(-)
diff --git a/hw/heathrow_pic.c b/hw/heathrow_pic.c
index b19b754..5fd71a0 100644
--- a/hw/heathrow_pic.c
+++ b/hw/heathrow_pic.c
@@ -159,42 +159,31 @@ static void heathrow_pic_set_irq(void *opaque, int num,
int level)
heathrow_pic_update(s);
}
-static void heathrow_pic_save_one(QEMUFile *f, HeathrowPIC *s)
-{
- qemu_put_be32s(f, &s->events);
- qemu_put_be32s(f, &s->mask);
- qemu_put_be32s(f, &s->levels);
- qemu_put_be32s(f, &s->level_triggered);
-}
-
-static void heathrow_pic_save(QEMUFile *f, void *opaque)
-{
- HeathrowPICS *s = (HeathrowPICS *)opaque;
-
- heathrow_pic_save_one(f, &s->pics[0]);
- heathrow_pic_save_one(f, &s->pics[1]);
-}
-
-static void heathrow_pic_load_one(QEMUFile *f, HeathrowPIC *s)
-{
- qemu_get_be32s(f, &s->events);
- qemu_get_be32s(f, &s->mask);
- qemu_get_be32s(f, &s->levels);
- qemu_get_be32s(f, &s->level_triggered);
-}
-
-static int heathrow_pic_load(QEMUFile *f, void *opaque, int version_id)
-{
- HeathrowPICS *s = (HeathrowPICS *)opaque;
-
- if (version_id != 1)
- return -EINVAL;
-
- heathrow_pic_load_one(f, &s->pics[0]);
- heathrow_pic_load_one(f, &s->pics[1]);
+static const VMStateDescription vmstate_heathrow_pic_one = {
+ .name = "heathrow_pic_one",
+ .version_id = 0,
+ .minimum_version_id = 0,
+ .minimum_version_id_old = 0,
+ .fields = (VMStateField[]) {
+ VMSTATE_UINT32(events, HeathrowPIC),
+ VMSTATE_UINT32(mask, HeathrowPIC),
+ VMSTATE_UINT32(levels, HeathrowPIC),
+ VMSTATE_UINT32(level_triggered, HeathrowPIC),
+ VMSTATE_END_OF_LIST()
+ }
+};
- return 0;
-}
+static const VMStateDescription vmstate_heathrow_pic = {
+ .name = "heathrow_pic",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .minimum_version_id_old = 1,
+ .fields = (VMStateField[]) {
+ VMSTATE_STRUCT_ARRAY(pics, HeathrowPICS, 2, 1,
+ vmstate_heathrow_pic_one, HeathrowPIC),
+ VMSTATE_END_OF_LIST()
+ }
+};
static void heathrow_pic_reset_one(HeathrowPIC *s)
{
@@ -223,8 +212,7 @@ qemu_irq *heathrow_pic_init(int *pmem_index,
*pmem_index = cpu_register_io_memory(pic_read, pic_write, s,
DEVICE_LITTLE_ENDIAN);
- register_savevm(NULL, "heathrow_pic", -1, 1, heathrow_pic_save,
- heathrow_pic_load, s);
+ vmstate_register(NULL, -1, &vmstate_heathrow_pic, s);
qemu_register_reset(heathrow_pic_reset, s);
return qemu_allocate_irqs(heathrow_pic_set_irq, s, 64);
}
--
1.7.4
- [Qemu-devel] [PATCH 09/32] vmstate: port pmtimer, (continued)
- [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
- [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 <=
- [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
- [Qemu-devel] [PATCH 21/32] vmstate: port pxa2xx_i2s, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 23/32] vmstate: port pxa2xx_mm, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 24/32] vmstate: port pxa2xx_pm, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 26/32] vmstate: port ppc4xx_pci, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 25/32] vmstate: port ppce500_pci, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 27/32] vmstate: port syborg_pointer, Juan Quintela, 2011/03/10
- [Qemu-devel] [PATCH 28/32] vmstate: port stellaris_adc, Juan Quintela, 2011/03/10