Changes in kernel/generic/src/ddi/ddi.c [6f7071b:46e886f] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ddi/ddi.c
r6f7071b r46e886f 46 46 #include <mm/frame.h> 47 47 #include <mm/as.h> 48 #include <mm/km.h> 48 49 #include <mm/page.h> 49 50 #include <synch/mutex.h> … … 56 57 #include <trace.h> 57 58 #include <bitops.h> 59 #include <arch/asm.h> 58 60 59 61 /** This lock protects the @c pareas ordered dictionary. */ … … 121 123 * 122 124 */ 123 NO_TRACE static errno_t physmem_map(uintptr_t phys, size_t pages,125 _NO_TRACE static errno_t physmem_map(uintptr_t phys, size_t pages, 124 126 unsigned int flags, uintptr_t *virt, uintptr_t bound) 125 127 { … … 227 229 } 228 230 229 NO_TRACE static errno_t physmem_unmap(uintptr_t virt)231 _NO_TRACE static errno_t physmem_unmap(uintptr_t virt) 230 232 { 231 233 assert(TASK); … … 312 314 * 313 315 */ 314 NO_TRACE static errno_t iospace_enable(task_id_t id, uintptr_t ioaddr, size_t size)316 _NO_TRACE static errno_t iospace_enable(task_id_t id, uintptr_t ioaddr, size_t size) 315 317 { 316 318 /* … … 353 355 * 354 356 */ 355 NO_TRACE static errno_t iospace_disable(task_id_t id, uintptr_t ioaddr, size_t size)357 _NO_TRACE static errno_t iospace_disable(task_id_t id, uintptr_t ioaddr, size_t size) 356 358 { 357 359 /* … … 413 415 } 414 416 415 NO_TRACE static errno_t dmamem_map(uintptr_t virt, size_t size, unsigned int map_flags,417 _NO_TRACE static errno_t dmamem_map(uintptr_t virt, size_t size, unsigned int map_flags, 416 418 unsigned int flags, uintptr_t *phys) 417 419 { … … 422 424 } 423 425 424 NO_TRACE static errno_t dmamem_map_anonymous(size_t size, uintptr_t constraint,426 _NO_TRACE static errno_t dmamem_map_anonymous(size_t size, uintptr_t constraint, 425 427 unsigned int map_flags, unsigned int flags, uintptr_t *phys, 426 428 uintptr_t *virt, uintptr_t bound) … … 451 453 } 452 454 453 NO_TRACE static errno_t dmamem_unmap(uintptr_t virt, size_t size)455 _NO_TRACE static errno_t dmamem_unmap(uintptr_t virt, size_t size) 454 456 { 455 457 // TODO: implement unlocking & unmap … … 457 459 } 458 460 459 NO_TRACE static errno_t dmamem_unmap_anonymous(uintptr_t virt)461 _NO_TRACE static errno_t dmamem_unmap_anonymous(uintptr_t virt) 460 462 { 461 463 return as_area_destroy(TASK->as, virt); … … 527 529 return dmamem_unmap_anonymous(virt); 528 530 } 531 void *pio_map(void *phys, size_t size) 532 { 533 #ifdef IO_SPACE_BOUNDARY 534 if (phys < IO_SPACE_BOUNDARY) 535 return phys; 536 #endif 537 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_BOUNDARY 544 if (phys < IO_SPACE_BOUNDARY) 545 return; 546 #endif 547 km_unmap((uintptr_t) virt, size); 548 } 529 549 530 550 /** @}
Note:
See TracChangeset
for help on using the changeset viewer.