~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/xen/interface/io/kbdif.h

Version: ~ [ linux-5.12-rc1 ] ~ [ linux-5.11.2 ] ~ [ linux-5.10.19 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.101 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.177 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.222 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.258 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.258 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  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  */
 25 
 26 #ifndef __XEN_PUBLIC_IO_KBDIF_H__
 27 #define __XEN_PUBLIC_IO_KBDIF_H__
 28 
 29 /* In events (backend -> frontend) */
 30 
 31 /*
 32  * Frontends should ignore unknown in events.
 33  */
 34 
 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
 47 
 48 struct xenkbd_motion {
 49         uint8_t type;           /* XENKBD_TYPE_MOTION */
 50         int32_t rel_x;          /* relative X motion */
 51         int32_t rel_y;          /* relative Y motion */
 52         int32_t rel_z;          /* relative Z motion (wheel) */
 53 };
 54 
 55 struct xenkbd_key {
 56         uint8_t type;           /* XENKBD_TYPE_KEY */
 57         uint8_t pressed;        /* 1 if pressed; 0 otherwise */
 58         uint32_t keycode;       /* KEY_* from linux/input.h */
 59 };
 60 
 61 struct xenkbd_position {
 62         uint8_t type;           /* XENKBD_TYPE_POS */
 63         int32_t abs_x;          /* absolute X position (in FB pixels) */
 64         int32_t abs_y;          /* absolute Y position (in FB pixels) */
 65         int32_t rel_z;          /* relative Z motion (wheel) */
 66 };
 67 
 68 #define XENKBD_IN_EVENT_SIZE 40
 69 
 70 union xenkbd_in_event {
 71         uint8_t type;
 72         struct xenkbd_motion motion;
 73         struct xenkbd_key key;
 74         struct xenkbd_position pos;
 75         char pad[XENKBD_IN_EVENT_SIZE];
 76 };
 77 
 78 /* Out events (frontend -> backend) */
 79 
 80 /*
 81  * Out events may be sent only when requested by backend, and receipt
 82  * of an unknown out event is an error.
 83  * No out events currently defined.
 84  */
 85 
 86 #define XENKBD_OUT_EVENT_SIZE 40
 87 
 88 union xenkbd_out_event {
 89         uint8_t type;
 90         char pad[XENKBD_OUT_EVENT_SIZE];
 91 };
 92 
 93 /* shared page */
 94 
 95 #define XENKBD_IN_RING_SIZE 2048
 96 #define XENKBD_IN_RING_LEN (XENKBD_IN_RING_SIZE / XENKBD_IN_EVENT_SIZE)
 97 #define XENKBD_IN_RING_OFFS 1024
 98 #define XENKBD_IN_RING(page) \
 99         ((union xenkbd_in_event *)((char *)(page) + XENKBD_IN_RING_OFFS))
100 #define XENKBD_IN_RING_REF(page, idx) \
101         (XENKBD_IN_RING((page))[(idx) % XENKBD_IN_RING_LEN])
102 
103 #define XENKBD_OUT_RING_SIZE 1024
104 #define XENKBD_OUT_RING_LEN (XENKBD_OUT_RING_SIZE / XENKBD_OUT_EVENT_SIZE)
105 #define XENKBD_OUT_RING_OFFS (XENKBD_IN_RING_OFFS + XENKBD_IN_RING_SIZE)
106 #define XENKBD_OUT_RING(page) \
107         ((union xenkbd_out_event *)((char *)(page) + XENKBD_OUT_RING_OFFS))
108 #define XENKBD_OUT_RING_REF(page, idx) \
109         (XENKBD_OUT_RING((page))[(idx) % XENKBD_OUT_RING_LEN])
110 
111 struct xenkbd_page {
112         uint32_t in_cons, in_prod;
113         uint32_t out_cons, out_prod;
114 };
115 
116 #endif
117 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp