Changes in uspace/drv/block/ahci/ahci.c [7f620e8:8820544] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/block/ahci/ahci.c
r7f620e8 r8820544 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; … … 234 231 235 232 uintptr_t phys; 236 void *ibuf ;233 void *ibuf = AS_AREA_ANY; 237 234 int rc = dmamem_map_anonymous(sata->block_size, DMAMEM_4GiB, 238 235 AS_AREA_READ | AS_AREA_WRITE, 0, &phys, &ibuf); … … 277 274 278 275 uintptr_t phys; 279 void *ibuf ;276 void *ibuf = AS_AREA_ANY; 280 277 int rc = dmamem_map_anonymous(sata->block_size, DMAMEM_4GiB, 281 278 AS_AREA_READ | AS_AREA_WRITE, 0, &phys, &ibuf); … … 436 433 437 434 uintptr_t phys; 438 sata_identify_data_t *idata ;435 sata_identify_data_t *idata = AS_AREA_ANY; 439 436 int rc = dmamem_map_anonymous(SATA_IDENTIFY_DEVICE_BUFFER_LENGTH, 440 437 DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 0, &phys, 441 (void * *) &idata);438 (void *) &idata); 442 439 if (rc != EOK) { 443 440 ddf_msg(LVL_ERROR, "Cannot allocate buffer to identify device."); … … 630 627 631 628 uintptr_t phys; 632 sata_identify_data_t *idata ;629 sata_identify_data_t *idata = AS_AREA_ANY; 633 630 int rc = dmamem_map_anonymous(SATA_SET_FEATURE_BUFFER_LENGTH, 634 631 DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 0, &phys, 635 (void * *) &idata);632 (void *) &idata); 636 633 if (rc != EOK) { 637 634 ddf_msg(LVL_ERROR, "Cannot allocate buffer for device set mode."); … … 893 890 /** AHCI interrupt handler. 894 891 * 895 * @param dev DDF device structure.896 892 * @param iid The IPC call id. 897 893 * @param icall The IPC call structure. 898 * 899 */ 900 static void ahci_interrupt(ddf_dev_t *dev, ipc_callid_t iid, ipc_call_t *icall) 894 * @param dev DDF device structure. 895 * 896 */ 897 static void ahci_interrupt(ipc_callid_t iid, ipc_call_t *icall, ddf_dev_t *dev) 901 898 { 902 899 ahci_dev_t *ahci = dev_ahci_dev(dev); … … 938 935 size_t size = 4096; 939 936 uintptr_t phys = 0; 940 void *virt_fb = NULL;941 void *virt_cmd = NULL;942 void *virt_table = NULL;937 void *virt_fb = AS_AREA_ANY; 938 void *virt_cmd = AS_AREA_ANY; 939 void *virt_table = AS_AREA_ANY; 943 940 ddf_fun_t *fun; 944 941 … … 1155 1152 1156 1153 /* Map AHCI registers. */ 1157 ahci->memregs = NULL;1154 ahci->memregs = AS_AREA_ANY; 1158 1155 1159 1156 physmem_map(RNGABS(hw_res_parsed.mem_ranges.ranges[0]), 1160 1157 AHCI_MEMREGS_PAGES_COUNT, AS_AREA_READ | AS_AREA_WRITE, 1161 (void * *) &ahci->memregs);1158 (void *) &ahci->memregs); 1162 1159 if (ahci->memregs == NULL) 1163 1160 goto error_map_registers; … … 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 -------------------------------------------------------*/
Note:
See TracChangeset
for help on using the changeset viewer.