mirror of https://github.com/xqemu/xqemu.git
vmstate: add VMSTATE_BUFFER_TEST
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
96c35cebfe
commit
25dc563b09
12
hw/hw.h
12
hw/hw.h
|
@ -464,6 +464,15 @@ extern const VMStateInfo vmstate_info_buffer;
|
||||||
+ type_check_array(uint8_t,typeof_field(_state, _field),sizeof(typeof_field(_state,_field))) \
|
+ type_check_array(uint8_t,typeof_field(_state, _field),sizeof(typeof_field(_state,_field))) \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define VMSTATE_STATIC_BUFFER_TEST(_field, _state, _test) { \
|
||||||
|
.name = (stringify(_field)), \
|
||||||
|
.field_exists = (_test), \
|
||||||
|
.size = sizeof(typeof_field(_state,_field)), \
|
||||||
|
.info = &vmstate_info_buffer, \
|
||||||
|
.flags = VMS_BUFFER, \
|
||||||
|
.offset = offsetof(_state, _field) \
|
||||||
|
+ type_check_array(uint8_t,typeof_field(_state, _field),sizeof(typeof_field(_state,_field))) \
|
||||||
|
}
|
||||||
#define VMSTATE_BUFFER_START_MIDDLE(_field, _state, start) { \
|
#define VMSTATE_BUFFER_START_MIDDLE(_field, _state, start) { \
|
||||||
.name = (stringify(_field)), \
|
.name = (stringify(_field)), \
|
||||||
.size = sizeof(typeof_field(_state,_field)) - start, \
|
.size = sizeof(typeof_field(_state,_field)) - start, \
|
||||||
|
@ -613,6 +622,9 @@ extern const VMStateDescription vmstate_i2c_slave;
|
||||||
#define VMSTATE_BUFFER(_f, _s) \
|
#define VMSTATE_BUFFER(_f, _s) \
|
||||||
VMSTATE_STATIC_BUFFER(_f, _s, 0)
|
VMSTATE_STATIC_BUFFER(_f, _s, 0)
|
||||||
|
|
||||||
|
#define VMSTATE_BUFFER_TEST(_f, _s, _t) \
|
||||||
|
VMSTATE_STATIC_BUFFER_TEST(_f, _s, _t)
|
||||||
|
|
||||||
#ifdef NEED_CPU_H
|
#ifdef NEED_CPU_H
|
||||||
#if TARGET_LONG_BITS == 64
|
#if TARGET_LONG_BITS == 64
|
||||||
#define VMSTATE_UINTTL_V(_f, _s, _v) \
|
#define VMSTATE_UINTTL_V(_f, _s, _v) \
|
||||||
|
|
Loading…
Reference in New Issue