diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-01-13 17:07:20 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-01-13 10:20:51 -0600 |
commit | 701a8f76aa5243d90a71935982c20c06d8e83b80 (patch) | |
tree | 0cd413bfa739326cb70b251d3ed2b698d0debb41 /hw/hid.h | |
parent | 49d4d9b63ebb0d487e80d3d85a75d8256d313df9 (diff) |
vmstate: extract declarations out of hw/hw.h
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/hid.h')
-rw-r--r-- | hw/hid.h | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -1,6 +1,8 @@ #ifndef QEMU_HID_H #define QEMU_HID_H +#include "vmstate.h" + #define HID_MOUSE 1 #define HID_TABLET 2 #define HID_KEYBOARD 3 @@ -56,4 +58,25 @@ int hid_pointer_poll(HIDState *hs, uint8_t *buf, int len); int hid_keyboard_poll(HIDState *hs, uint8_t *buf, int len); int hid_keyboard_write(HIDState *hs, uint8_t *buf, int len); +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), \ +} + + #endif /* QEMU_HID_H */ |