* Unmap device memory and free the kva space. */
| 325 | * Unmap device memory and free the kva space. |
| 326 | */ |
| 327 | void |
| 328 | pmap_unmapdev(vm_offset_t va, vm_size_t size) |
| 329 | { |
| 330 | vm_offset_t offset; |
| 331 | |
| 332 | /* Nothing to do if we find the mapping in the static table. */ |
| 333 | if (devmap_vtop((void*)va, size) != DEVMAP_PADDR_NOTFOUND) |
| 334 | return; |
| 335 | |
| 336 | offset = va & PAGE_MASK; |
| 337 | va = trunc_page(va); |
| 338 | size = round_page(size + offset); |
| 339 | |
| 340 | pmap_kremove_device(va, size); |
| 341 | kva_free(va, size); |
| 342 | } |
| 343 | |
| 344 | #ifdef DDB |
| 345 | #include <ddb/ddb.h> |
nothing calls this directly
no test coverage detected