Changes in kernel/generic/src/ddi/ddi.c [5a5269d:8df5f20] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ddi/ddi.c
r5a5269d r8df5f20 46 46 #include <mm/frame.h> 47 47 #include <mm/as.h> 48 #include <mm/km.h>49 48 #include <mm/page.h> 50 49 #include <synch/mutex.h> … … 57 56 #include <trace.h> 58 57 #include <bitops.h> 59 #include <arch/asm.h>60 58 61 59 /** This lock protects the @c pareas ordered dictionary. */ … … 248 246 */ 249 247 sys_errno_t sys_physmem_map(uintptr_t phys, size_t pages, unsigned int flags, 250 uspace_ptr_uintptr_tvirt_ptr, uintptr_t bound)248 void *virt_ptr, uintptr_t bound) 251 249 { 252 250 uintptr_t virt; … … 262 260 rc = copy_to_uspace(virt_ptr, &virt, sizeof(virt)); 263 261 if (rc != EOK) { 264 physmem_unmap( virt);262 physmem_unmap((uintptr_t) virt); 265 263 return rc; 266 264 } … … 393 391 * 394 392 */ 395 sys_errno_t sys_iospace_enable( uspace_ptr_ddi_ioarg_tuspace_io_arg)393 sys_errno_t sys_iospace_enable(ddi_ioarg_t *uspace_io_arg) 396 394 { 397 395 ddi_ioarg_t arg; … … 404 402 } 405 403 406 sys_errno_t sys_iospace_disable( uspace_ptr_ddi_ioarg_tuspace_io_arg)404 sys_errno_t sys_iospace_disable(ddi_ioarg_t *uspace_io_arg) 407 405 { 408 406 ddi_ioarg_t arg; … … 465 463 466 464 sys_errno_t sys_dmamem_map(size_t size, unsigned int map_flags, unsigned int flags, 467 uspace_ptr_uintptr_t phys_ptr, uspace_ptr_uintptr_tvirt_ptr, uintptr_t bound)465 void *phys_ptr, void *virt_ptr, uintptr_t bound) 468 466 { 469 467 if ((flags & DMAMEM_FLAGS_ANONYMOUS) == 0) { … … 473 471 474 472 uintptr_t phys; 475 errno_t rc = dmamem_map( virt_ptr, size, map_flags,473 errno_t rc = dmamem_map((uintptr_t) virt_ptr, size, map_flags, 476 474 flags, &phys); 477 475 … … 481 479 rc = copy_to_uspace(phys_ptr, &phys, sizeof(phys)); 482 480 if (rc != EOK) { 483 dmamem_unmap( virt_ptr, size);481 dmamem_unmap((uintptr_t) virt_ptr, size); 484 482 return rc; 485 483 } … … 508 506 rc = copy_to_uspace(phys_ptr, &phys, sizeof(phys)); 509 507 if (rc != EOK) { 510 dmamem_unmap_anonymous( virt);508 dmamem_unmap_anonymous((uintptr_t) virt); 511 509 return rc; 512 510 } … … 514 512 rc = copy_to_uspace(virt_ptr, &virt, sizeof(virt)); 515 513 if (rc != EOK) { 516 dmamem_unmap_anonymous( virt);514 dmamem_unmap_anonymous((uintptr_t) virt); 517 515 return rc; 518 516 } … … 529 527 return dmamem_unmap_anonymous(virt); 530 528 } 531 void *pio_map(void *phys, size_t size)532 {533 #ifdef IO_SPACE_BOUNDARY534 if (phys < IO_SPACE_BOUNDARY)535 return phys;536 #endif537 return (void *) km_map((uintptr_t) phys, size, KM_NATURAL_ALIGNMENT,538 PAGE_READ | PAGE_WRITE | PAGE_NOT_CACHEABLE);539 }540 541 void pio_unmap(void *phys, void *virt, size_t size)542 {543 #ifdef IO_SPACE_BOUNDARY544 if (phys < IO_SPACE_BOUNDARY)545 return;546 #endif547 km_unmap((uintptr_t) virt, size);548 }549 529 550 530 /** @}
Note:
See TracChangeset
for help on using the changeset viewer.