Changes in uspace/lib/c/generic/ddi.c [aa537a5a:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/ddi.c
raa537a5a rb7fd2a0 69 69 * 70 70 */ 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,71 errno_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, 74 74 pages, flags, (sysarg_t) virt, (sysarg_t) __entry); 75 75 } … … 85 85 * 86 86 */ 87 int physmem_unmap(void *virt)88 { 89 return __SYSCALL1(SYS_PHYSMEM_UNMAP, (sysarg_t) virt);87 errno_t physmem_unmap(void *virt) 88 { 89 return (errno_t) __SYSCALL1(SYS_PHYSMEM_UNMAP, (sysarg_t) virt); 90 90 } 91 91 … … 110 110 * 111 111 */ 112 int dmamem_map(void *virt, size_t size, unsigned int map_flags,112 errno_t dmamem_map(void *virt, size_t size, unsigned int map_flags, 113 113 unsigned int flags, uintptr_t *phys) 114 114 { 115 return ( int) __SYSCALL6(SYS_DMAMEM_MAP, (sysarg_t) size,115 return (errno_t) __SYSCALL6(SYS_DMAMEM_MAP, (sysarg_t) size, 116 116 (sysarg_t) map_flags, (sysarg_t) flags & ~DMAMEM_FLAGS_ANONYMOUS, 117 117 (sysarg_t) phys, (sysarg_t) virt, 0); … … 138 138 * 139 139 */ 140 int dmamem_map_anonymous(size_t size, uintptr_t constraint,140 errno_t dmamem_map_anonymous(size_t size, uintptr_t constraint, 141 141 unsigned int map_flags, unsigned int flags, uintptr_t *phys, void **virt) 142 142 { 143 143 *phys = constraint; 144 144 145 return ( int) __SYSCALL6(SYS_DMAMEM_MAP, (sysarg_t) size,145 return (errno_t) __SYSCALL6(SYS_DMAMEM_MAP, (sysarg_t) size, 146 146 (sysarg_t) map_flags, (sysarg_t) flags | DMAMEM_FLAGS_ANONYMOUS, 147 147 (sysarg_t) phys, (sysarg_t) virt, (sysarg_t) __entry); 148 148 } 149 149 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,150 errno_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 155 errno_t dmamem_unmap_anonymous(void *virt) 156 { 157 return (errno_t) __SYSCALL3(SYS_DMAMEM_UNMAP, (sysarg_t) virt, 0, 158 158 DMAMEM_FLAGS_ANONYMOUS); 159 159 } … … 173 173 * 174 174 */ 175 static int iospace_enable(task_id_t id, void *ioaddr, size_t size)175 static errno_t iospace_enable(task_id_t id, void *ioaddr, size_t size) 176 176 { 177 177 const ddi_ioarg_t arg = { … … 181 181 }; 182 182 183 return __SYSCALL1(SYS_IOSPACE_ENABLE, (sysarg_t) &arg);183 return (errno_t) __SYSCALL1(SYS_IOSPACE_ENABLE, (sysarg_t) &arg); 184 184 } 185 185 … … 197 197 * 198 198 */ 199 static int iospace_disable(task_id_t id, void *ioaddr, size_t size)199 static errno_t iospace_disable(task_id_t id, void *ioaddr, size_t size) 200 200 { 201 201 const ddi_ioarg_t arg = { … … 205 205 }; 206 206 207 return __SYSCALL1(SYS_IOSPACE_DISABLE, (sysarg_t) &arg);207 return (errno_t) __SYSCALL1(SYS_IOSPACE_DISABLE, (sysarg_t) &arg); 208 208 } 209 209 … … 213 213 * @param virt Virtual address for application's PIO operations. 214 214 */ 215 int pio_enable_range(addr_range_t *range, void **virt)215 errno_t pio_enable_range(addr_range_t *range, void **virt) 216 216 { 217 217 return pio_enable(RNGABSPTR(*range), RNGSZ(*range), virt); … … 226 226 * 227 227 * @return EOK on success. 228 * @return Negativeerror 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 */ 231 errno_t pio_enable_resource(pio_window_t *win, hw_resource_t *res, void **virt) 232 232 { 233 233 uintptr_t addr; … … 268 268 * 269 269 * @return EOK on success. 270 * @return Negativeerror 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 */ 273 errno_t pio_enable(void *pio_addr, size_t size, void **virt) 274 274 { 275 275 #ifdef IO_SPACE_BOUNDARY … … 291 291 292 292 void *virt_page = AS_AREA_ANY; 293 int rc = physmem_map(phys_frame, pages,293 errno_t rc = physmem_map(phys_frame, pages, 294 294 AS_AREA_READ | AS_AREA_WRITE, &virt_page); 295 295 if (rc != EOK) … … 306 306 * 307 307 * @return EOK on success. 308 * @return Negativeerror code on failure.309 * 310 */ 311 int pio_disable(void *virt, size_t size)308 * @return An error code on failure. 309 * 310 */ 311 errno_t pio_disable(void *virt, size_t size) 312 312 { 313 313 #ifdef IO_SPACE_BOUNDARY
Note:
See TracChangeset
for help on using the changeset viewer.