Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/ddi.c

    r848e880f ra69d42e  
    220220/** Enable PIO for specified HW resource wrt. to the PIO window.
    221221 *
    222  * @param win        PIO window. May be NULL if the resources are known to be
    223  *                   absolute.
    224  * @param res        Resources specifying the I/O range wrt. to the PIO window.
    225  * @param[out] virt  Virtual address for application's PIO operations.
    226  * @param[out] phys  If non-NULL, physical address of the resource
    227  * @param[out] size  If non-NULL, size of the enabled resource.
     222 * @param win      PIO window. May be NULL if the resources are known to be
     223 *                 absolute.
     224 * @param res      Resources specifying the I/O range wrt. to the PIO window.
     225 * @param virt     Virtual address for application's PIO operations.
    228226 *
    229227 * @return EOK on success.
     
    231229 *
    232230 */
    233 errno_t pio_enable_resource(pio_window_t *win, hw_resource_t *res, void **virt,
    234     uintptr_t *phys, size_t *size)
     231errno_t pio_enable_resource(pio_window_t *win, hw_resource_t *res, void **virt)
    235232{
    236233        uintptr_t addr;
    237         size_t sz;
     234        size_t size;
    238235
    239236        switch (res->type) {
     
    245242                        addr += win->io.base;
    246243                }
    247                 sz = res->res.io_range.size;
     244                size = res->res.io_range.size;
    248245                break;
    249246        case MEM_RANGE:
     
    254251                        addr += win->mem.base;
    255252                }
    256                 sz = res->res.mem_range.size;
     253                size = res->res.mem_range.size;
    257254                break;
    258255        default:
     
    260257        }
    261258
    262         if (phys)
    263                 *phys = addr;
    264         if (size)
    265                 *size = sz;
    266 
    267         return pio_enable((void *) addr, sz, virt);
     259        return pio_enable((void *) addr, size, virt);
    268260}
    269261
Note: See TracChangeset for help on using the changeset viewer.