Changes in uspace/srv/hid/input/port/ns16550.c [8820544:b6a088f] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/input/port/ns16550.c
r8820544 rb6a088f 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); 48 50 static void ns16550_port_write(uint8_t data); 49 51 50 52 kbd_port_ops_t ns16550_port = { 51 53 .init = ns16550_port_init, 54 .yield = ns16550_port_yield, 55 .reclaim = ns16550_port_reclaim, 52 56 .write = ns16550_port_write 53 57 }; … … 107 111 }; 108 112 113 static void ns16550_irq_handler(ipc_callid_t iid, ipc_call_t *call); 114 109 115 static uintptr_t ns16550_physical; 116 110 117 static kbd_dev_t *kbd_dev; 111 static sysarg_t inr;112 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 }123 118 124 119 static int ns16550_port_init(kbd_dev_t *kdev) 125 120 { 121 void *vaddr; 122 126 123 kbd_dev = kdev; 127 124 … … 135 132 return -1; 136 133 134 sysarg_t inr; 137 135 if (sysinfo_get_value("kbd.inr", &inr) != EOK) 138 136 return -1; … … 142 140 ns16550_kbd.cmds[3].addr = (void *) (ns16550_physical + RBR_REG); 143 141 144 async_ irq_subscribe(inr, device_assign_devno(), ns16550_irq_handler, NULL,145 142 async_set_interrupt_received(ns16550_irq_handler); 143 irq_register(inr, device_assign_devno(), inr, &ns16550_kbd); 146 144 147 void *vaddr;148 145 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 { 149 154 } 150 155 … … 154 159 } 155 160 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 156 172 /** 157 173 * @}
Note:
See TracChangeset
for help on using the changeset viewer.