Rev 1928 | Rev 1934 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1928 | Rev 1932 | ||
---|---|---|---|
Line 62... | Line 62... | ||
62 | 62 | ||
63 | 63 | ||
64 | static volatile uint8_t *cuda = NULL; |
64 | static volatile uint8_t *cuda = NULL; |
65 | static irq_t cuda_irq; /**< Cuda's IRQ. */ |
65 | static irq_t cuda_irq; /**< Cuda's IRQ. */ |
66 | 66 | ||
67 | static ipc_notif_cfg_t saved_notif_cfg; |
- | |
68 | - | ||
69 | - | ||
70 | static char lchars[0x80] = { |
67 | static char lchars[0x80] = { |
71 | 'a', |
68 | 'a', |
72 | 's', |
69 | 's', |
73 | 'd', |
70 | 'd', |
74 | 'f', |
71 | 'f', |
Line 252... | Line 249... | ||
252 | return -1; |
249 | return -1; |
253 | } |
250 | } |
254 | 251 | ||
255 | static void cuda_irq_handler(irq_t *irq, void *arg, ...) |
252 | static void cuda_irq_handler(irq_t *irq, void *arg, ...) |
256 | { |
253 | { |
257 | if (irq->notif_cfg.answerbox) |
254 | if (irq->notif_cfg.notify && irq->notif_cfg.answerbox) |
258 | ipc_irq_send_notif(irq); |
255 | ipc_irq_send_notif(irq); |
259 | else { |
256 | else { |
260 | int scan_code = cuda_get_scancode(); |
257 | int scan_code = cuda_get_scancode(); |
261 | 258 | ||
262 | if (scan_code != -1) { |
259 | if (scan_code != -1) { |
Line 274... | Line 271... | ||
274 | 271 | ||
275 | 272 | ||
276 | /** Initialize keyboard and service interrupts using kernel routine */ |
273 | /** Initialize keyboard and service interrupts using kernel routine */ |
277 | void cuda_grab(void) |
274 | void cuda_grab(void) |
278 | { |
275 | { |
279 | if (cuda_irq.notif_cfg.answerbox) { |
- | |
280 | saved_notif_cfg = cuda_irq.notif_cfg; |
- | |
281 | cuda_irq.notif_cfg.answerbox = NULL; |
- | |
282 | cuda_irq.notif_cfg.code = NULL; |
276 | cuda_irq.notif_cfg.notify = false; |
283 | cuda_irq.notif_cfg.method = 0; |
- | |
284 | cuda_irq.notif_cfg.counter = 0; |
- | |
285 | } |
- | |
286 | } |
277 | } |
287 | 278 | ||
288 | 279 | ||
289 | /** Resume the former interrupt vector */ |
280 | /** Resume the former interrupt vector */ |
290 | void cuda_release(void) |
281 | void cuda_release(void) |
291 | { |
282 | { |
292 | if (saved_notif_cfg.answerbox) |
283 | if (cuda_irq.notif_cfg.answerbox) |
293 | cuda_irq.notif_cfg = saved_notif_cfg; |
284 | cuda_irq.notif_cfg.notify = true; |
294 | } |
285 | } |
295 | 286 | ||
296 | 287 | ||
297 | void cuda_init(devno_t devno, uintptr_t base, size_t size) |
288 | void cuda_init(devno_t devno, uintptr_t base, size_t size) |
298 | { |
289 | { |