Subversion Repositories HelenOS

Rev

Rev 1787 | Rev 1841 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1787 Rev 1838
Line 74... Line 74...
74
 
74
 
75
#define i8042_BUFFER_FULL_MASK  0x01
75
#define i8042_BUFFER_FULL_MASK  0x01
76
#define i8042_WAIT_MASK     0x02
76
#define i8042_WAIT_MASK     0x02
77
#define i8042_MOUSE_DATA        0x20
77
#define i8042_MOUSE_DATA        0x20
78
 
78
 
79
#define SPECIAL     '?'
-
 
80
#define KEY_RELEASE 0x80
79
#define KEY_RELEASE 0x80
81
 
80
 
82
/**
81
/**
83
 * These codes read from i8042 data register are silently ignored.
82
 * These codes read from i8042 data register are silently ignored.
84
 */
83
 */
Line 108... Line 107...
108
    .suspend = i8042_suspend,
107
    .suspend = i8042_suspend,
109
    .resume = i8042_resume,
108
    .resume = i8042_resume,
110
    .read = key_read
109
    .read = key_read
111
};
110
};
112
 
111
 
113
/** Primary meaning of scancodes. */
-
 
114
static char sc_primary_map[] = {
-
 
115
    SPECIAL, /* 0x00 */
-
 
116
    SPECIAL, /* 0x01 - Esc */
-
 
117
    '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=',
-
 
118
    '\b', /* 0x0e - Backspace */
-
 
119
    '\t', 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n',
-
 
120
    SPECIAL, /* 0x1d - LCtrl */
-
 
121
    'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'',
-
 
122
    '`',
-
 
123
    SPECIAL, /* 0x2a - LShift */
-
 
124
    '\\',
-
 
125
    'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/',
-
 
126
    SPECIAL, /* 0x36 - RShift */
-
 
127
    '*',
-
 
128
    SPECIAL, /* 0x38 - LAlt */
-
 
129
    ' ',
-
 
130
    SPECIAL, /* 0x3a - CapsLock */
-
 
131
    SPECIAL, /* 0x3b - F1 */
-
 
132
    SPECIAL, /* 0x3c - F2 */
-
 
133
    SPECIAL, /* 0x3d - F3 */
-
 
134
    SPECIAL, /* 0x3e - F4 */
-
 
135
    SPECIAL, /* 0x3f - F5 */
-
 
136
    SPECIAL, /* 0x40 - F6 */
-
 
137
    SPECIAL, /* 0x41 - F7 */
-
 
138
    SPECIAL, /* 0x42 - F8 */
-
 
139
    SPECIAL, /* 0x43 - F9 */
-
 
140
    SPECIAL, /* 0x44 - F10 */
-
 
141
    SPECIAL, /* 0x45 - NumLock */
-
 
142
    SPECIAL, /* 0x46 - ScrollLock */
-
 
143
    '7', '8', '9', '-',
-
 
144
    '4', '5', '6', '+',
-
 
145
    '1', '2', '3',
-
 
146
    '0', '.',
-
 
147
    SPECIAL, /* 0x54 - Alt-SysRq */
-
 
148
    SPECIAL, /* 0x55 - F11/F12/PF1/FN */
-
 
149
    SPECIAL, /* 0x56 - unlabelled key next to LAlt */
-
 
150
    SPECIAL, /* 0x57 - F11 */
-
 
151
    SPECIAL, /* 0x58 - F12 */
-
 
152
    SPECIAL, /* 0x59 */
-
 
153
    SPECIAL, /* 0x5a */
-
 
154
    SPECIAL, /* 0x5b */
-
 
155
    SPECIAL, /* 0x5c */
-
 
156
    SPECIAL, /* 0x5d */
-
 
157
    SPECIAL, /* 0x5e */
-
 
158
    SPECIAL, /* 0x5f */
-
 
159
    SPECIAL, /* 0x60 */
-
 
160
    SPECIAL, /* 0x61 */
-
 
161
    SPECIAL, /* 0x62 */
-
 
162
    SPECIAL, /* 0x63 */
-
 
163
    SPECIAL, /* 0x64 */
-
 
164
    SPECIAL, /* 0x65 */
-
 
165
    SPECIAL, /* 0x66 */
-
 
166
    SPECIAL, /* 0x67 */
-
 
167
    SPECIAL, /* 0x68 */
-
 
168
    SPECIAL, /* 0x69 */
-
 
169
    SPECIAL, /* 0x6a */
-
 
170
    SPECIAL, /* 0x6b */
-
 
171
    SPECIAL, /* 0x6c */
-
 
172
    SPECIAL, /* 0x6d */
-
 
173
    SPECIAL, /* 0x6e */
-
 
174
    SPECIAL, /* 0x6f */
-
 
175
    SPECIAL, /* 0x70 */
-
 
176
    SPECIAL, /* 0x71 */
-
 
177
    SPECIAL, /* 0x72 */
-
 
178
    SPECIAL, /* 0x73 */
-
 
179
    SPECIAL, /* 0x74 */
-
 
180
    SPECIAL, /* 0x75 */
-
 
181
    SPECIAL, /* 0x76 */
-
 
182
    SPECIAL, /* 0x77 */
-
 
183
    SPECIAL, /* 0x78 */
-
 
184
    SPECIAL, /* 0x79 */
-
 
185
    SPECIAL, /* 0x7a */
-
 
186
    SPECIAL, /* 0x7b */
-
 
187
    SPECIAL, /* 0x7c */
-
 
188
    SPECIAL, /* 0x7d */
-
 
189
    SPECIAL, /* 0x7e */
-
 
190
    SPECIAL, /* 0x7f */
-
 
191
};
-
 
192
 
-
 
193
/** Secondary meaning of scancodes. */
-
 
194
static char sc_secondary_map[] = {
-
 
195
    SPECIAL, /* 0x00 */
-
 
196
    SPECIAL, /* 0x01 - Esc */
-
 
197
    '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+',
-
 
198
    SPECIAL, /* 0x0e - Backspace */
-
 
199
    '\t', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '\n',
-
 
200
    SPECIAL, /* 0x1d - LCtrl */
-
 
201
    'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"',
-
 
202
    '~',
-
 
203
    SPECIAL, /* 0x2a - LShift */
-
 
204
    '|',
-
 
205
    'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?',
-
 
206
    SPECIAL, /* 0x36 - RShift */
-
 
207
    '*',
-
 
208
    SPECIAL, /* 0x38 - LAlt */
-
 
209
    ' ',
-
 
210
    SPECIAL, /* 0x3a - CapsLock */
-
 
211
    SPECIAL, /* 0x3b - F1 */
-
 
212
    SPECIAL, /* 0x3c - F2 */
-
 
213
    SPECIAL, /* 0x3d - F3 */
-
 
214
    SPECIAL, /* 0x3e - F4 */
-
 
215
    SPECIAL, /* 0x3f - F5 */
-
 
216
    SPECIAL, /* 0x40 - F6 */
-
 
217
    SPECIAL, /* 0x41 - F7 */
-
 
218
    SPECIAL, /* 0x42 - F8 */
-
 
219
    SPECIAL, /* 0x43 - F9 */
-
 
220
    SPECIAL, /* 0x44 - F10 */
-
 
221
    SPECIAL, /* 0x45 - NumLock */
-
 
222
    SPECIAL, /* 0x46 - ScrollLock */
-
 
223
    '7', '8', '9', '-',
-
 
224
    '4', '5', '6', '+',
-
 
225
    '1', '2', '3',
-
 
226
    '0', '.',
-
 
227
    SPECIAL, /* 0x54 - Alt-SysRq */
-
 
228
    SPECIAL, /* 0x55 - F11/F12/PF1/FN */
-
 
229
    SPECIAL, /* 0x56 - unlabelled key next to LAlt */
-
 
230
    SPECIAL, /* 0x57 - F11 */
-
 
231
    SPECIAL, /* 0x58 - F12 */
-
 
232
    SPECIAL, /* 0x59 */
-
 
233
    SPECIAL, /* 0x5a */
-
 
234
    SPECIAL, /* 0x5b */
-
 
235
    SPECIAL, /* 0x5c */
-
 
236
    SPECIAL, /* 0x5d */
-
 
237
    SPECIAL, /* 0x5e */
-
 
238
    SPECIAL, /* 0x5f */
-
 
239
    SPECIAL, /* 0x60 */
-
 
240
    SPECIAL, /* 0x61 */
-
 
241
    SPECIAL, /* 0x62 */
-
 
242
    SPECIAL, /* 0x63 */
-
 
243
    SPECIAL, /* 0x64 */
-
 
244
    SPECIAL, /* 0x65 */
-
 
245
    SPECIAL, /* 0x66 */
-
 
246
    SPECIAL, /* 0x67 */
-
 
247
    SPECIAL, /* 0x68 */
-
 
248
    SPECIAL, /* 0x69 */
-
 
249
    SPECIAL, /* 0x6a */
-
 
250
    SPECIAL, /* 0x6b */
-
 
251
    SPECIAL, /* 0x6c */
-
 
252
    SPECIAL, /* 0x6d */
-
 
253
    SPECIAL, /* 0x6e */
-
 
254
    SPECIAL, /* 0x6f */
-
 
255
    SPECIAL, /* 0x70 */
-
 
256
    SPECIAL, /* 0x71 */
-
 
257
    SPECIAL, /* 0x72 */
-
 
258
    SPECIAL, /* 0x73 */
-
 
259
    SPECIAL, /* 0x74 */
-
 
260
    SPECIAL, /* 0x75 */
-
 
261
    SPECIAL, /* 0x76 */
-
 
262
    SPECIAL, /* 0x77 */
-
 
263
    SPECIAL, /* 0x78 */
-
 
264
    SPECIAL, /* 0x79 */
-
 
265
    SPECIAL, /* 0x7a */
-
 
266
    SPECIAL, /* 0x7b */
-
 
267
    SPECIAL, /* 0x7c */
-
 
268
    SPECIAL, /* 0x7d */
-
 
269
    SPECIAL, /* 0x7e */
-
 
270
    SPECIAL, /* 0x7f */
-
 
271
};
-
 
272
 
-
 
273
static void i8042_interrupt(int n, istate_t *istate);
112
static void i8042_interrupt(int n, istate_t *istate);
274
static void i8042_wait(void);
113
static void i8042_wait(void);
275
 
114
 
276
static iroutine oldvector;
115
static iroutine oldvector;
277
/** Initialize keyboard and service interrupts using kernel routine */
116
/** Initialize keyboard and service interrupts using kernel routine */