Ignore:
File:
1 edited

Legend:

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

    r7de1988c racdb5bac  
    119119static int ahci_identify_device(sata_dev_t *);
    120120static int ahci_set_highest_ultra_dma_mode(sata_dev_t *);
    121 static int ahci_rb_fpdma(sata_dev_t *, uintptr_t, uint64_t);
    122 static int ahci_wb_fpdma(sata_dev_t *, uintptr_t, uint64_t);
     121static int ahci_rb_fpdma(sata_dev_t *, void *, uint64_t);
     122static int ahci_wb_fpdma(sata_dev_t *, void *, uint64_t);
    123123
    124124static void ahci_sata_devices_create(ahci_dev_t *, ddf_dev_t *);
     
    233233        sata_dev_t *sata = fun_sata_dev(fun);
    234234       
    235         uintptr_t phys;
     235        void *phys;
    236236        void *ibuf;
    237         int rc = dmamem_map_anonymous(sata->block_size, DMAMEM_4GiB,
    238             AS_AREA_READ | AS_AREA_WRITE, 0, &phys, &ibuf);
     237        int rc = dmamem_map_anonymous(sata->block_size, AS_AREA_READ | AS_AREA_WRITE,
     238            0, &phys, (void **) &ibuf);
    239239        if (rc != EOK) {
    240240                ddf_msg(LVL_ERROR, "Cannot allocate read buffer.");
     
    276276        sata_dev_t *sata = fun_sata_dev(fun);
    277277       
    278         uintptr_t phys;
     278        void *phys;
    279279        void *ibuf;
    280         int rc = dmamem_map_anonymous(sata->block_size, DMAMEM_4GiB,
    281             AS_AREA_READ | AS_AREA_WRITE, 0, &phys, &ibuf);
     280        int rc = dmamem_map_anonymous(sata->block_size, AS_AREA_READ | AS_AREA_WRITE,
     281            0, &phys, (void **) &ibuf);
    282282        if (rc != EOK) {
    283283                ddf_msg(LVL_ERROR, "Cannot allocate write buffer.");
     
    336336 *
    337337 */
    338 static void ahci_identify_device_cmd(sata_dev_t *sata, uintptr_t phys)
     338static void ahci_identify_device_cmd(sata_dev_t *sata, void *phys)
    339339{
    340340        volatile sata_std_command_frame_t *cmd =
     
    381381 *
    382382 */
    383 static void ahci_identify_packet_device_cmd(sata_dev_t *sata, uintptr_t phys)
     383static void ahci_identify_packet_device_cmd(sata_dev_t *sata, void *phys)
    384384{
    385385        volatile sata_std_command_frame_t *cmd =
     
    435435        }
    436436       
    437         uintptr_t phys;
     437        void *phys;
    438438        sata_identify_data_t *idata;
    439439        int rc = dmamem_map_anonymous(SATA_IDENTIFY_DEVICE_BUFFER_LENGTH,
    440             DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 0, &phys,
    441             (void **) &idata);
     440            AS_AREA_READ | AS_AREA_WRITE, 0, &phys, (void **) &idata);
    442441        if (rc != EOK) {
    443442                ddf_msg(LVL_ERROR, "Cannot allocate buffer to identify device.");
     
    562561 *
    563562 */
    564 static void ahci_set_mode_cmd(sata_dev_t *sata, uintptr_t phys, uint8_t mode)
     563static void ahci_set_mode_cmd(sata_dev_t *sata, void* phys, uint8_t mode)
    565564{
    566565        volatile sata_std_command_frame_t *cmd =
     
    568567       
    569568        cmd->fis_type = SATA_CMD_FIS_TYPE;
    570         cmd->c = SATA_CMD_FIS_COMMAND_INDICATOR;
     569        cmd->c = SATA_CMD_FIS_COMMAND_INDICATOR; 
    571570        cmd->command = 0xef;
    572571        cmd->features = 0x03;
     
    629628        }
    630629       
    631         uintptr_t phys;
     630        void *phys;
    632631        sata_identify_data_t *idata;
    633632        int rc = dmamem_map_anonymous(SATA_SET_FEATURE_BUFFER_LENGTH,
    634             DMAMEM_4GiB, AS_AREA_READ | AS_AREA_WRITE, 0, &phys,
    635             (void **) &idata);
     633            AS_AREA_READ | AS_AREA_WRITE, 0, &phys, (void **) &idata);
    636634        if (rc != EOK) {
    637635                ddf_msg(LVL_ERROR, "Cannot allocate buffer for device set mode.");
     
    679677 *
    680678 */
    681 static void ahci_rb_fpdma_cmd(sata_dev_t *sata, uintptr_t phys,
    682     uint64_t blocknum)
     679static void ahci_rb_fpdma_cmd(sata_dev_t *sata, void *phys, uint64_t blocknum)
    683680{
    684681        volatile sata_ncq_command_frame_t *cmd =
     
    737734 *
    738735 */
    739 static int ahci_rb_fpdma(sata_dev_t *sata, uintptr_t phys, uint64_t blocknum)
     736static int ahci_rb_fpdma(sata_dev_t *sata, void *phys, uint64_t blocknum)
    740737{
    741738        if (sata->is_invalid_device) {
     
    766763 *
    767764 */
    768 static void ahci_wb_fpdma_cmd(sata_dev_t *sata, uintptr_t phys,
    769     uint64_t blocknum)
     765static void ahci_wb_fpdma_cmd(sata_dev_t *sata, void *phys, uint64_t blocknum)
    770766{
    771767        volatile sata_ncq_command_frame_t *cmd =
     
    825821 *
    826822 */
    827 static int ahci_wb_fpdma(sata_dev_t *sata, uintptr_t phys, uint64_t blocknum)
     823static int ahci_wb_fpdma(sata_dev_t *sata, void *phys, uint64_t blocknum)
    828824{
    829825        if (sata->is_invalid_device) {
     
    937933{
    938934        size_t size = 4096;
    939         uintptr_t phys = 0;
     935        void *phys = NULL;
    940936        void *virt_fb = NULL;
    941937        void *virt_cmd = NULL;
     
    953949       
    954950        /* Allocate and init retfis structure. */
    955         int rc = dmamem_map_anonymous(size, DMAMEM_4GiB,
    956             AS_AREA_READ | AS_AREA_WRITE, 0, &phys, &virt_fb);
     951        int rc = dmamem_map_anonymous(size, AS_AREA_READ | AS_AREA_WRITE, 0,
     952            &phys, &virt_fb);
    957953        if (rc != EOK)
    958954                goto error_retfis;
     
    963959       
    964960        /* Allocate and init command header structure. */
    965         rc = dmamem_map_anonymous(size, DMAMEM_4GiB,
    966             AS_AREA_READ | AS_AREA_WRITE, 0, &phys, &virt_cmd);
     961        rc = dmamem_map_anonymous(size, AS_AREA_READ | AS_AREA_WRITE, 0,
     962            &phys, &virt_cmd);
    967963        if (rc != EOK)
    968964                goto error_cmd;
     
    974970       
    975971        /* Allocate and init command table structure. */
    976         rc = dmamem_map_anonymous(size, DMAMEM_4GiB,
    977             AS_AREA_READ | AS_AREA_WRITE, 0, &phys, &virt_table);
     972        rc = dmamem_map_anonymous(size, AS_AREA_READ | AS_AREA_WRITE, 0,
     973            &phys, &virt_table);
    978974        if (rc != EOK)
    979975                goto error_table;
     
    11571153        ahci->memregs = NULL;
    11581154       
    1159         physmem_map(RNGABS(hw_res_parsed.mem_ranges.ranges[0]),
     1155        physmem_map((void *) (size_t) (hw_res_parsed.mem_ranges.ranges[0].address),
    11601156            AHCI_MEMREGS_PAGES_COUNT, AS_AREA_READ | AS_AREA_WRITE,
    11611157            (void **) &ahci->memregs);
     
    11641160       
    11651161        /* Register interrupt handler */
    1166         ahci_ranges[0].base = RNGABS(hw_res_parsed.mem_ranges.ranges[0]);
     1162        ahci_ranges[0].base = (size_t) hw_res_parsed.mem_ranges.ranges[0].address;
    11671163        ahci_ranges[0].size = sizeof(ahci_memregs_t);
    11681164       
     
    11711167               
    11721168                ahci_cmds[base].addr =
    1173                     ((uint32_t *) RNGABSPTR(hw_res_parsed.mem_ranges.ranges[0])) +
     1169                    ((uint32_t *) (size_t) hw_res_parsed.mem_ranges.ranges[0].address) +
    11741170                    AHCI_PORTS_REGISTERS_OFFSET + port * AHCI_PORT_REGISTERS_SIZE +
    11751171                    AHCI_PORT_IS_REGISTER_OFFSET;
     
    11771173               
    11781174                ahci_cmds[base + 3].addr =
    1179                     ((uint32_t *) RNGABSPTR(hw_res_parsed.mem_ranges.ranges[0])) +
     1175                    ((uint32_t *) (size_t) hw_res_parsed.mem_ranges.ranges[0].address) +
    11801176                    AHCI_GHC_IS_REGISTER_OFFSET;
    11811177                ahci_cmds[base + 4].addr = ahci_cmds[base + 3].addr;
Note: See TracChangeset for help on using the changeset viewer.