RTEMS: bsps/i386/pc386/include/rtems/keyboard.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
keyboard.h
Go to the documentation of this file.
1
9/*
10 * Submitted by: Rosimildo da Silva: rdasilva@connecttel.com
11 */
12
13#ifndef __RTEMS_KEYBOARD_H
14#define __RTEMS_KEYBOARD_H
15
16#include <rtems/kd.h>
17
18#define KG_SHIFT 0
19#define KG_CTRL 2
20#define KG_ALT 3
21#define KG_ALTGR 1
22#define KG_SHIFTL 4
23#define KG_SHIFTR 5
24#define KG_CTRLL 6
25#define KG_CTRLR 7
26#define KG_CAPSSHIFT 8
27
28#define NR_SHIFT 9
29
30#define NR_KEYS 128
31#define MAX_NR_KEYMAPS 256
32/* This means 64Kb if all keymaps are allocated. Only the superuser
33 may increase the number of keymaps beyond MAX_NR_OF_USER_KEYMAPS. */
34#define MAX_NR_OF_USER_KEYMAPS 256 /* should be at least 7 */
35
36extern const int NR_TYPES;
37extern unsigned short *key_maps[MAX_NR_KEYMAPS];
38extern unsigned short plain_map[NR_KEYS];
39extern unsigned char keyboard_type;
40
41#define MAX_NR_FUNC 256 /* max nr of strings assigned to keys */
42#define MAX_NR_CONSOLES 1
43
44extern char *func_table[MAX_NR_FUNC];
45
46#define KT_LATIN 0 /* we depend on this being zero */
47#define KT_LETTER 11 /* symbol that can be acted upon by CapsLock */
48#define KT_FN 1
49#define KT_SPEC 2
50#define KT_PAD 3
51#define KT_DEAD 4
52#define KT_CONS 5
53#define KT_CUR 6
54#define KT_SHIFT 7
55#define KT_META 8
56#define KT_ASCII 9
57#define KT_LOCK 10
58#define KT_SLOCK 12
59
60#define K(t,v) (((t)<<8)|(v))
61#define KTYP(x) ((x) >> 8)
62#define KVAL(x) ((x) & 0xff)
63
64#define K_F1 K(KT_FN,0)
65#define K_F2 K(KT_FN,1)
66#define K_F3 K(KT_FN,2)
67#define K_F4 K(KT_FN,3)
68#define K_F5 K(KT_FN,4)
69#define K_F6 K(KT_FN,5)
70#define K_F7 K(KT_FN,6)
71#define K_F8 K(KT_FN,7)
72#define K_F9 K(KT_FN,8)
73#define K_F10 K(KT_FN,9)
74#define K_F11 K(KT_FN,10)
75#define K_F12 K(KT_FN,11)
76#define K_F13 K(KT_FN,12)
77#define K_F14 K(KT_FN,13)
78#define K_F15 K(KT_FN,14)
79#define K_F16 K(KT_FN,15)
80#define K_F17 K(KT_FN,16)
81#define K_F18 K(KT_FN,17)
82#define K_F19 K(KT_FN,18)
83#define K_F20 K(KT_FN,19)
84#define K_FIND K(KT_FN,20)
85#define K_INSERT K(KT_FN,21)
86#define K_REMOVE K(KT_FN,22)
87#define K_SELECT K(KT_FN,23)
88#define K_PGUP K(KT_FN,24) /* PGUP is a synonym for PRIOR */
89#define K_PGDN K(KT_FN,25) /* PGDN is a synonym for NEXT */
90#define K_MACRO K(KT_FN,26)
91#define K_HELP K(KT_FN,27)
92#define K_DO K(KT_FN,28)
93#define K_PAUSE K(KT_FN,29)
94#define K_F21 K(KT_FN,30)
95#define K_F22 K(KT_FN,31)
96#define K_F23 K(KT_FN,32)
97#define K_F24 K(KT_FN,33)
98#define K_F25 K(KT_FN,34)
99#define K_F26 K(KT_FN,35)
100#define K_F27 K(KT_FN,36)
101#define K_F28 K(KT_FN,37)
102#define K_F29 K(KT_FN,38)
103#define K_F30 K(KT_FN,39)
104#define K_F31 K(KT_FN,40)
105#define K_F32 K(KT_FN,41)
106#define K_F33 K(KT_FN,42)
107#define K_F34 K(KT_FN,43)
108#define K_F35 K(KT_FN,44)
109#define K_F36 K(KT_FN,45)
110#define K_F37 K(KT_FN,46)
111#define K_F38 K(KT_FN,47)
112#define K_F39 K(KT_FN,48)
113#define K_F40 K(KT_FN,49)
114#define K_F41 K(KT_FN,50)
115#define K_F42 K(KT_FN,51)
116#define K_F43 K(KT_FN,52)
117#define K_F44 K(KT_FN,53)
118#define K_F45 K(KT_FN,54)
119#define K_F46 K(KT_FN,55)
120#define K_F47 K(KT_FN,56)
121#define K_F48 K(KT_FN,57)
122#define K_F49 K(KT_FN,58)
123#define K_F50 K(KT_FN,59)
124#define K_F51 K(KT_FN,60)
125#define K_F52 K(KT_FN,61)
126#define K_F53 K(KT_FN,62)
127#define K_F54 K(KT_FN,63)
128#define K_F55 K(KT_FN,64)
129#define K_F56 K(KT_FN,65)
130#define K_F57 K(KT_FN,66)
131#define K_F58 K(KT_FN,67)
132#define K_F59 K(KT_FN,68)
133#define K_F60 K(KT_FN,69)
134#define K_F61 K(KT_FN,70)
135#define K_F62 K(KT_FN,71)
136#define K_F63 K(KT_FN,72)
137#define K_F64 K(KT_FN,73)
138#define K_F65 K(KT_FN,74)
139#define K_F66 K(KT_FN,75)
140#define K_F67 K(KT_FN,76)
141#define K_F68 K(KT_FN,77)
142#define K_F69 K(KT_FN,78)
143#define K_F70 K(KT_FN,79)
144#define K_F71 K(KT_FN,80)
145#define K_F72 K(KT_FN,81)
146#define K_F73 K(KT_FN,82)
147#define K_F74 K(KT_FN,83)
148#define K_F75 K(KT_FN,84)
149#define K_F76 K(KT_FN,85)
150#define K_F77 K(KT_FN,86)
151#define K_F78 K(KT_FN,87)
152#define K_F79 K(KT_FN,88)
153#define K_F80 K(KT_FN,89)
154#define K_F81 K(KT_FN,90)
155#define K_F82 K(KT_FN,91)
156#define K_F83 K(KT_FN,92)
157#define K_F84 K(KT_FN,93)
158#define K_F85 K(KT_FN,94)
159#define K_F86 K(KT_FN,95)
160#define K_F87 K(KT_FN,96)
161#define K_F88 K(KT_FN,97)
162#define K_F89 K(KT_FN,98)
163#define K_F90 K(KT_FN,99)
164#define K_F91 K(KT_FN,100)
165#define K_F92 K(KT_FN,101)
166#define K_F93 K(KT_FN,102)
167#define K_F94 K(KT_FN,103)
168#define K_F95 K(KT_FN,104)
169#define K_F96 K(KT_FN,105)
170#define K_F97 K(KT_FN,106)
171#define K_F98 K(KT_FN,107)
172#define K_F99 K(KT_FN,108)
173#define K_F100 K(KT_FN,109)
174#define K_F101 K(KT_FN,110)
175#define K_F102 K(KT_FN,111)
176#define K_F103 K(KT_FN,112)
177#define K_F104 K(KT_FN,113)
178#define K_F105 K(KT_FN,114)
179#define K_F106 K(KT_FN,115)
180#define K_F107 K(KT_FN,116)
181#define K_F108 K(KT_FN,117)
182#define K_F109 K(KT_FN,118)
183#define K_F110 K(KT_FN,119)
184#define K_F111 K(KT_FN,120)
185#define K_F112 K(KT_FN,121)
186#define K_F113 K(KT_FN,122)
187#define K_F114 K(KT_FN,123)
188#define K_F115 K(KT_FN,124)
189#define K_F116 K(KT_FN,125)
190#define K_F117 K(KT_FN,126)
191#define K_F118 K(KT_FN,127)
192#define K_F119 K(KT_FN,128)
193#define K_F120 K(KT_FN,129)
194#define K_F121 K(KT_FN,130)
195#define K_F122 K(KT_FN,131)
196#define K_F123 K(KT_FN,132)
197#define K_F124 K(KT_FN,133)
198#define K_F125 K(KT_FN,134)
199#define K_F126 K(KT_FN,135)
200#define K_F127 K(KT_FN,136)
201#define K_F128 K(KT_FN,137)
202#define K_F129 K(KT_FN,138)
203#define K_F130 K(KT_FN,139)
204#define K_F131 K(KT_FN,140)
205#define K_F132 K(KT_FN,141)
206#define K_F133 K(KT_FN,142)
207#define K_F134 K(KT_FN,143)
208#define K_F135 K(KT_FN,144)
209#define K_F136 K(KT_FN,145)
210#define K_F137 K(KT_FN,146)
211#define K_F138 K(KT_FN,147)
212#define K_F139 K(KT_FN,148)
213#define K_F140 K(KT_FN,149)
214#define K_F141 K(KT_FN,150)
215#define K_F142 K(KT_FN,151)
216#define K_F143 K(KT_FN,152)
217#define K_F144 K(KT_FN,153)
218#define K_F145 K(KT_FN,154)
219#define K_F146 K(KT_FN,155)
220#define K_F147 K(KT_FN,156)
221#define K_F148 K(KT_FN,157)
222#define K_F149 K(KT_FN,158)
223#define K_F150 K(KT_FN,159)
224#define K_F151 K(KT_FN,160)
225#define K_F152 K(KT_FN,161)
226#define K_F153 K(KT_FN,162)
227#define K_F154 K(KT_FN,163)
228#define K_F155 K(KT_FN,164)
229#define K_F156 K(KT_FN,165)
230#define K_F157 K(KT_FN,166)
231#define K_F158 K(KT_FN,167)
232#define K_F159 K(KT_FN,168)
233#define K_F160 K(KT_FN,169)
234#define K_F161 K(KT_FN,170)
235#define K_F162 K(KT_FN,171)
236#define K_F163 K(KT_FN,172)
237#define K_F164 K(KT_FN,173)
238#define K_F165 K(KT_FN,174)
239#define K_F166 K(KT_FN,175)
240#define K_F167 K(KT_FN,176)
241#define K_F168 K(KT_FN,177)
242#define K_F169 K(KT_FN,178)
243#define K_F170 K(KT_FN,179)
244#define K_F171 K(KT_FN,180)
245#define K_F172 K(KT_FN,181)
246#define K_F173 K(KT_FN,182)
247#define K_F174 K(KT_FN,183)
248#define K_F175 K(KT_FN,184)
249#define K_F176 K(KT_FN,185)
250#define K_F177 K(KT_FN,186)
251#define K_F178 K(KT_FN,187)
252#define K_F179 K(KT_FN,188)
253#define K_F180 K(KT_FN,189)
254#define K_F181 K(KT_FN,190)
255#define K_F182 K(KT_FN,191)
256#define K_F183 K(KT_FN,192)
257#define K_F184 K(KT_FN,193)
258#define K_F185 K(KT_FN,194)
259#define K_F186 K(KT_FN,195)
260#define K_F187 K(KT_FN,196)
261#define K_F188 K(KT_FN,197)
262#define K_F189 K(KT_FN,198)
263#define K_F190 K(KT_FN,199)
264#define K_F191 K(KT_FN,200)
265#define K_F192 K(KT_FN,201)
266#define K_F193 K(KT_FN,202)
267#define K_F194 K(KT_FN,203)
268#define K_F195 K(KT_FN,204)
269#define K_F196 K(KT_FN,205)
270#define K_F197 K(KT_FN,206)
271#define K_F198 K(KT_FN,207)
272#define K_F199 K(KT_FN,208)
273#define K_F200 K(KT_FN,209)
274#define K_F201 K(KT_FN,210)
275#define K_F202 K(KT_FN,211)
276#define K_F203 K(KT_FN,212)
277#define K_F204 K(KT_FN,213)
278#define K_F205 K(KT_FN,214)
279#define K_F206 K(KT_FN,215)
280#define K_F207 K(KT_FN,216)
281#define K_F208 K(KT_FN,217)
282#define K_F209 K(KT_FN,218)
283#define K_F210 K(KT_FN,219)
284#define K_F211 K(KT_FN,220)
285#define K_F212 K(KT_FN,221)
286#define K_F213 K(KT_FN,222)
287#define K_F214 K(KT_FN,223)
288#define K_F215 K(KT_FN,224)
289#define K_F216 K(KT_FN,225)
290#define K_F217 K(KT_FN,226)
291#define K_F218 K(KT_FN,227)
292#define K_F219 K(KT_FN,228)
293#define K_F220 K(KT_FN,229)
294#define K_F221 K(KT_FN,230)
295#define K_F222 K(KT_FN,231)
296#define K_F223 K(KT_FN,232)
297#define K_F224 K(KT_FN,233)
298#define K_F225 K(KT_FN,234)
299#define K_F226 K(KT_FN,235)
300#define K_F227 K(KT_FN,236)
301#define K_F228 K(KT_FN,237)
302#define K_F229 K(KT_FN,238)
303#define K_F230 K(KT_FN,239)
304#define K_F231 K(KT_FN,240)
305#define K_F232 K(KT_FN,241)
306#define K_F233 K(KT_FN,242)
307#define K_F234 K(KT_FN,243)
308#define K_F235 K(KT_FN,244)
309#define K_F236 K(KT_FN,245)
310#define K_F237 K(KT_FN,246)
311#define K_F238 K(KT_FN,247)
312#define K_F239 K(KT_FN,248)
313#define K_F240 K(KT_FN,249)
314#define K_F241 K(KT_FN,250)
315#define K_F242 K(KT_FN,251)
316#define K_F243 K(KT_FN,252)
317#define K_F244 K(KT_FN,253)
318#define K_F245 K(KT_FN,254)
319#define K_UNDO K(KT_FN,255)
320
321#define K_HOLE K(KT_SPEC,0)
322#define K_ENTER K(KT_SPEC,1)
323#define K_SH_REGS K(KT_SPEC,2)
324#define K_SH_MEM K(KT_SPEC,3)
325#define K_SH_STAT K(KT_SPEC,4)
326#define K_BREAK K(KT_SPEC,5)
327#define K_CONS K(KT_SPEC,6)
328#define K_CAPS K(KT_SPEC,7)
329#define K_NUM K(KT_SPEC,8)
330#define K_HOLD K(KT_SPEC,9)
331#define K_SCROLLFORW K(KT_SPEC,10)
332#define K_SCROLLBACK K(KT_SPEC,11)
333#define K_BOOT K(KT_SPEC,12)
334#define K_CAPSON K(KT_SPEC,13)
335#define K_COMPOSE K(KT_SPEC,14)
336#define K_SAK K(KT_SPEC,15)
337#define K_DECRCONSOLE K(KT_SPEC,16)
338#define K_INCRCONSOLE K(KT_SPEC,17)
339#define K_SPAWNCONSOLE K(KT_SPEC,18)
340#define K_BARENUMLOCK K(KT_SPEC,19)
341
342#define K_ALLOCATED K(KT_SPEC,126) /* dynamically allocated keymap */
343#define K_NOSUCHMAP K(KT_SPEC,127) /* returned by KDGKBENT */
344
345#define K_P0 K(KT_PAD,0)
346#define K_P1 K(KT_PAD,1)
347#define K_P2 K(KT_PAD,2)
348#define K_P3 K(KT_PAD,3)
349#define K_P4 K(KT_PAD,4)
350#define K_P5 K(KT_PAD,5)
351#define K_P6 K(KT_PAD,6)
352#define K_P7 K(KT_PAD,7)
353#define K_P8 K(KT_PAD,8)
354#define K_P9 K(KT_PAD,9)
355#define K_PPLUS K(KT_PAD,10) /* key-pad plus */
356#define K_PMINUS K(KT_PAD,11) /* key-pad minus */
357#define K_PSTAR K(KT_PAD,12) /* key-pad asterisk (star) */
358#define K_PSLASH K(KT_PAD,13) /* key-pad slash */
359#define K_PENTER K(KT_PAD,14) /* key-pad enter */
360#define K_PCOMMA K(KT_PAD,15) /* key-pad comma: kludge... */
361#define K_PDOT K(KT_PAD,16) /* key-pad dot (period): kludge... */
362#define K_PPLUSMINUS K(KT_PAD,17) /* key-pad plus/minus */
363#define K_PPARENL K(KT_PAD,18) /* key-pad left parenthesis */
364#define K_PPARENR K(KT_PAD,19) /* key-pad right parenthesis */
365
366#define NR_PAD 20
367
368#define K_DGRAVE K(KT_DEAD,0)
369#define K_DACUTE K(KT_DEAD,1)
370#define K_DCIRCM K(KT_DEAD,2)
371#define K_DTILDE K(KT_DEAD,3)
372#define K_DDIERE K(KT_DEAD,4)
373#define K_DCEDIL K(KT_DEAD,5)
374
375#define NR_DEAD 6
376
377#define K_DOWN K(KT_CUR,0)
378#define K_LEFT K(KT_CUR,1)
379#define K_RIGHT K(KT_CUR,2)
380#define K_UP K(KT_CUR,3)
381
382#define K_SHIFT K(KT_SHIFT,KG_SHIFT)
383#define K_CTRL K(KT_SHIFT,KG_CTRL)
384#define K_ALT K(KT_SHIFT,KG_ALT)
385#define K_ALTGR K(KT_SHIFT,KG_ALTGR)
386#define K_SHIFTL K(KT_SHIFT,KG_SHIFTL)
387#define K_SHIFTR K(KT_SHIFT,KG_SHIFTR)
388#define K_CTRLL K(KT_SHIFT,KG_CTRLL)
389#define K_CTRLR K(KT_SHIFT,KG_CTRLR)
390#define K_CAPSSHIFT K(KT_SHIFT,KG_CAPSSHIFT)
391
392#define K_ASC0 K(KT_ASCII,0)
393#define K_ASC1 K(KT_ASCII,1)
394#define K_ASC2 K(KT_ASCII,2)
395#define K_ASC3 K(KT_ASCII,3)
396#define K_ASC4 K(KT_ASCII,4)
397#define K_ASC5 K(KT_ASCII,5)
398#define K_ASC6 K(KT_ASCII,6)
399#define K_ASC7 K(KT_ASCII,7)
400#define K_ASC8 K(KT_ASCII,8)
401#define K_ASC9 K(KT_ASCII,9)
402#define K_HEX0 K(KT_ASCII,10)
403#define K_HEX1 K(KT_ASCII,11)
404#define K_HEX2 K(KT_ASCII,12)
405#define K_HEX3 K(KT_ASCII,13)
406#define K_HEX4 K(KT_ASCII,14)
407#define K_HEX5 K(KT_ASCII,15)
408#define K_HEX6 K(KT_ASCII,16)
409#define K_HEX7 K(KT_ASCII,17)
410#define K_HEX8 K(KT_ASCII,18)
411#define K_HEX9 K(KT_ASCII,19)
412#define K_HEXa K(KT_ASCII,20)
413#define K_HEXb K(KT_ASCII,21)
414#define K_HEXc K(KT_ASCII,22)
415#define K_HEXd K(KT_ASCII,23)
416#define K_HEXe K(KT_ASCII,24)
417#define K_HEXf K(KT_ASCII,25)
418
419#define NR_ASCII 26
420
421#define K_SHIFTLOCK K(KT_LOCK,KG_SHIFT)
422#define K_CTRLLOCK K(KT_LOCK,KG_CTRL)
423#define K_ALTLOCK K(KT_LOCK,KG_ALT)
424#define K_ALTGRLOCK K(KT_LOCK,KG_ALTGR)
425#define K_SHIFTLLOCK K(KT_LOCK,KG_SHIFTL)
426#define K_SHIFTRLOCK K(KT_LOCK,KG_SHIFTR)
427#define K_CTRLLLOCK K(KT_LOCK,KG_CTRLL)
428#define K_CTRLRLOCK K(KT_LOCK,KG_CTRLR)
429
430#define K_SHIFT_SLOCK K(KT_SLOCK,KG_SHIFT)
431#define K_CTRL_SLOCK K(KT_SLOCK,KG_CTRL)
432#define K_ALT_SLOCK K(KT_SLOCK,KG_ALT)
433#define K_ALTGR_SLOCK K(KT_SLOCK,KG_ALTGR)
434#define K_SHIFTL_SLOCK K(KT_SLOCK,KG_SHIFTL)
435#define K_SHIFTR_SLOCK K(KT_SLOCK,KG_SHIFTR)
436#define K_CTRLL_SLOCK K(KT_SLOCK,KG_CTRLL)
437#define K_CTRLR_SLOCK K(KT_SLOCK,KG_CTRLR)
438
439#define NR_LOCK 8
440
441#define MAX_DIACR 256
442
443extern struct kbdiacr accent_table[MAX_DIACR];
444extern unsigned int accent_table_size;
445
446/* kbd_kern.h --- header file from linux --- */
447extern int shift_state;
448
449extern char *func_table[MAX_NR_FUNC];
450extern char func_buf[];
451extern char *funcbufptr;
452extern int funcbufsize, funcbufleft;
453
454/*
455 * kbd->xxx contains the VC-local things (flag settings etc..)
456 *
457 * Note: externally visible are LED_SCR, LED_NUM, LED_CAP defined in kd.h
458 * The code in KDGETLED / KDSETLED depends on the internal and
459 * external order being the same.
460 *
461 * Note: lockstate is used as index in the array key_map.
462 */
463 struct kbd_struct {
464
465 unsigned char lockstate;
466/* 8 modifiers - the names do not have any meaning at all;
467 they can be associated to arbitrarily chosen keys */
468#define VC_SHIFTLOCK KG_SHIFT /* shift lock mode */
469#define VC_ALTGRLOCK KG_ALTGR /* altgr lock mode */
470#define VC_CTRLLOCK KG_CTRL /* control lock mode */
471#define VC_ALTLOCK KG_ALT /* alt lock mode */
472#define VC_SHIFTLLOCK KG_SHIFTL /* shiftl lock mode */
473#define VC_SHIFTRLOCK KG_SHIFTR /* shiftr lock mode */
474#define VC_CTRLLLOCK KG_CTRLL /* ctrll lock mode */
475#define VC_CTRLRLOCK KG_CTRLR /* ctrlr lock mode */
476 unsigned char slockstate; /* for `sticky' Shift, Ctrl, etc. */
477
478 unsigned char ledmode:2; /* one 2-bit value */
479#define LED_SHOW_FLAGS 0 /* traditional state */
480#define LED_SHOW_IOCTL 1 /* only change leds upon ioctl */
481#define LED_SHOW_MEM 2 /* `heartbeat': peek into memory */
482
483 unsigned char ledflagstate:3; /* flags, not lights */
484 unsigned char default_ledflagstate:3;
485#define VC_SCROLLOCK 0 /* scroll-lock mode */
486#define VC_NUMLOCK 1 /* numeric lock mode */
487#define VC_CAPSLOCK 2 /* capslock mode */
488
489 unsigned char kbdmode:2; /* one 2-bit value */
490#define VC_XLATE 0 /* translate keycodes using keymap */
491#define VC_MEDIUMRAW 1 /* medium raw (keycode) mode */
492#define VC_RAW 2 /* raw (scancode) mode */
493#define VC_UNICODE 3 /* Unicode mode */
494
495 unsigned char modeflags:5;
496#define VC_APPLIC 0 /* application key mode */
497#define VC_CKMODE 1 /* cursor key mode */
498#define VC_REPEAT 2 /* keyboard repeat */
499#define VC_CRLF 3 /* 0 - enter sends CR, 1 - enter sends CRLF */
500#define VC_META 4 /* 0 - meta, 1 - meta=prefix with ESC */
501};
502
503extern struct kbd_struct kbd_table[];
504
505
506void kbd_set_driver_handler(
507 void ( *handler )( void *, unsigned short, unsigned long )
508);
509
510static inline void show_console(void)
511{
512}
513
514static inline void set_console(int nr)
515{
516}
517
518void set_leds(void);
519
520static inline int vc_kbd_mode(struct kbd_struct * kbd, int flag)
521{
522 return ((kbd->modeflags >> flag) & 1);
523}
524
525static inline int vc_kbd_led(struct kbd_struct * kbd, int flag)
526{
527 return ((kbd->ledflagstate >> flag) & 1);
528}
529
530static inline void set_vc_kbd_mode(struct kbd_struct * kbd, int flag)
531{
532 kbd->modeflags |= 1 << flag;
533}
534
535static inline void set_vc_kbd_led(struct kbd_struct * kbd, int flag)
536{
537 kbd->ledflagstate |= 1 << flag;
538}
539
540static inline void clr_vc_kbd_mode(struct kbd_struct * kbd, int flag)
541{
542 kbd->modeflags &= ~(1 << flag);
543}
544
545static inline void clr_vc_kbd_led(struct kbd_struct * kbd, int flag)
546{
547 kbd->ledflagstate &= ~(1 << flag);
548}
549
550static inline void chg_vc_kbd_lock(struct kbd_struct * kbd, int flag)
551{
552 kbd->lockstate ^= 1 << flag;
553}
554
555static inline void chg_vc_kbd_slock(struct kbd_struct * kbd, int flag)
556{
557 kbd->slockstate ^= 1 << flag;
558}
559
560static inline void chg_vc_kbd_mode(struct kbd_struct * kbd, int flag)
561{
562 kbd->modeflags ^= 1 << flag;
563}
564
565static inline void chg_vc_kbd_led(struct kbd_struct * kbd, int flag)
566{
567 kbd->ledflagstate ^= 1 << flag;
568 set_leds();
569}
570
571#define U(x) ((x) ^ 0xf000)
572
573/* keyboard.c */
574int kbd_init(void);
575int getkeycode(unsigned int scancode);
576int setkeycode(unsigned int scancode, unsigned int keycode);
577void compute_shiftstate(void);
578unsigned char getledstate(void);
579void setledstate(struct kbd_struct *kbd, unsigned int led);
580void handle_scancode(unsigned char scancode, int down);
581
582/* kbd_parser.c */
583void register_kbd_msg_queue( char *qname, int port );
584void unregister_kbd_msg_queue( int port );
585
586/* defkeymap.c */
587extern unsigned int keymap_count;
588
589/* inch.c */
590void add_to_queue( unsigned short );
591int getch( void );
592int BSP_wait_polled_input(void);
593int rtems_kbpoll( void );
594
595/* outch.c */
596void _IBMPC_initVideo(void);
597
598/* pc_keyb.c */
599void keyboard_interrupt(void *unused);
600
601/* vt.c */
602int vt_ioctl( unsigned int cmd, unsigned long arg);
603
604#endif
kd.h
KD definitions.
kbd_struct
Definition: keyboard.h:463
kbdiacr
Definition: kd.h:78