Changeset ebc9c2c in mainline
- Timestamp:
- 2014-07-18T09:05:46Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 350274a
- Parents:
- e5424e9
- Location:
- uspace/drv
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/block/ahci/ahci.c
re5424e9 rebc9c2c 38 38 #include <device/hw_res_parsed.h> 39 39 #include <pci_dev_iface.h> 40 #include <sysinfo.h> 41 #include <ipc/irc.h> 42 #include <ns.h> 40 #include <irc.h> 43 41 #include <ahci_iface.h> 44 42 #include "ahci.h" … … 129 127 130 128 static void ahci_get_model_name(uint16_t *, char *); 131 static int ahci_enable_interrupt(int);132 129 133 130 static fibril_mutex_t sata_devices_count_lock; … … 1195 1192 } 1196 1193 1197 rc = ahci_enable_interrupt(hw_res_parsed.irqs.irqs[0]);1194 rc = irc_enable_interrupt(hw_res_parsed.irqs.irqs[0]); 1198 1195 if (rc != EOK) { 1199 1196 ddf_msg(LVL_ERROR, "Failed enable interupt."); … … 1315 1312 } 1316 1313 1317 /** Enable interrupt using SERVICE_IRC.1318 *1319 * @param irq Requested irq number.1320 *1321 * @return EOK if succeed, error code otherwise.1322 *1323 */1324 static int ahci_enable_interrupt(int irq)1325 {1326 async_sess_t *irc_sess = NULL;1327 irc_sess = service_connect_blocking(EXCHANGE_SERIALIZE, SERVICE_IRC, 0, 0);1328 if (!irc_sess)1329 return EINTR;1330 1331 async_exch_t *exch = async_exchange_begin(irc_sess);1332 const int rc = async_req_1_0(exch, IRC_ENABLE_INTERRUPT, irq);1333 async_exchange_end(exch);1334 1335 async_hangup(irc_sess);1336 return rc;1337 }1338 1339 1314 /*----------------------------------------------------------------------------*/ 1340 1315 /*-- AHCI Main routine -------------------------------------------------------*/ -
uspace/drv/bus/isa/isa.c
re5424e9 rebc9c2c 54 54 #include <ipc/irc.h> 55 55 #include <ipc/services.h> 56 #include <sysinfo.h>57 #include <ns.h>58 56 #include <sys/stat.h> 59 #include <ipc/irc.h> 60 #include <ipc/services.h> 61 #include <sysinfo.h> 57 #include <irc.h> 62 58 #include <ns.h> 63 59 … … 120 116 assert(fun); 121 117 122 sysarg_t apic;123 sysarg_t i8259;124 125 async_sess_t *irc_sess = NULL;126 127 if (((sysinfo_get_value("apic", &apic) == EOK) && (apic))128 || ((sysinfo_get_value("i8259", &i8259) == EOK) && (i8259))) {129 irc_sess = service_connect_blocking(EXCHANGE_SERIALIZE,130 SERVICE_IRC, 0, 0);131 }132 133 if (!irc_sess)134 return false;135 136 118 const hw_resource_list_t *res = &fun->hw_resources; 137 119 assert(res); 138 120 for (size_t i = 0; i < res->count; ++i) { 139 121 if (res->resources[i].type == INTERRUPT) { 140 const int irq = res->resources[i].res.interrupt.irq; 141 142 async_exch_t *exch = async_exchange_begin(irc_sess); 143 const int rc = 144 async_req_1_0(exch, IRC_ENABLE_INTERRUPT, irq); 145 async_exchange_end(exch); 146 147 if (rc != EOK) { 148 async_hangup(irc_sess); 122 int rc = irc_enable_interrupt( 123 res->resources[i].res.interrupt.irq); 124 125 if (rc != EOK) 149 126 return false; 150 } 151 } 152 } 153 154 async_hangup(irc_sess); 127 } 128 } 129 155 130 return true; 156 131 } -
uspace/drv/bus/pci/pciintel/pci.c
re5424e9 rebc9c2c 51 51 #include <ddf/log.h> 52 52 #include <ipc/dev_iface.h> 53 #include <ipc/irc.h> 54 #include <ns.h> 55 #include <ipc/services.h> 56 #include <sysinfo.h> 53 #include <irc.h> 57 54 #include <ops/hw_res.h> 58 55 #include <device/hw_res.h> … … 107 104 pci_fun_t *dev_data = pci_fun(fnode); 108 105 109 sysarg_t apic;110 sysarg_t i8259;111 112 async_sess_t *irc_sess = NULL;113 114 if (((sysinfo_get_value("apic", &apic) == EOK) && (apic))115 || ((sysinfo_get_value("i8259", &i8259) == EOK) && (i8259))) {116 irc_sess = service_connect_blocking(EXCHANGE_SERIALIZE,117 SERVICE_IRC, 0, 0);118 }119 120 if (!irc_sess)121 return false;122 123 106 size_t i = 0; 124 107 hw_resource_list_t *res = &dev_data->hw_resources; 125 108 for (; i < res->count; i++) { 126 109 if (res->resources[i].type == INTERRUPT) { 127 const int irq = res->resources[i].res.interrupt.irq; 128 129 async_exch_t *exch = async_exchange_begin(irc_sess); 130 const int rc = 131 async_req_1_0(exch, IRC_ENABLE_INTERRUPT, irq); 132 async_exchange_end(exch); 133 134 if (rc != EOK) { 135 async_hangup(irc_sess); 110 int rc = irc_enable_interrupt( 111 res->resources[i].res.interrupt.irq); 112 113 if (rc != EOK) 136 114 return false; 137 }138 115 } 139 116 } 140 117 141 async_hangup(irc_sess);142 118 return true; 143 119 } -
uspace/drv/char/ns8250/ns8250.c
re5424e9 rebc9c2c 57 57 #include <ops/char_dev.h> 58 58 59 #include <ns.h> 60 #include <ipc/services.h> 61 #include <ipc/irc.h> 59 #include <irc.h> 62 60 #include <device/hw_res.h> 63 61 #include <ipc/serial_ctl.h> … … 488 486 static int ns8250_interrupt_enable(ns8250_t *ns) 489 487 { 490 /* 491 * Enable interrupt using IRC service. 492 * TODO: This is a temporary solution until the device framework 493 * takes care of this itself. 494 */ 495 async_sess_t *irc_sess = service_connect_blocking(EXCHANGE_SERIALIZE, 496 SERVICE_IRC, 0, 0); 497 if (!irc_sess) { 488 /* Enable interrupt using IRC service. */ 489 int rc = irc_enable_interrupt(ns->irq); 490 if (rc != EOK) 498 491 return EIO; 499 } 500 501 async_exch_t *exch = async_exchange_begin(irc_sess); 502 if (!exch) { 503 return EIO; 504 } 505 async_msg_1(exch, IRC_ENABLE_INTERRUPT, ns->irq); 506 async_exchange_end(exch); 507 492 508 493 /* Read LSR to clear possible previous LSR interrupt */ 509 494 pio_read_8(&ns->regs->lsr); 510 495 511 496 /* Enable interrupt on the serial port. */ 512 497 ns8250_port_interrupts_enable(ns->regs);
Note:
See TracChangeset
for help on using the changeset viewer.