Changes in uspace/drv/block/ahci/ahci.c [8820544:7f620e8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/block/ahci/ahci.c
r8820544 r7f620e8 38 38 #include <device/hw_res_parsed.h> 39 39 #include <pci_dev_iface.h> 40 #include <irc.h> 40 #include <sysinfo.h> 41 #include <ipc/irc.h> 42 #include <ns.h> 41 43 #include <ahci_iface.h> 42 44 #include "ahci.h" … … 127 129 128 130 static void ahci_get_model_name(uint16_t *, char *); 131 static int ahci_enable_interrupt(int); 129 132 130 133 static fibril_mutex_t sata_devices_count_lock; … … 231 234 232 235 uintptr_t phys; 233 void *ibuf = AS_AREA_ANY;236 void *ibuf; 234 237 int rc = dmamem_map_anonymous(sata->block_size, DMAMEM_4GiB, 235 238 AS_AREA_READ | AS_AREA_WRITE, 0, &phys, &ibuf); … … 274 277 275 278 uintptr_t phys; 276 void *ibuf = AS_AREA_ANY;279 void *ibuf; 277 280 int rc = dmamem_map_anonymous(sata->block_size, DMAMEM_4GiB, 278 281 AS_AREA_READ | AS_AREA_WRITE, 0, &phys, &ibuf); … … 433 436 434 437 uintptr_t phys; 435 sata_identify_data_t *idata = AS_AREA_ANY;438 sata_identify_data_t *idata; 436 439 int rc = dmamem_map_anonymous(SATA_IDENTIFY_DEVICE_BUFFER_LENGTH, 437 440 DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 0, &phys, 438 (void * ) &idata);441 (void **) &idata); 439 442 if (rc != EOK) { 440 443 ddf_msg(LVL_ERROR, "Cannot allocate buffer to identify device."); … … 627 630 628 631 uintptr_t phys; 629 sata_identify_data_t *idata = AS_AREA_ANY;632 sata_identify_data_t *idata; 630 633 int rc = dmamem_map_anonymous(SATA_SET_FEATURE_BUFFER_LENGTH, 631 634 DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 0, &phys, 632 (void * ) &idata);635 (void **) &idata); 633 636 if (rc != EOK) { 634 637 ddf_msg(LVL_ERROR, "Cannot allocate buffer for device set mode."); … … 890 893 /** AHCI interrupt handler. 891 894 * 895 * @param dev DDF device structure. 892 896 * @param iid The IPC call id. 893 897 * @param icall The IPC call structure. 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) 898 * 899 */ 900 static void ahci_interrupt(ddf_dev_t *dev, ipc_callid_t iid, ipc_call_t *icall) 898 901 { 899 902 ahci_dev_t *ahci = dev_ahci_dev(dev); … … 935 938 size_t size = 4096; 936 939 uintptr_t phys = 0; 937 void *virt_fb = AS_AREA_ANY;938 void *virt_cmd = AS_AREA_ANY;939 void *virt_table = AS_AREA_ANY;940 void *virt_fb = NULL; 941 void *virt_cmd = NULL; 942 void *virt_table = NULL; 940 943 ddf_fun_t *fun; 941 944 … … 1152 1155 1153 1156 /* Map AHCI registers. */ 1154 ahci->memregs = AS_AREA_ANY;1157 ahci->memregs = NULL; 1155 1158 1156 1159 physmem_map(RNGABS(hw_res_parsed.mem_ranges.ranges[0]), 1157 1160 AHCI_MEMREGS_PAGES_COUNT, AS_AREA_READ | AS_AREA_WRITE, 1158 (void * ) &ahci->memregs);1161 (void **) &ahci->memregs); 1159 1162 if (ahci->memregs == NULL) 1160 1163 goto error_map_registers; … … 1192 1195 } 1193 1196 1194 rc = irc_enable_interrupt(hw_res_parsed.irqs.irqs[0]);1197 rc = ahci_enable_interrupt(hw_res_parsed.irqs.irqs[0]); 1195 1198 if (rc != EOK) { 1196 1199 ddf_msg(LVL_ERROR, "Failed enable interupt."); … … 1312 1315 } 1313 1316 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 1314 1339 /*----------------------------------------------------------------------------*/ 1315 1340 /*-- AHCI Main routine -------------------------------------------------------*/
Note:
See TracChangeset
for help on using the changeset viewer.