Rev 3957 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3957 | Rev 4123 | ||
---|---|---|---|
Line 202... | Line 202... | ||
202 | 202 | ||
203 | cuda[B] = cuda[B] | TIP; |
203 | cuda[B] = cuda[B] | TIP; |
204 | } |
204 | } |
205 | 205 | ||
206 | 206 | ||
207 | /* Called from getc(). */ |
- | |
208 | static void cuda_resume(chardev_t *d) |
- | |
209 | { |
- | |
210 | } |
- | |
211 | - | ||
212 | - | ||
213 | /* Called from getc(). */ |
- | |
214 | static void cuda_suspend(chardev_t *d) |
- | |
215 | { |
- | |
216 | } |
- | |
217 | - | ||
218 | - | ||
219 | static char key_read(chardev_t *d) |
- | |
220 | { |
- | |
221 | char ch; |
- | |
222 | - | ||
223 | ch = 0; |
- | |
224 | return ch; |
- | |
225 | } |
- | |
226 | - | ||
227 | - | ||
228 | static chardev_t kbrd; |
207 | static indev_t kbrd; |
229 | static chardev_operations_t ops = { |
208 | static indev_operations_t ops = { |
230 | .suspend = cuda_suspend, |
- | |
231 | .resume = cuda_resume, |
- | |
232 | .read = key_read |
209 | .poll = NULL |
233 | }; |
210 | }; |
234 | 211 | ||
235 | 212 | ||
236 | int cuda_get_scancode(void) |
213 | int cuda_get_scancode(void) |
237 | { |
214 | { |
Line 253... | Line 230... | ||
253 | int scan_code = cuda_get_scancode(); |
230 | int scan_code = cuda_get_scancode(); |
254 | 231 | ||
255 | if (scan_code != -1) { |
232 | if (scan_code != -1) { |
256 | uint8_t scancode = (uint8_t) scan_code; |
233 | uint8_t scancode = (uint8_t) scan_code; |
257 | if ((scancode & 0x80) != 0x80) |
234 | if ((scancode & 0x80) != 0x80) |
258 | chardev_push_character(&kbrd, lchars[scancode & 0x7f]); |
235 | indev_push_character(&kbrd, lchars[scancode & 0x7f]); |
259 | } |
236 | } |
260 | } |
237 | } |
261 | 238 | ||
262 | static irq_ownership_t cuda_claim(irq_t *irq) |
239 | static irq_ownership_t cuda_claim(irq_t *irq) |
263 | { |
240 | { |
Line 266... | Line 243... | ||
266 | 243 | ||
267 | void cuda_init(devno_t devno, uintptr_t base, size_t size) |
244 | void cuda_init(devno_t devno, uintptr_t base, size_t size) |
268 | { |
245 | { |
269 | cuda = (uint8_t *) hw_map(base, size); |
246 | cuda = (uint8_t *) hw_map(base, size); |
270 | 247 | ||
271 | chardev_initialize("cuda_kbd", &kbrd, &ops); |
248 | indev_initialize("cuda_kbd", &kbrd, &ops); |
272 | stdin = &kbrd; |
249 | stdin = &kbrd; |
273 | 250 | ||
274 | irq_initialize(&cuda_irq); |
251 | irq_initialize(&cuda_irq); |
275 | cuda_irq.devno = devno; |
252 | cuda_irq.devno = devno; |
276 | cuda_irq.inr = CUDA_IRQ; |
253 | cuda_irq.inr = CUDA_IRQ; |