Changes in kernel/generic/src/ddi/ddi.c [a53ed3a:14741a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ddi/ddi.c
ra53ed3a r14741a0 104 104 * 105 105 */ 106 NO_TRACE static errno_t physmem_map(uintptr_t phys, size_t pages,106 NO_TRACE static int physmem_map(uintptr_t phys, size_t pages, 107 107 unsigned int flags, uintptr_t *virt, uintptr_t bound) 108 108 { … … 210 210 } 211 211 212 NO_TRACE static errno_t physmem_unmap(uintptr_t virt)212 NO_TRACE static int physmem_unmap(uintptr_t virt) 213 213 { 214 214 assert(TASK); … … 228 228 * 229 229 */ 230 sys _errno_t sys_physmem_map(uintptr_t phys, size_t pages, unsigned int flags,230 sysarg_t sys_physmem_map(uintptr_t phys, size_t pages, unsigned int flags, 231 231 void *virt_ptr, uintptr_t bound) 232 232 { 233 233 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)); 235 235 if (rc != EOK) 236 236 return rc; … … 250 250 } 251 251 252 sys _errno_t sys_physmem_unmap(uintptr_t virt)252 sysarg_t sys_physmem_unmap(uintptr_t virt) 253 253 { 254 254 return physmem_unmap(virt); … … 265 265 * 266 266 */ 267 NO_TRACE static errno_t iospace_enable(task_id_t id, uintptr_t ioaddr, size_t size)267 NO_TRACE static int iospace_enable(task_id_t id, uintptr_t ioaddr, size_t size) 268 268 { 269 269 /* … … 290 290 /* Lock the task and release the lock protecting tasks_btree. */ 291 291 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); 293 293 irq_spinlock_unlock(&task->lock, true); 294 294 … … 306 306 * 307 307 */ 308 NO_TRACE static errno_t iospace_disable(task_id_t id, uintptr_t ioaddr, size_t size)308 NO_TRACE static int iospace_disable(task_id_t id, uintptr_t ioaddr, size_t size) 309 309 { 310 310 /* … … 331 331 /* Lock the task and release the lock protecting tasks_btree. */ 332 332 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); 334 334 irq_spinlock_unlock(&task->lock, true); 335 335 … … 344 344 * 345 345 */ 346 sys _errno_t sys_iospace_enable(ddi_ioarg_t *uspace_io_arg)346 sysarg_t sys_iospace_enable(ddi_ioarg_t *uspace_io_arg) 347 347 { 348 348 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, 354 354 (uintptr_t) arg.ioaddr, (size_t) arg.size); 355 355 } 356 356 357 sys _errno_t sys_iospace_disable(ddi_ioarg_t *uspace_io_arg)357 sysarg_t sys_iospace_disable(ddi_ioarg_t *uspace_io_arg) 358 358 { 359 359 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, 365 365 (uintptr_t) arg.ioaddr, (size_t) arg.size); 366 366 } 367 367 368 NO_TRACE static errno_t dmamem_map(uintptr_t virt, size_t size, unsigned int map_flags,368 NO_TRACE static int dmamem_map(uintptr_t virt, size_t size, unsigned int map_flags, 369 369 unsigned int flags, uintptr_t *phys) 370 370 { … … 375 375 } 376 376 377 NO_TRACE static errno_t dmamem_map_anonymous(size_t size, uintptr_t constraint,377 NO_TRACE static int dmamem_map_anonymous(size_t size, uintptr_t constraint, 378 378 unsigned int map_flags, unsigned int flags, uintptr_t *phys, 379 379 uintptr_t *virt, uintptr_t bound) … … 403 403 } 404 404 405 NO_TRACE static errno_t dmamem_unmap(uintptr_t virt, size_t size)405 NO_TRACE static int dmamem_unmap(uintptr_t virt, size_t size) 406 406 { 407 407 // TODO: implement unlocking & unmap … … 409 409 } 410 410 411 NO_TRACE static errno_t dmamem_unmap_anonymous(uintptr_t virt)411 NO_TRACE static int dmamem_unmap_anonymous(uintptr_t virt) 412 412 { 413 413 return as_area_destroy(TASK->as, virt); 414 414 } 415 415 416 sys _errno_t sys_dmamem_map(size_t size, unsigned int map_flags, unsigned int flags,416 sysarg_t sys_dmamem_map(size_t size, unsigned int map_flags, unsigned int flags, 417 417 void *phys_ptr, void *virt_ptr, uintptr_t bound) 418 418 { … … 423 423 424 424 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, 426 426 flags, &phys); 427 427 … … 440 440 441 441 uintptr_t constraint; 442 errno_t rc = copy_from_uspace(&constraint, phys_ptr,442 int rc = copy_from_uspace(&constraint, phys_ptr, 443 443 sizeof(constraint)); 444 444 if (rc != EOK) … … 472 472 } 473 473 474 sys _errno_t sys_dmamem_unmap(uintptr_t virt, size_t size, unsigned int flags)474 sysarg_t sys_dmamem_unmap(uintptr_t virt, size_t size, unsigned int flags) 475 475 { 476 476 if ((flags & DMAMEM_FLAGS_ANONYMOUS) == 0)
Note:
See TracChangeset
for help on using the changeset viewer.