Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/block/ahci/ahci.c

    r7f620e8 r8820544  
    3838#include <device/hw_res_parsed.h>
    3939#include <pci_dev_iface.h>
    40 #include <sysinfo.h>
    41 #include <ipc/irc.h>
    42 #include <ns.h>
     40#include <irc.h>
    4341#include <ahci_iface.h>
    4442#include "ahci.h"
     
    129127
    130128static void ahci_get_model_name(uint16_t *, char *);
    131 static int ahci_enable_interrupt(int);
    132129
    133130static fibril_mutex_t sata_devices_count_lock;
     
    234231       
    235232        uintptr_t phys;
    236         void *ibuf;
     233        void *ibuf = AS_AREA_ANY;
    237234        int rc = dmamem_map_anonymous(sata->block_size, DMAMEM_4GiB,
    238235            AS_AREA_READ | AS_AREA_WRITE, 0, &phys, &ibuf);
     
    277274       
    278275        uintptr_t phys;
    279         void *ibuf;
     276        void *ibuf = AS_AREA_ANY;
    280277        int rc = dmamem_map_anonymous(sata->block_size, DMAMEM_4GiB,
    281278            AS_AREA_READ | AS_AREA_WRITE, 0, &phys, &ibuf);
     
    436433       
    437434        uintptr_t phys;
    438         sata_identify_data_t *idata;
     435        sata_identify_data_t *idata = AS_AREA_ANY;
    439436        int rc = dmamem_map_anonymous(SATA_IDENTIFY_DEVICE_BUFFER_LENGTH,
    440437            DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 0, &phys,
    441             (void **) &idata);
     438            (void *) &idata);
    442439        if (rc != EOK) {
    443440                ddf_msg(LVL_ERROR, "Cannot allocate buffer to identify device.");
     
    630627       
    631628        uintptr_t phys;
    632         sata_identify_data_t *idata;
     629        sata_identify_data_t *idata = AS_AREA_ANY;
    633630        int rc = dmamem_map_anonymous(SATA_SET_FEATURE_BUFFER_LENGTH,
    634631            DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 0, &phys,
    635             (void **) &idata);
     632            (void *) &idata);
    636633        if (rc != EOK) {
    637634                ddf_msg(LVL_ERROR, "Cannot allocate buffer for device set mode.");
     
    893890/** AHCI interrupt handler.
    894891 *
    895  * @param dev   DDF device structure.
    896892 * @param iid   The IPC call id.
    897893 * @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 */
     897static void ahci_interrupt(ipc_callid_t iid, ipc_call_t *icall, ddf_dev_t *dev)
    901898{
    902899        ahci_dev_t *ahci = dev_ahci_dev(dev);
     
    938935        size_t size = 4096;
    939936        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;
    943940        ddf_fun_t *fun;
    944941       
     
    11551152       
    11561153        /* Map AHCI registers. */
    1157         ahci->memregs = NULL;
     1154        ahci->memregs = AS_AREA_ANY;
    11581155       
    11591156        physmem_map(RNGABS(hw_res_parsed.mem_ranges.ranges[0]),
    11601157            AHCI_MEMREGS_PAGES_COUNT, AS_AREA_READ | AS_AREA_WRITE,
    1161             (void **) &ahci->memregs);
     1158            (void *) &ahci->memregs);
    11621159        if (ahci->memregs == NULL)
    11631160                goto error_map_registers;
     
    11951192        }
    11961193       
    1197         rc = ahci_enable_interrupt(hw_res_parsed.irqs.irqs[0]);
     1194        rc = irc_enable_interrupt(hw_res_parsed.irqs.irqs[0]);
    11981195        if (rc != EOK) {
    11991196                ddf_msg(LVL_ERROR, "Failed enable interupt.");
     
    13151312}
    13161313
    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 
    13391314/*----------------------------------------------------------------------------*/
    13401315/*-- AHCI Main routine -------------------------------------------------------*/
Note: See TracChangeset for help on using the changeset viewer.