Rev 1649 | Rev 1707 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1649 | Rev 1694 | ||
---|---|---|---|
Line 50... | Line 50... | ||
50 | #include <arch/kbd.h> |
50 | #include <arch/kbd.h> |
51 | #include <kbd.h> |
51 | #include <kbd.h> |
52 | #include <libadt/fifo.h> |
52 | #include <libadt/fifo.h> |
53 | #include <key_buffer.h> |
53 | #include <key_buffer.h> |
54 | #include <async.h> |
54 | #include <async.h> |
- | 55 | #include <keys.h> |
|
55 | 56 | ||
56 | #define NAME "KBD" |
57 | #define NAME "KBD" |
57 | 58 | ||
58 | int cons_connected = 0; |
59 | int cons_connected = 0; |
59 | int phone2cons = -1; |
60 | int phone2cons = -1; |
60 | keybuffer_t keybuffer; |
61 | keybuffer_t keybuffer; |
61 | 62 | ||
62 | static void irq_handler(ipc_callid_t iid, ipc_call_t *call) |
63 | static void irq_handler(ipc_callid_t iid, ipc_call_t *call) |
63 | { |
64 | { |
64 | int chr; |
65 | int chr; |
65 | 66 | ||
66 | if (cons_connected && phone2cons != -1) { |
67 | if (cons_connected && phone2cons != -1) { |
67 | /* recode to ASCII - one interrupt can produce more than one code so result is stored in fifo */ |
68 | /* recode to ASCII - one interrupt can produce more than one code so result is stored in fifo */ |
68 | kbd_arch_process(&keybuffer, IPC_GET_ARG2(*call)); |
69 | kbd_arch_process(&keybuffer, call); |
69 | 70 | ||
70 | while (!keybuffer_empty(&keybuffer)) { |
71 | while (!keybuffer_empty(&keybuffer)) { |
71 | if (!keybuffer_pop(&keybuffer, (int *)&chr)) |
72 | if (!keybuffer_pop(&keybuffer, (int *)&chr)) |
72 | break; |
73 | break; |
73 | 74 | ||
Line 121... | Line 122... | ||
121 | ipcarg_t phoneid; |
122 | ipcarg_t phoneid; |
122 | char connected = 0; |
123 | char connected = 0; |
123 | ipcarg_t retval, arg1, arg2; |
124 | ipcarg_t retval, arg1, arg2; |
124 | 125 | ||
125 | /* Initialize arch dependent parts */ |
126 | /* Initialize arch dependent parts */ |
126 | if (!(res = kbd_arch_init())) { |
127 | if (kbd_arch_init()) |
127 | return -1; |
128 | return -1; |
128 | }; |
- | |
129 | 129 | ||
130 | /* Initialize key buffer */ |
130 | /* Initialize key buffer */ |
131 | keybuffer_init(&keybuffer); |
131 | keybuffer_init(&keybuffer); |
132 | 132 | ||
133 | async_set_client_connection(console_connection); |
133 | async_set_client_connection(console_connection); |