From ccd4ed065be4023c86252d25118cc96abf77df66 Mon Sep 17 00:00:00 2001 From: Michael Walle Date: Tue, 9 Aug 2011 23:54:53 +0200 Subject: hid: introduce hid vmstate macros Add VMSTATE macros to describe a HIDState. Based on usb-hid.c descriptions. Signed-off-by: Michael Walle Signed-off-by: Gerd Hoffmann --- hw/hw.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'hw/hw.h') diff --git a/hw/hw.h b/hw/hw.h index df6ca65..a124da9 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 -- cgit v1.1