Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ddi/ddi.c

    ra53ed3a r14741a0  
    104104 *
    105105 */
    106 NO_TRACE static errno_t physmem_map(uintptr_t phys, size_t pages,
     106NO_TRACE static int physmem_map(uintptr_t phys, size_t pages,
    107107    unsigned int flags, uintptr_t *virt, uintptr_t bound)
    108108{
     
    210210}
    211211
    212 NO_TRACE static errno_t physmem_unmap(uintptr_t virt)
     212NO_TRACE static int physmem_unmap(uintptr_t virt)
    213213{
    214214        assert(TASK);
     
    228228 *
    229229 */
    230 sys_errno_t sys_physmem_map(uintptr_t phys, size_t pages, unsigned int flags,
     230sysarg_t sys_physmem_map(uintptr_t phys, size_t pages, unsigned int flags,
    231231    void *virt_ptr, uintptr_t bound)
    232232{
    233233        uintptr_t virt;
    234         errno_t rc = copy_from_uspace(&virt, virt_ptr, sizeof(virt));
     234        int rc = copy_from_uspace(&virt, virt_ptr, sizeof(virt));
    235235        if (rc != EOK)
    236236                return rc;
     
    250250}
    251251
    252 sys_errno_t sys_physmem_unmap(uintptr_t virt)
     252sysarg_t sys_physmem_unmap(uintptr_t virt)
    253253{
    254254        return physmem_unmap(virt);
     
    265265 *
    266266 */
    267 NO_TRACE static errno_t iospace_enable(task_id_t id, uintptr_t ioaddr, size_t size)
     267NO_TRACE static int iospace_enable(task_id_t id, uintptr_t ioaddr, size_t size)
    268268{
    269269        /*
     
    290290        /* Lock the task and release the lock protecting tasks_btree. */
    291291        irq_spinlock_exchange(&tasks_lock, &task->lock);
    292         errno_t rc = ddi_iospace_enable_arch(task, ioaddr, size);
     292        int rc = ddi_iospace_enable_arch(task, ioaddr, size);
    293293        irq_spinlock_unlock(&task->lock, true);
    294294
     
    306306 *
    307307 */
    308 NO_TRACE static errno_t iospace_disable(task_id_t id, uintptr_t ioaddr, size_t size)
     308NO_TRACE static int iospace_disable(task_id_t id, uintptr_t ioaddr, size_t size)
    309309{
    310310        /*
     
    331331        /* Lock the task and release the lock protecting tasks_btree. */
    332332        irq_spinlock_exchange(&tasks_lock, &task->lock);
    333         errno_t rc = ddi_iospace_disable_arch(task, ioaddr, size);
     333        int rc = ddi_iospace_disable_arch(task, ioaddr, size);
    334334        irq_spinlock_unlock(&task->lock, true);
    335335       
     
    344344 *
    345345 */
    346 sys_errno_t sys_iospace_enable(ddi_ioarg_t *uspace_io_arg)
     346sysarg_t sys_iospace_enable(ddi_ioarg_t *uspace_io_arg)
    347347{
    348348        ddi_ioarg_t arg;
    349         errno_t rc = copy_from_uspace(&arg, uspace_io_arg, sizeof(ddi_ioarg_t));
    350         if (rc != EOK)
    351                 return (sys_errno_t) rc;
    352        
    353         return (sys_errno_t) iospace_enable((task_id_t) arg.task_id,
     349        int rc = copy_from_uspace(&arg, uspace_io_arg, sizeof(ddi_ioarg_t));
     350        if (rc != 0)
     351                return (sysarg_t) rc;
     352       
     353        return (sysarg_t) iospace_enable((task_id_t) arg.task_id,
    354354            (uintptr_t) arg.ioaddr, (size_t) arg.size);
    355355}
    356356
    357 sys_errno_t sys_iospace_disable(ddi_ioarg_t *uspace_io_arg)
     357sysarg_t sys_iospace_disable(ddi_ioarg_t *uspace_io_arg)
    358358{
    359359        ddi_ioarg_t arg;
    360         errno_t rc = copy_from_uspace(&arg, uspace_io_arg, sizeof(ddi_ioarg_t));
    361         if (rc != EOK)
    362                 return (sys_errno_t) rc;
    363 
    364         return (sys_errno_t) iospace_disable((task_id_t) arg.task_id,
     360        int rc = copy_from_uspace(&arg, uspace_io_arg, sizeof(ddi_ioarg_t));
     361        if (rc != 0)
     362                return (sysarg_t) rc;
     363
     364        return (sysarg_t) iospace_disable((task_id_t) arg.task_id,
    365365            (uintptr_t) arg.ioaddr, (size_t) arg.size);
    366366}
    367367
    368 NO_TRACE static errno_t dmamem_map(uintptr_t virt, size_t size, unsigned int map_flags,
     368NO_TRACE static int dmamem_map(uintptr_t virt, size_t size, unsigned int map_flags,
    369369    unsigned int flags, uintptr_t *phys)
    370370{
     
    375375}
    376376
    377 NO_TRACE static errno_t dmamem_map_anonymous(size_t size, uintptr_t constraint,
     377NO_TRACE static int dmamem_map_anonymous(size_t size, uintptr_t constraint,
    378378    unsigned int map_flags, unsigned int flags, uintptr_t *phys,
    379379    uintptr_t *virt, uintptr_t bound)
     
    403403}
    404404
    405 NO_TRACE static errno_t dmamem_unmap(uintptr_t virt, size_t size)
     405NO_TRACE static int dmamem_unmap(uintptr_t virt, size_t size)
    406406{
    407407        // TODO: implement unlocking & unmap
     
    409409}
    410410
    411 NO_TRACE static errno_t dmamem_unmap_anonymous(uintptr_t virt)
     411NO_TRACE static int dmamem_unmap_anonymous(uintptr_t virt)
    412412{
    413413        return as_area_destroy(TASK->as, virt);
    414414}
    415415
    416 sys_errno_t sys_dmamem_map(size_t size, unsigned int map_flags, unsigned int flags,
     416sysarg_t sys_dmamem_map(size_t size, unsigned int map_flags, unsigned int flags,
    417417    void *phys_ptr, void *virt_ptr, uintptr_t bound)
    418418{
     
    423423               
    424424                uintptr_t phys;
    425                 errno_t rc = dmamem_map((uintptr_t) virt_ptr, size, map_flags,
     425                int rc = dmamem_map((uintptr_t) virt_ptr, size, map_flags,
    426426                    flags, &phys);
    427427               
     
    440440               
    441441                uintptr_t constraint;
    442                 errno_t rc = copy_from_uspace(&constraint, phys_ptr,
     442                int rc = copy_from_uspace(&constraint, phys_ptr,
    443443                    sizeof(constraint));
    444444                if (rc != EOK)
     
    472472}
    473473
    474 sys_errno_t sys_dmamem_unmap(uintptr_t virt, size_t size, unsigned int flags)
     474sysarg_t sys_dmamem_unmap(uintptr_t virt, size_t size, unsigned int flags)
    475475{
    476476        if ((flags & DMAMEM_FLAGS_ANONYMOUS) == 0)
Note: See TracChangeset for help on using the changeset viewer.