Ignore:
File:
1 edited

Legend:

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

    raa537a5a rb7fd2a0  
    6969 *
    7070 */
    71 int physmem_map(uintptr_t phys, size_t pages, unsigned int flags, void **virt)
    72 {
    73         return __SYSCALL5(SYS_PHYSMEM_MAP, (sysarg_t) phys,
     71errno_t physmem_map(uintptr_t phys, size_t pages, unsigned int flags, void **virt)
     72{
     73        return (errno_t) __SYSCALL5(SYS_PHYSMEM_MAP, (sysarg_t) phys,
    7474            pages, flags, (sysarg_t) virt, (sysarg_t) __entry);
    7575}
     
    8585 *
    8686 */
    87 int physmem_unmap(void *virt)
    88 {
    89         return __SYSCALL1(SYS_PHYSMEM_UNMAP, (sysarg_t) virt);
     87errno_t physmem_unmap(void *virt)
     88{
     89        return (errno_t) __SYSCALL1(SYS_PHYSMEM_UNMAP, (sysarg_t) virt);
    9090}
    9191
     
    110110 *
    111111 */
    112 int dmamem_map(void *virt, size_t size, unsigned int map_flags,
     112errno_t dmamem_map(void *virt, size_t size, unsigned int map_flags,
    113113    unsigned int flags, uintptr_t *phys)
    114114{
    115         return (int) __SYSCALL6(SYS_DMAMEM_MAP, (sysarg_t) size,
     115        return (errno_t) __SYSCALL6(SYS_DMAMEM_MAP, (sysarg_t) size,
    116116            (sysarg_t) map_flags, (sysarg_t) flags & ~DMAMEM_FLAGS_ANONYMOUS,
    117117            (sysarg_t) phys, (sysarg_t) virt, 0);
     
    138138 *
    139139 */
    140 int dmamem_map_anonymous(size_t size, uintptr_t constraint,
     140errno_t dmamem_map_anonymous(size_t size, uintptr_t constraint,
    141141    unsigned int map_flags, unsigned int flags, uintptr_t *phys, void **virt)
    142142{
    143143        *phys = constraint;
    144144       
    145         return (int) __SYSCALL6(SYS_DMAMEM_MAP, (sysarg_t) size,
     145        return (errno_t) __SYSCALL6(SYS_DMAMEM_MAP, (sysarg_t) size,
    146146            (sysarg_t) map_flags, (sysarg_t) flags | DMAMEM_FLAGS_ANONYMOUS,
    147147            (sysarg_t) phys, (sysarg_t) virt, (sysarg_t) __entry);
    148148}
    149149
    150 int dmamem_unmap(void *virt, size_t size)
    151 {
    152         return __SYSCALL3(SYS_DMAMEM_UNMAP, (sysarg_t) virt, (sysarg_t) size, 0);
    153 }
    154 
    155 int dmamem_unmap_anonymous(void *virt)
    156 {
    157         return __SYSCALL3(SYS_DMAMEM_UNMAP, (sysarg_t) virt, 0,
     150errno_t dmamem_unmap(void *virt, size_t size)
     151{
     152        return (errno_t) __SYSCALL3(SYS_DMAMEM_UNMAP, (sysarg_t) virt, (sysarg_t) size, 0);
     153}
     154
     155errno_t dmamem_unmap_anonymous(void *virt)
     156{
     157        return (errno_t) __SYSCALL3(SYS_DMAMEM_UNMAP, (sysarg_t) virt, 0,
    158158            DMAMEM_FLAGS_ANONYMOUS);
    159159}
     
    173173 *
    174174 */
    175 static int iospace_enable(task_id_t id, void *ioaddr, size_t size)
     175static errno_t iospace_enable(task_id_t id, void *ioaddr, size_t size)
    176176{
    177177        const ddi_ioarg_t arg = {
     
    181181        };
    182182       
    183         return __SYSCALL1(SYS_IOSPACE_ENABLE, (sysarg_t) &arg);
     183        return (errno_t) __SYSCALL1(SYS_IOSPACE_ENABLE, (sysarg_t) &arg);
    184184}
    185185
     
    197197 *
    198198 */
    199 static int iospace_disable(task_id_t id, void *ioaddr, size_t size)
     199static errno_t iospace_disable(task_id_t id, void *ioaddr, size_t size)
    200200{
    201201        const ddi_ioarg_t arg = {
     
    205205        };
    206206       
    207         return __SYSCALL1(SYS_IOSPACE_DISABLE, (sysarg_t) &arg);
     207        return (errno_t) __SYSCALL1(SYS_IOSPACE_DISABLE, (sysarg_t) &arg);
    208208}
    209209
     
    213213 * @param virt  Virtual address for application's PIO operations.
    214214 */
    215 int pio_enable_range(addr_range_t *range, void **virt)
     215errno_t pio_enable_range(addr_range_t *range, void **virt)
    216216{
    217217        return pio_enable(RNGABSPTR(*range), RNGSZ(*range), virt);
     
    226226 *
    227227 * @return EOK on success.
    228  * @return Negative error code on failure.
    229  *
    230  */
    231 int pio_enable_resource(pio_window_t *win, hw_resource_t *res, void **virt)
     228 * @return An error code on failure.
     229 *
     230 */
     231errno_t pio_enable_resource(pio_window_t *win, hw_resource_t *res, void **virt)
    232232{
    233233        uintptr_t addr;
     
    268268 *
    269269 * @return EOK on success.
    270  * @return Negative error code on failure.
    271  *
    272  */
    273 int pio_enable(void *pio_addr, size_t size, void **virt)
     270 * @return An error code on failure.
     271 *
     272 */
     273errno_t pio_enable(void *pio_addr, size_t size, void **virt)
    274274{
    275275#ifdef IO_SPACE_BOUNDARY
     
    291291       
    292292        void *virt_page = AS_AREA_ANY;
    293         int rc = physmem_map(phys_frame, pages,
     293        errno_t rc = physmem_map(phys_frame, pages,
    294294            AS_AREA_READ | AS_AREA_WRITE, &virt_page);
    295295        if (rc != EOK)
     
    306306 *
    307307 * @return EOK on success.
    308  * @return Negative error code on failure.
    309  *
    310  */
    311 int pio_disable(void *virt, size_t size)
     308 * @return An error code on failure.
     309 *
     310 */
     311errno_t pio_disable(void *virt, size_t size)
    312312{
    313313#ifdef IO_SPACE_BOUNDARY
Note: See TracChangeset for help on using the changeset viewer.