Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / include / uapi / linux / kd.h
blob6b384065c01356efbe8db490fd3f85c9cebbe6d3
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef _UAPI_LINUX_KD_H
3 #define _UAPI_LINUX_KD_H
4 #include <linux/types.h>
5 #include <linux/compiler.h>
7 /* 0x4B is 'K', to avoid collision with termios and vt */
9 #define GIO_FONT 0x4B60 /* gets font in expanded form */
10 #define PIO_FONT 0x4B61 /* use font in expanded form */
12 #define GIO_FONTX 0x4B6B /* get font using struct consolefontdesc */
13 #define PIO_FONTX 0x4B6C /* set font using struct consolefontdesc */
14 struct consolefontdesc {
15 unsigned short charcount; /* characters in font (256 or 512) */
16 unsigned short charheight; /* scan lines per character (1-32) */
17 char __user *chardata; /* font data in expanded form */
20 #define PIO_FONTRESET 0x4B6D /* reset to default font */
22 #define GIO_CMAP 0x4B70 /* gets colour palette on VGA+ */
23 #define PIO_CMAP 0x4B71 /* sets colour palette on VGA+ */
25 #define KIOCSOUND 0x4B2F /* start sound generation (0 for off) */
26 #define KDMKTONE 0x4B30 /* generate tone */
28 #define KDGETLED 0x4B31 /* return current led state */
29 #define KDSETLED 0x4B32 /* set led state [lights, not flags] */
30 #define LED_SCR 0x01 /* scroll lock led */
31 #define LED_NUM 0x02 /* num lock led */
32 #define LED_CAP 0x04 /* caps lock led */
34 #define KDGKBTYPE 0x4B33 /* get keyboard type */
35 #define KB_84 0x01
36 #define KB_101 0x02 /* this is what we always answer */
37 #define KB_OTHER 0x03
39 #define KDADDIO 0x4B34 /* add i/o port as valid */
40 #define KDDELIO 0x4B35 /* del i/o port as valid */
41 #define KDENABIO 0x4B36 /* enable i/o to video board */
42 #define KDDISABIO 0x4B37 /* disable i/o to video board */
44 #define KDSETMODE 0x4B3A /* set text/graphics mode */
45 #define KD_TEXT 0x00
46 #define KD_GRAPHICS 0x01
47 #define KD_TEXT0 0x02 /* obsolete */
48 #define KD_TEXT1 0x03 /* obsolete */
49 #define KDGETMODE 0x4B3B /* get current mode */
51 #define KDMAPDISP 0x4B3C /* map display into address space */
52 #define KDUNMAPDISP 0x4B3D /* unmap display from address space */
54 typedef char scrnmap_t;
55 #define E_TABSZ 256
56 #define GIO_SCRNMAP 0x4B40 /* get screen mapping from kernel */
57 #define PIO_SCRNMAP 0x4B41 /* put screen mapping table in kernel */
58 #define GIO_UNISCRNMAP 0x4B69 /* get full Unicode screen mapping */
59 #define PIO_UNISCRNMAP 0x4B6A /* set full Unicode screen mapping */
61 #define GIO_UNIMAP 0x4B66 /* get unicode-to-font mapping from kernel */
62 struct unipair {
63 unsigned short unicode;
64 unsigned short fontpos;
66 struct unimapdesc {
67 unsigned short entry_ct;
68 struct unipair __user *entries;
70 #define PIO_UNIMAP 0x4B67 /* put unicode-to-font mapping in kernel */
71 #define PIO_UNIMAPCLR 0x4B68 /* clear table, possibly advise hash algorithm */
72 struct unimapinit {
73 unsigned short advised_hashsize; /* 0 if no opinion */
74 unsigned short advised_hashstep; /* 0 if no opinion */
75 unsigned short advised_hashlevel; /* 0 if no opinion */
78 #define UNI_DIRECT_BASE 0xF000 /* start of Direct Font Region */
79 #define UNI_DIRECT_MASK 0x01FF /* Direct Font Region bitmask */
81 #define K_RAW 0x00
82 #define K_XLATE 0x01
83 #define K_MEDIUMRAW 0x02
84 #define K_UNICODE 0x03
85 #define K_OFF 0x04
86 #define KDGKBMODE 0x4B44 /* gets current keyboard mode */
87 #define KDSKBMODE 0x4B45 /* sets current keyboard mode */
89 #define K_METABIT 0x03
90 #define K_ESCPREFIX 0x04
91 #define KDGKBMETA 0x4B62 /* gets meta key handling mode */
92 #define KDSKBMETA 0x4B63 /* sets meta key handling mode */
94 #define K_SCROLLLOCK 0x01
95 #define K_NUMLOCK 0x02
96 #define K_CAPSLOCK 0x04
97 #define KDGKBLED 0x4B64 /* get led flags (not lights) */
98 #define KDSKBLED 0x4B65 /* set led flags (not lights) */
100 struct kbentry {
101 unsigned char kb_table;
102 unsigned char kb_index;
103 unsigned short kb_value;
105 #define K_NORMTAB 0x00
106 #define K_SHIFTTAB 0x01
107 #define K_ALTTAB 0x02
108 #define K_ALTSHIFTTAB 0x03
110 #define KDGKBENT 0x4B46 /* gets one entry in translation table */
111 #define KDSKBENT 0x4B47 /* sets one entry in translation table */
113 struct kbsentry {
114 unsigned char kb_func;
115 unsigned char kb_string[512];
117 #define KDGKBSENT 0x4B48 /* gets one function key string entry */
118 #define KDSKBSENT 0x4B49 /* sets one function key string entry */
120 struct kbdiacr {
121 unsigned char diacr, base, result;
123 struct kbdiacrs {
124 unsigned int kb_cnt; /* number of entries in following array */
125 struct kbdiacr kbdiacr[256]; /* MAX_DIACR from keyboard.h */
127 #define KDGKBDIACR 0x4B4A /* read kernel accent table */
128 #define KDSKBDIACR 0x4B4B /* write kernel accent table */
130 struct kbdiacruc {
131 unsigned int diacr, base, result;
133 struct kbdiacrsuc {
134 unsigned int kb_cnt; /* number of entries in following array */
135 struct kbdiacruc kbdiacruc[256]; /* MAX_DIACR from keyboard.h */
137 #define KDGKBDIACRUC 0x4BFA /* read kernel accent table - UCS */
138 #define KDSKBDIACRUC 0x4BFB /* write kernel accent table - UCS */
140 struct kbkeycode {
141 unsigned int scancode, keycode;
143 #define KDGETKEYCODE 0x4B4C /* read kernel keycode table entry */
144 #define KDSETKEYCODE 0x4B4D /* write kernel keycode table entry */
146 #define KDSIGACCEPT 0x4B4E /* accept kbd generated signals */
148 struct kbd_repeat {
149 int delay; /* in msec; <= 0: don't change */
150 int period; /* in msec; <= 0: don't change */
151 /* earlier this field was misnamed "rate" */
154 #define KDKBDREP 0x4B52 /* set keyboard delay/repeat rate;
155 * actually used values are returned */
157 #define KDFONTOP 0x4B72 /* font operations */
159 struct console_font_op {
160 unsigned int op; /* operation code KD_FONT_OP_* */
161 unsigned int flags; /* KD_FONT_FLAG_* */
162 unsigned int width, height; /* font size */
163 unsigned int charcount;
164 unsigned char __user *data; /* font data with vpitch fixed to 32 for
165 * KD_FONT_OP_SET/GET
169 struct console_font {
170 unsigned int width, height; /* font size */
171 unsigned int charcount;
172 unsigned char *data; /* font data with vpitch fixed to 32 for
173 * KD_FONT_OP_SET/GET
177 #define KD_FONT_OP_SET 0 /* Set font */
178 #define KD_FONT_OP_GET 1 /* Get font */
179 #define KD_FONT_OP_SET_DEFAULT 2 /* Set font to default, data points to name / NULL */
180 #define KD_FONT_OP_COPY 3 /* Obsolete, do not use */
181 #define KD_FONT_OP_SET_TALL 4 /* Set font with vpitch = height */
182 #define KD_FONT_OP_GET_TALL 5 /* Get font with vpitch = height */
184 #define KD_FONT_FLAG_DONT_RECALC 1 /* Don't recalculate hw charcell size [compat] */
186 /* note: 0x4B00-0x4B4E all have had a value at some time;
187 don't reuse for the time being */
188 /* note: 0x4B60-0x4B6D, 0x4B70-0x4B72 used above */
190 #endif /* _UAPI_LINUX_KD_H */