Changes in uspace/srv/hid/input/port/ns16550.c [b6a088f:8820544] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/input/port/ns16550.c
rb6a088f r8820544 46 46 47 47 static int ns16550_port_init(kbd_dev_t *); 48 static void ns16550_port_yield(void);49 static void ns16550_port_reclaim(void);50 48 static void ns16550_port_write(uint8_t data); 51 49 52 50 kbd_port_ops_t ns16550_port = { 53 51 .init = ns16550_port_init, 54 .yield = ns16550_port_yield,55 .reclaim = ns16550_port_reclaim,56 52 .write = ns16550_port_write 57 53 }; … … 111 107 }; 112 108 113 static void ns16550_irq_handler(ipc_callid_t iid, ipc_call_t *call); 109 static uintptr_t ns16550_physical; 110 static kbd_dev_t *kbd_dev; 111 static sysarg_t inr; 114 112 115 static uintptr_t ns16550_physical; 116 117 static kbd_dev_t *kbd_dev; 113 static void ns16550_irq_handler(ipc_callid_t iid, ipc_call_t *call, void *arg) 114 { 115 kbd_push_data(kbd_dev, IPC_GET_ARG2(*call)); 116 117 if (irc_service) { 118 async_exch_t *exch = async_exchange_begin(irc_sess); 119 async_msg_1(exch, IRC_CLEAR_INTERRUPT, inr); 120 async_exchange_end(exch); 121 } 122 } 118 123 119 124 static int ns16550_port_init(kbd_dev_t *kdev) 120 125 { 121 void *vaddr;122 123 126 kbd_dev = kdev; 124 127 … … 132 135 return -1; 133 136 134 sysarg_t inr;135 137 if (sysinfo_get_value("kbd.inr", &inr) != EOK) 136 138 return -1; … … 140 142 ns16550_kbd.cmds[3].addr = (void *) (ns16550_physical + RBR_REG); 141 143 142 async_ set_interrupt_received(ns16550_irq_handler);143 irq_register(inr, device_assign_devno(), inr,&ns16550_kbd);144 async_irq_subscribe(inr, device_assign_devno(), ns16550_irq_handler, NULL, 145 &ns16550_kbd); 144 146 147 void *vaddr; 145 148 return pio_enable((void *) ns16550_physical, 8, &vaddr); 146 }147 148 static void ns16550_port_yield(void)149 {150 }151 152 static void ns16550_port_reclaim(void)153 {154 149 } 155 150 … … 159 154 } 160 155 161 static void ns16550_irq_handler(ipc_callid_t iid, ipc_call_t *call)162 {163 kbd_push_data(kbd_dev, IPC_GET_ARG2(*call));164 165 if (irc_service) {166 async_exch_t *exch = async_exchange_begin(irc_sess);167 async_msg_1(exch, IRC_CLEAR_INTERRUPT, IPC_GET_IMETHOD(*call));168 async_exchange_end(exch);169 }170 }171 172 156 /** 173 157 * @}
Note:
See TracChangeset
for help on using the changeset viewer.