Rev 3954 | Rev 4148 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3954 | Rev 4026 | ||
---|---|---|---|
Line 84... | Line 84... | ||
84 | ns16550_cmds |
84 | ns16550_cmds |
85 | }; |
85 | }; |
86 | 86 | ||
87 | static void ns16550_irq_handler(ipc_callid_t iid, ipc_call_t *call); |
87 | static void ns16550_irq_handler(ipc_callid_t iid, ipc_call_t *call); |
88 | 88 | ||
- | 89 | static uintptr_t ns16550_physical; |
|
89 | uint16_t ns16550_port; |
90 | static uintptr_t ns16550_kernel; |
90 | 91 | ||
91 | int kbd_port_init(void) |
92 | int kbd_port_init(void) |
92 | { |
93 | { |
- | 94 | void *vaddr; |
|
- | 95 | ||
93 | async_set_interrupt_received(ns16550_irq_handler); |
96 | async_set_interrupt_received(ns16550_irq_handler); |
94 | 97 | ||
- | 98 | ns16550_physical = sysinfo_value("kbd.address.physical"); |
|
95 | ns16550_port = sysinfo_value("kbd.port"); |
99 | ns16550_kernel = sysinfo_value("kbd.address.kernel"); |
96 | ns16550_kbd.cmds[0].addr = (void *) (ns16550_port + LSR_REG); |
100 | ns16550_kbd.cmds[0].addr = (void *) (ns16550_kernel + LSR_REG); |
97 | ns16550_kbd.cmds[3].addr = (void *) (ns16550_port + RBR_REG); |
101 | ns16550_kbd.cmds[3].addr = (void *) (ns16550_kernel + RBR_REG); |
98 | ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), |
102 | ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), |
99 | 0, &ns16550_kbd); |
103 | 0, &ns16550_kbd); |
100 | iospace_enable(task_get_id(), ns16550_port, 8); |
104 | return pio_enable((void *) ns16550_physical, 8, &vaddr); |
101 | - | ||
102 | return 0; |
- | |
103 | } |
105 | } |
104 | 106 | ||
105 | static void ns16550_irq_handler(ipc_callid_t iid, ipc_call_t *call) |
107 | static void ns16550_irq_handler(ipc_callid_t iid, ipc_call_t *call) |
106 | { |
108 | { |
107 | int scan_code = IPC_GET_ARG2(*call); |
109 | int scan_code = IPC_GET_ARG2(*call); |