summaryrefslogtreecommitdiff
path: root/hw/hw.h
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>2011-03-03 03:34:01 +0100
committerAndrzej Zaborowski <balrog@zabor.org>2011-03-03 03:34:01 +0100
commit13801f32f6bd74eae9bb2fcfaee75c6656f7f73e (patch)
tree730736b11f4bf78bc956cb08ada5ecd9637a9b0d /hw/hw.h
parented02c54d1fd5d35c06e62e3dae84ee5bb90097ef (diff)
downloadqemu-13801f32f6bd74eae9bb2fcfaee75c6656f7f73e.tar.gz
vmstate: add VMSTATE_STRUCT_ARRAY_TEST
This is a _TEST variant of VMSTATE_STRUCT_ARRAY, necessary e.g. for future patch changing pxa2xx_timer to use vmstate. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
Diffstat (limited to 'hw/hw.h')
-rw-r--r--hw/hw.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/hw/hw.h b/hw/hw.h
index 5e24329589..f35b57981c 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -475,14 +475,15 @@ extern const VMStateInfo vmstate_info_unused_buffer;
.offset = vmstate_offset_array(_state, _field, _type, _num), \
}
-#define VMSTATE_STRUCT_ARRAY(_field, _state, _num, _version, _vmsd, _type) { \
- .name = (stringify(_field)), \
- .num = (_num), \
- .version_id = (_version), \
- .vmsd = &(_vmsd), \
- .size = sizeof(_type), \
- .flags = VMS_STRUCT|VMS_ARRAY, \
- .offset = vmstate_offset_array(_state, _field, _type, _num), \
+#define VMSTATE_STRUCT_ARRAY_TEST(_field, _state, _num, _test, _version, _vmsd, _type) { \
+ .name = (stringify(_field)), \
+ .num = (_num), \
+ .field_exists = (_test), \
+ .version_id = (_version), \
+ .vmsd = &(_vmsd), \
+ .size = sizeof(_type), \
+ .flags = VMS_STRUCT|VMS_ARRAY, \
+ .offset = vmstate_offset_array(_state, _field, _type, _num),\
}
#define VMSTATE_STRUCT_VARRAY_UINT8(_field, _state, _field_num, _version, _vmsd, _type) { \
@@ -625,6 +626,10 @@ extern const VMStateDescription vmstate_usb_device;
#define VMSTATE_STRUCT_POINTER(_field, _state, _vmsd, _type) \
VMSTATE_STRUCT_POINTER_TEST(_field, _state, NULL, _vmsd, _type)
+#define VMSTATE_STRUCT_ARRAY(_field, _state, _num, _version, _vmsd, _type) \
+ VMSTATE_STRUCT_ARRAY_TEST(_field, _state, _num, NULL, _version, \
+ _vmsd, _type)
+
#define VMSTATE_BOOL_V(_f, _s, _v) \
VMSTATE_SINGLE(_f, _s, _v, vmstate_info_bool, bool)