[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 28/58] vmstate: port heathrow_pic
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 28/58] vmstate: port heathrow_pic |
Date: |
Thu, 24 Feb 2011 18:57:25 +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 18/58] vmstate: port pmtimer, (continued)
- [Qemu-devel] [PATCH 18/58] vmstate: port pmtimer, Juan Quintela, 2011/02/24
- [Qemu-devel] [PATCH 49/58] max111x: input field is only used as uint8_t, Juan Quintela, 2011/02/24
- [Qemu-devel] [PATCH 05/58] vmstate: add VMSTATE_INT64_ARRAY, Juan Quintela, 2011/02/24
- [Qemu-devel] [PATCH 43/58] vmstate: stellaris use unused for placeholder entries, Juan Quintela, 2011/02/24
- [Qemu-devel] [PATCH 08/58] vmstate: be able to store/save a pci device from a pointer, Juan Quintela, 2011/02/24
- [Qemu-devel] [PATCH 16/58] vmstate: port arm_timer, Juan Quintela, 2011/02/24
- [Qemu-devel] [PATCH 12/58] vmstate: port ads7846, Juan Quintela, 2011/02/24
- [Qemu-devel] [PATCH 14/58] vmstate: port mipsnet, Juan Quintela, 2011/02/24
- [Qemu-devel] [PATCH 31/58] vmstate: port pxa2xx_i2s, Juan Quintela, 2011/02/24
- [Qemu-devel] [PATCH 28/58] vmstate: port heathrow_pic,
Juan Quintela <=
- [Qemu-devel] [PATCH 48/58] vmstate: port pxa2xx_lcdc, Juan Quintela, 2011/02/24
- [Qemu-devel] [PATCH 53/58] mac_nvram: size is a size, no need to be a target dependent type, Juan Quintela, 2011/02/24
- [Qemu-devel] [PATCH 07/58] vmstate: Add a way to send a partial array, Juan Quintela, 2011/02/24
- [Qemu-devel] [PATCH 46/58] pxa2xx_lcd: name anonymous struct, Juan Quintela, 2011/02/24
- [Qemu-devel] [PATCH 15/58] vmstate: port arm sp804, Juan Quintela, 2011/02/24
- [Qemu-devel] [PATCH 51/58] nand: pin values are uint8_t, Juan Quintela, 2011/02/24
- [Qemu-devel] [PATCH 44/58] pxa2xx_dma: make req array static, Juan Quintela, 2011/02/24
- [Qemu-devel] [PATCH 54/58] vmstate: port mac_nvram, Juan Quintela, 2011/02/24
- [Qemu-devel] [PATCH 02/58] vmstate: Fix varrays with uint8 indexes, Juan Quintela, 2011/02/24