[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/5] realview: convert realview i2c to VMState
From: |
Benoît Canet |
Subject: |
[Qemu-devel] [PATCH 3/5] realview: convert realview i2c to VMState |
Date: |
Tue, 25 Oct 2011 13:09:41 +0200 |
Signed-off-by: Benoit Canet <address@hidden>
---
hw/realview.c | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/hw/realview.c b/hw/realview.c
index 11ffb8a..2120600 100644
--- a/hw/realview.c
+++ b/hw/realview.c
@@ -24,10 +24,26 @@
typedef struct {
SysBusDevice busdev;
bitbang_i2c_interface *bitbang;
- int out;
- int in;
+ int32_t out;
+ int32_t in;
} RealViewI2CState;
+extern VMStateDescription vmstate_bitbang_i2c;
+
+const VMStateDescription vmstate_realview_i2c = {
+ .name = "realview_i2c",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .minimum_version_id_old = 1,
+ .fields = (VMStateField[]) {
+ VMSTATE_STRUCT_POINTER(bitbang, RealViewI2CState, vmstate_bitbang_i2c,
+ bitbang_i2c_interface *),
+ VMSTATE_INT32(out, RealViewI2CState),
+ VMSTATE_INT32(in, RealViewI2CState),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
static uint32_t realview_i2c_read(void *opaque, target_phys_addr_t offset)
{
RealViewI2CState *s = (RealViewI2CState *)opaque;
@@ -90,6 +106,7 @@ static SysBusDeviceInfo realview_i2c_info = {
.init = realview_i2c_init,
.qdev.name = "realview_i2c",
.qdev.size = sizeof(RealViewI2CState),
+ .qdev.vmsd = &vmstate_realview_i2c,
};
static void realview_register_devices(void)
--
1.7.5.4