Patchwork [15/15] integratorcp: convert icp_pic to VMState

login
register
mail settings
Submitter Benoit Canet
Date Oct. 24, 2011, 9:03 p.m.
Message ID <1319490221-5854-17-git-send-email-benoit.canet@gmail.com>
Download mbox | patch
Permalink /patch/121418/
State New
Headers show

Comments

Benoit Canet - Oct. 24, 2011, 9:03 p.m.
Signed-off-by: Benoit Canet <benoit.canet@gmail.com>
---
 hw/integratorcp.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/integratorcp.c b/hw/integratorcp.c
index 39322cb..0212ed6 100644
--- a/hw/integratorcp.c
+++ b/hw/integratorcp.c
@@ -310,6 +310,19 @@  typedef struct icp_pic_state
   qemu_irq parent_fiq;
 } icp_pic_state;
 
+static const VMStateDescription vmstate_icp_pic = {
+    .name = "pic",
+    .version_id = 1,
+    .minimum_version_id = 1,
+    .minimum_version_id_old = 1,
+    .fields = (VMStateField[]) {
+        VMSTATE_UINT32(level, icp_pic_state),
+        VMSTATE_UINT32(irq_enabled, icp_pic_state),
+        VMSTATE_UINT32(fiq_enabled, icp_pic_state),
+        VMSTATE_END_OF_LIST()
+    }
+};
+
 static void icp_pic_update(icp_pic_state *s)
 {
     uint32_t flags;
@@ -411,6 +424,7 @@  static int icp_pic_init(SysBusDevice *dev)
     sysbus_init_irq(dev, &s->parent_fiq);
     memory_region_init_io(&s->iomem, &icp_pic_ops, s, "icp-pic", 0x00800000);
     sysbus_init_mmio_region(dev, &s->iomem);
+    vmstate_register(&dev->qdev, -1, &vmstate_icp_pic, s);
     return 0;
 }