hid.c (46919512fcfec1e677733a16bc178898c524854f) hid.c (af0f07dfc7ce56a944c38d872b7d4502178e6948)
1/*
2 * QEMU HID devices
3 *
4 * Copyright (c) 2005 Fabrice Bellard
5 * Copyright (c) 2007 OpenMoko, Inc. (andrew@openedhand.com)
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal

--- 567 unchanged lines hidden (view full) ---

576 }
577 return 0;
578}
579
580static const VMStateDescription vmstate_hid_ptr_queue = {
581 .name = "HIDPointerEventQueue",
582 .version_id = 1,
583 .minimum_version_id = 1,
1/*
2 * QEMU HID devices
3 *
4 * Copyright (c) 2005 Fabrice Bellard
5 * Copyright (c) 2007 OpenMoko, Inc. (andrew@openedhand.com)
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal

--- 567 unchanged lines hidden (view full) ---

576 }
577 return 0;
578}
579
580static const VMStateDescription vmstate_hid_ptr_queue = {
581 .name = "HIDPointerEventQueue",
582 .version_id = 1,
583 .minimum_version_id = 1,
584 .fields = (VMStateField[]) {
584 .fields = (const VMStateField[]) {
585 VMSTATE_INT32(xdx, HIDPointerEvent),
586 VMSTATE_INT32(ydy, HIDPointerEvent),
587 VMSTATE_INT32(dz, HIDPointerEvent),
588 VMSTATE_INT32(buttons_state, HIDPointerEvent),
589 VMSTATE_END_OF_LIST()
590 }
591};
592
593const VMStateDescription vmstate_hid_ptr_device = {
594 .name = "HIDPointerDevice",
595 .version_id = 1,
596 .minimum_version_id = 1,
597 .post_load = hid_post_load,
585 VMSTATE_INT32(xdx, HIDPointerEvent),
586 VMSTATE_INT32(ydy, HIDPointerEvent),
587 VMSTATE_INT32(dz, HIDPointerEvent),
588 VMSTATE_INT32(buttons_state, HIDPointerEvent),
589 VMSTATE_END_OF_LIST()
590 }
591};
592
593const VMStateDescription vmstate_hid_ptr_device = {
594 .name = "HIDPointerDevice",
595 .version_id = 1,
596 .minimum_version_id = 1,
597 .post_load = hid_post_load,
598 .fields = (VMStateField[]) {
598 .fields = (const VMStateField[]) {
599 VMSTATE_STRUCT_ARRAY(ptr.queue, HIDState, QUEUE_LENGTH, 0,
600 vmstate_hid_ptr_queue, HIDPointerEvent),
601 VMSTATE_UINT32(head, HIDState),
602 VMSTATE_UINT32(n, HIDState),
603 VMSTATE_INT32(protocol, HIDState),
604 VMSTATE_UINT8(idle, HIDState),
605 VMSTATE_END_OF_LIST(),
606 }
607};
608
609const VMStateDescription vmstate_hid_keyboard_device = {
610 .name = "HIDKeyboardDevice",
611 .version_id = 1,
612 .minimum_version_id = 1,
613 .post_load = hid_post_load,
599 VMSTATE_STRUCT_ARRAY(ptr.queue, HIDState, QUEUE_LENGTH, 0,
600 vmstate_hid_ptr_queue, HIDPointerEvent),
601 VMSTATE_UINT32(head, HIDState),
602 VMSTATE_UINT32(n, HIDState),
603 VMSTATE_INT32(protocol, HIDState),
604 VMSTATE_UINT8(idle, HIDState),
605 VMSTATE_END_OF_LIST(),
606 }
607};
608
609const VMStateDescription vmstate_hid_keyboard_device = {
610 .name = "HIDKeyboardDevice",
611 .version_id = 1,
612 .minimum_version_id = 1,
613 .post_load = hid_post_load,
614 .fields = (VMStateField[]) {
614 .fields = (const VMStateField[]) {
615 VMSTATE_UINT32_ARRAY(kbd.keycodes, HIDState, QUEUE_LENGTH),
616 VMSTATE_UINT32(head, HIDState),
617 VMSTATE_UINT32(n, HIDState),
618 VMSTATE_UINT16(kbd.modifiers, HIDState),
619 VMSTATE_UINT8(kbd.leds, HIDState),
620 VMSTATE_UINT8_ARRAY(kbd.key, HIDState, 16),
621 VMSTATE_INT32(kbd.keys, HIDState),
622 VMSTATE_INT32(protocol, HIDState),
623 VMSTATE_UINT8(idle, HIDState),
624 VMSTATE_END_OF_LIST(),
625 }
626};
615 VMSTATE_UINT32_ARRAY(kbd.keycodes, HIDState, QUEUE_LENGTH),
616 VMSTATE_UINT32(head, HIDState),
617 VMSTATE_UINT32(n, HIDState),
618 VMSTATE_UINT16(kbd.modifiers, HIDState),
619 VMSTATE_UINT8(kbd.leds, HIDState),
620 VMSTATE_UINT8_ARRAY(kbd.key, HIDState, 16),
621 VMSTATE_INT32(kbd.keys, HIDState),
622 VMSTATE_INT32(protocol, HIDState),
623 VMSTATE_UINT8(idle, HIDState),
624 VMSTATE_END_OF_LIST(),
625 }
626};