Changeset eadaeae8 in mainline for uspace/drv
- Timestamp:
- 2018-03-21T20:58:49Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3be9d10
- Parents:
- 874381a
- Location:
- uspace/drv
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/audio/hdaudio/hdaudio.c
r874381a readaeae8 263 263 } 264 264 265 int irq_cap;265 cap_irq_handle_t irq_cap; 266 266 rc = register_interrupt_handler(dev, res.irqs.irqs[0], 267 267 hdaudio_interrupt, &irq_code, &irq_cap); -
uspace/drv/audio/sb16/main.c
r874381a readaeae8 93 93 irq_cmd_t irq_cmds[irq_cmd_count]; 94 94 irq_pio_range_t irq_ranges[1]; 95 int irq_cap;95 cap_irq_handle_t irq_cap; 96 96 97 97 sb16_t *soft_state = ddf_dev_data_alloc(device, sizeof(sb16_t)); -
uspace/drv/block/ahci/ahci.c
r874381a readaeae8 1184 1184 ct.ranges = ahci_ranges; 1185 1185 1186 int irq_cap;1186 cap_irq_handle_t irq_cap; 1187 1187 errno_t rc = register_interrupt_handler(dev, 1188 1188 hw_res_parsed.irqs.irqs[0], ahci_interrupt, &ct, &irq_cap); -
uspace/drv/block/ddisk/ddisk.c
r874381a readaeae8 112 112 ddisk_regs_t *ddisk_regs; 113 113 114 int irq_cap;114 cap_irq_handle_t irq_cap; 115 115 116 116 bd_srvs_t bds; … … 449 449 ddisk->bds.sarg = ddisk; 450 450 451 ddisk->irq_cap = -1;451 ddisk->irq_cap = CAP_NIL; 452 452 453 453 /* -
uspace/drv/bus/usb/ohci/hc.c
r874381a readaeae8 512 512 513 513 /* Enable interrupts */ 514 if ( instance->base.irq_cap >= 0) {514 if (CAP_HANDLE_VALID(instance->base.irq_handle)) { 515 515 OHCI_WR(instance->registers->interrupt_enable, 516 516 OHCI_USED_INTERRUPTS); -
uspace/drv/bus/usb/uhci/hc.c
r874381a readaeae8 294 294 pio_write_32(®isters->flbaseadd, pa); 295 295 296 if ( instance->base.irq_cap >= 0) {296 if (CAP_HANDLE_VALID(instance->base.irq_handle)) { 297 297 /* Enable all interrupts, but resume interrupt */ 298 298 pio_write_16(&instance->registers->usbintr, -
uspace/drv/bus/usb/xhci/hc.c
r874381a readaeae8 495 495 XHCI_REG_WR(intr0, XHCI_INTR_ERSTBA, erstba_phys); 496 496 497 if ( hc->base.irq_cap > 0) {497 if (CAP_HANDLE_VALID(hc->base.irq_handle)) { 498 498 XHCI_REG_SET(intr0, XHCI_INTR_IE, 1); 499 499 XHCI_REG_SET(hc->op_regs, XHCI_OP_INTE, 1); -
uspace/drv/char/i8042/i8042.c
r874381a readaeae8 281 281 }; 282 282 283 int irq_kbd_cap;283 cap_irq_handle_t kbd_ihandle; 284 284 rc = register_interrupt_handler(ddf_dev, irq_kbd, 285 i8042_irq_handler, &irq_code, & irq_kbd_cap);285 i8042_irq_handler, &irq_code, &kbd_ihandle); 286 286 if (rc != EOK) { 287 287 ddf_msg(LVL_ERROR, "Failed set handler for kbd: %s.", … … 290 290 } 291 291 292 int irq_mouse_cap;292 cap_irq_handle_t mouse_ihandle; 293 293 rc = register_interrupt_handler(ddf_dev, irq_mouse, 294 i8042_irq_handler, &irq_code, & irq_mouse_cap);294 i8042_irq_handler, &irq_code, &mouse_ihandle); 295 295 if (rc != EOK) { 296 296 ddf_msg(LVL_ERROR, "Failed set handler for mouse: %s.", -
uspace/drv/char/msim-con/msim-con.c
r874381a readaeae8 83 83 { 84 84 ddf_fun_t *fun = NULL; 85 bool subscribed = false;86 85 irq_cmd_t *msim_cmds = NULL; 87 86 errno_t rc; … … 90 89 fibril_mutex_initialize(&con->buf_lock); 91 90 fibril_condvar_initialize(&con->buf_cv); 91 92 con->irq_handle = CAP_NIL; 92 93 93 94 msim_cmds = malloc(sizeof(msim_cmds_proto)); … … 125 126 con->irq_code.cmds = msim_cmds; 126 127 127 async_irq_subscribe(res->irq, msim_irq_handler, con, &con->irq_code, NULL); 128 subscribed = true; 128 rc = async_irq_subscribe(res->irq, msim_irq_handler, con, 129 &con->irq_code, &con->irq_handle); 130 if (rc != EOK) { 131 ddf_msg(LVL_ERROR, "Error registering IRQ code."); 132 goto error; 133 } 129 134 130 135 chardev_srvs_init(&con->cds); … … 142 147 return EOK; 143 148 error: 144 if ( subscribed)145 async_irq_unsubscribe( res->irq);149 if (CAP_HANDLE_VALID(con->irq_handle)) 150 async_irq_unsubscribe(con->irq_handle); 146 151 if (fun != NULL) 147 152 ddf_fun_destroy(fun); -
uspace/drv/char/msim-con/msim-con.h
r874381a readaeae8 68 68 fibril_condvar_t buf_cv; 69 69 ioport8_t *out_reg; 70 cap_irq_handle_t irq_handle; 70 71 } msim_con_t; 71 72 -
uspace/drv/char/ns8250/ns8250.c
r874381a readaeae8 165 165 int irq; 166 166 /** IRQ capability handle */ 167 int irq_cap;167 cap_irq_handle_t irq_handle; 168 168 /** The base i/o address of the devices registers. */ 169 169 uintptr_t io_addr; … … 804 804 */ 805 805 static inline errno_t ns8250_register_interrupt_handler(ns8250_t *ns, 806 cap_ handle_t *handle)806 cap_irq_handle_t *ihandle) 807 807 { 808 808 return register_interrupt_handler(ns->dev, ns->irq, 809 ns8250_interrupt_handler, NULL, handle);809 ns8250_interrupt_handler, NULL, ihandle); 810 810 } 811 811 … … 816 816 static inline errno_t ns8250_unregister_interrupt_handler(ns8250_t *ns) 817 817 { 818 return unregister_interrupt_handler(ns->dev, ns->irq_ cap);818 return unregister_interrupt_handler(ns->dev, ns->irq_handle); 819 819 } 820 820 … … 876 876 877 877 /* Register interrupt handler. */ 878 rc = ns8250_register_interrupt_handler(ns, &ns->irq_cap); 878 ns->irq_handle = CAP_NIL; 879 rc = ns8250_register_interrupt_handler(ns, &ns->irq_handle); 879 880 if (rc != EOK) { 880 881 ddf_msg(LVL_ERROR, "Failed to register interrupt handler."); -
uspace/drv/char/pl050/pl050.c
r874381a readaeae8 213 213 pl050->regs = regs; 214 214 215 int irq_cap;215 cap_irq_handle_t ihandle; 216 216 rc = register_interrupt_handler(pl050->dev, 217 res.irqs.irqs[0], pl050_interrupt, &pl050_irq_code, &i rq_cap);217 res.irqs.irqs[0], pl050_interrupt, &pl050_irq_code, &ihandle); 218 218 if (rc != EOK) { 219 219 ddf_msg(LVL_ERROR, "Failed registering interrupt handler. (%s)", -
uspace/drv/nic/e1k/e1k.c
r874381a readaeae8 1264 1264 * 1265 1265 */ 1266 inline static errno_t e1000_register_int_handler(nic_t *nic, cap_handle_t *handle) 1266 inline static errno_t e1000_register_int_handler(nic_t *nic, 1267 cap_irq_handle_t *handle) 1267 1268 { 1268 1269 e1000_t *e1000 = DRIVER_DATA_NIC(nic); … … 2165 2166 ddf_fun_set_ops(fun, &e1000_dev_ops); 2166 2167 2167 int irq_cap;2168 rc = e1000_register_int_handler(nic, &irq_ cap);2168 cap_irq_handle_t irq_handle; 2169 rc = e1000_register_int_handler(nic, &irq_handle); 2169 2170 if (rc != EOK) { 2170 2171 goto err_fun_create; … … 2204 2205 e1000_uninitialize_rx_structure(nic); 2205 2206 err_irq: 2206 unregister_interrupt_handler(dev, irq_ cap);2207 unregister_interrupt_handler(dev, irq_handle); 2207 2208 err_fun_create: 2208 2209 ddf_fun_destroy(fun); -
uspace/drv/nic/ne2k/ne2k.c
r874381a readaeae8 124 124 static void ne2k_interrupt_handler(ipc_call_t *, ddf_dev_t *); 125 125 126 static errno_t ne2k_register_interrupt(nic_t *nic_data, cap_handle_t *handle) 126 static errno_t ne2k_register_interrupt(nic_t *nic_data, 127 cap_irq_handle_t *handle) 127 128 { 128 129 ne2k_t *ne2k = (ne2k_t *) nic_get_specific(nic_data); -
uspace/drv/nic/rtl8139/driver.c
r874381a readaeae8 846 846 * @return An error code otherwise. 847 847 */ 848 inline static errno_t rtl8139_register_int_handler(nic_t *nic_data, cap_handle_t *handle) 848 inline static errno_t rtl8139_register_int_handler(nic_t *nic_data, 849 cap_irq_handle_t *handle) 849 850 { 850 851 rtl8139_t *rtl8139 = nic_get_specific(nic_data); … … 1288 1289 1289 1290 /* Register interrupt handler */ 1290 int irq_cap;1291 rc = rtl8139_register_int_handler(nic_data, &irq_ cap);1291 cap_irq_handle_t irq_handle; 1292 rc = rtl8139_register_int_handler(nic_data, &irq_handle); 1292 1293 if (rc != EOK) { 1293 1294 goto err_pio; … … 1324 1325 ddf_fun_destroy(fun); 1325 1326 err_srv: 1326 unregister_interrupt_handler(dev, irq_ cap);1327 unregister_interrupt_handler(dev, irq_handle); 1327 1328 err_pio: 1328 1329 // rtl8139_pio_disable(dev); -
uspace/drv/nic/rtl8169/driver.c
r874381a readaeae8 75 75 static void rtl8169_send_frame(nic_t *nic_data, void *data, size_t size); 76 76 static void rtl8169_irq_handler(ipc_call_t *icall, ddf_dev_t *dev); 77 static inline errno_t rtl8169_register_int_handler(nic_t *nic_data, cap_handle_t *handle); 77 static inline errno_t rtl8169_register_int_handler(nic_t *nic_data, 78 cap_irq_handle_t *handle); 78 79 static inline void rtl8169_get_hwaddr(rtl8169_t *rtl8169, nic_address_t *addr); 79 80 static inline void rtl8169_set_hwaddr(rtl8169_t *rtl8169, const nic_address_t *addr); … … 361 362 } 362 363 363 inline static errno_t rtl8169_register_int_handler(nic_t *nic_data, cap_handle_t *handle) 364 inline static errno_t rtl8169_register_int_handler(nic_t *nic_data, 365 cap_irq_handle_t *handle) 364 366 { 365 367 rtl8169_t *rtl8169 = nic_get_specific(nic_data); … … 429 431 goto err_pio; 430 432 431 int irq_cap;432 rc = rtl8169_register_int_handler(nic_data, &irq_ cap);433 cap_irq_handle_t irq_handle; 434 rc = rtl8169_register_int_handler(nic_data, &irq_handle); 433 435 if (rc != EOK) { 434 436 ddf_msg(LVL_ERROR, "Failed to register IRQ handler (%s)", str_error_name(rc)); … … 472 474 err_srv: 473 475 /* XXX Disconnect from services */ 474 unregister_interrupt_handler(dev, irq_ cap);476 unregister_interrupt_handler(dev, irq_handle); 475 477 err_irq: 476 478 err_pio:
Note:
See TracChangeset
for help on using the changeset viewer.