aboutsummaryrefslogtreecommitdiff
path: root/hw/hw.h
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2011-08-09 23:54:53 +0200
committerGerd Hoffmann <kraxel@redhat.com>2011-08-10 14:14:00 +0200
commitccd4ed065be4023c86252d25118cc96abf77df66 (patch)
treecd93c6175ff7077eba10b1c9beda1d04a6ff848c /hw/hw.h
parentbb0db5273f51629e2c900a27b45b9f8c44ad0e8d (diff)
hid: introduce hid vmstate macros
Add VMSTATE macros to describe a HIDState. Based on usb-hid.c descriptions. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/hw.h')
-rw-r--r--hw/hw.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/hw/hw.h b/hw/hw.h
index df6ca65058..a124da9c26 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -701,6 +701,26 @@ extern const VMStateDescription vmstate_ptimer;
.offset = vmstate_offset_pointer(_state, _field, ptimer_state), \
}
+extern const VMStateDescription vmstate_hid_keyboard_device;
+
+#define VMSTATE_HID_KEYBOARD_DEVICE(_field, _state) { \
+ .name = (stringify(_field)), \
+ .size = sizeof(HIDState), \
+ .vmsd = &vmstate_hid_keyboard_device, \
+ .flags = VMS_STRUCT, \
+ .offset = vmstate_offset_value(_state, _field, HIDState), \
+}
+
+extern const VMStateDescription vmstate_hid_ptr_device;
+
+#define VMSTATE_HID_POINTER_DEVICE(_field, _state) { \
+ .name = (stringify(_field)), \
+ .size = sizeof(HIDState), \
+ .vmsd = &vmstate_hid_ptr_device, \
+ .flags = VMS_STRUCT, \
+ .offset = vmstate_offset_value(_state, _field, HIDState), \
+}
+
/* _f : field name
_f_n : num of elements field_name
_n : num of elements