win-pvdrivers

view common/include/public/io/kbdif.h @ 62:edd4a2ad5b44

Removed old inf files
author James Harper <james.harper@bendigoit.com.au>
date Wed Dec 19 10:22:50 2007 +1100 (2007-12-19)
parents 5712dede5a1b
children
line source
1 /*
2 * kbdif.h -- Xen virtual keyboard/mouse
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to
6 * deal in the Software without restriction, including without limitation the
7 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 * sell copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 *
22 * Copyright (C) 2005 Anthony Liguori <aliguori@us.ibm.com>
23 * Copyright (C) 2006 Red Hat, Inc., Markus Armbruster <armbru@redhat.com>
24 */
26 #ifndef __XEN_PUBLIC_IO_KBDIF_H__
27 #define __XEN_PUBLIC_IO_KBDIF_H__
29 /* In events (backend -> frontend) */
31 /*
32 * Frontends should ignore unknown in events.
33 */
35 /* Pointer movement event */
36 #define XENKBD_TYPE_MOTION 1
37 /* Event type 2 currently not used */
38 /* Key event (includes pointer buttons) */
39 #define XENKBD_TYPE_KEY 3
40 /*
41 * Pointer position event
42 * Capable backend sets feature-abs-pointer in xenstore.
43 * Frontend requests ot instead of XENKBD_TYPE_MOTION by setting
44 * request-abs-update in xenstore.
45 */
46 #define XENKBD_TYPE_POS 4
48 struct xenkbd_motion
49 {
50 uint8_t type; /* XENKBD_TYPE_MOTION */
51 int32_t rel_x; /* relative X motion */
52 int32_t rel_y; /* relative Y motion */
53 };
55 struct xenkbd_key
56 {
57 uint8_t type; /* XENKBD_TYPE_KEY */
58 uint8_t pressed; /* 1 if pressed; 0 otherwise */
59 uint32_t keycode; /* KEY_* from linux/input.h */
60 };
62 struct xenkbd_position
63 {
64 uint8_t type; /* XENKBD_TYPE_POS */
65 int32_t abs_x; /* absolute X position (in FB pixels) */
66 int32_t abs_y; /* absolute Y position (in FB pixels) */
67 };
69 #define XENKBD_IN_EVENT_SIZE 40
71 union xenkbd_in_event
72 {
73 uint8_t type;
74 struct xenkbd_motion motion;
75 struct xenkbd_key key;
76 struct xenkbd_position pos;
77 char pad[XENKBD_IN_EVENT_SIZE];
78 };
80 /* Out events (frontend -> backend) */
82 /*
83 * Out events may be sent only when requested by backend, and receipt
84 * of an unknown out event is an error.
85 * No out events currently defined.
86 */
88 #define XENKBD_OUT_EVENT_SIZE 40
90 union xenkbd_out_event
91 {
92 uint8_t type;
93 char pad[XENKBD_OUT_EVENT_SIZE];
94 };
96 /* shared page */
98 #define XENKBD_IN_RING_SIZE 2048
99 #define XENKBD_IN_RING_LEN (XENKBD_IN_RING_SIZE / XENKBD_IN_EVENT_SIZE)
100 #define XENKBD_IN_RING_OFFS 1024
101 #define XENKBD_IN_RING(page) \
102 ((union xenkbd_in_event *)((char *)(page) + XENKBD_IN_RING_OFFS))
103 #define XENKBD_IN_RING_REF(page, idx) \
104 (XENKBD_IN_RING((page))[(idx) % XENKBD_IN_RING_LEN])
106 #define XENKBD_OUT_RING_SIZE 1024
107 #define XENKBD_OUT_RING_LEN (XENKBD_OUT_RING_SIZE / XENKBD_OUT_EVENT_SIZE)
108 #define XENKBD_OUT_RING_OFFS (XENKBD_IN_RING_OFFS + XENKBD_IN_RING_SIZE)
109 #define XENKBD_OUT_RING(page) \
110 ((union xenkbd_out_event *)((char *)(page) + XENKBD_OUT_RING_OFFS))
111 #define XENKBD_OUT_RING_REF(page, idx) \
112 (XENKBD_OUT_RING((page))[(idx) % XENKBD_OUT_RING_LEN])
114 struct xenkbd_page
115 {
116 uint32_t in_cons, in_prod;
117 uint32_t out_cons, out_prod;
118 };
120 #endif
122 /*
123 * Local variables:
124 * mode: C
125 * c-set-style: "BSD"
126 * c-basic-offset: 4
127 * tab-width: 4
128 * indent-tabs-mode: nil
129 * End:
130 */