| 387 | } |
| 388 | |
| 389 | static int |
| 390 | nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, |
| 391 | struct resource *r) |
| 392 | { |
| 393 | bus_size_t psize; |
| 394 | bus_space_handle_t vaddr; |
| 395 | |
| 396 | if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { |
| 397 | psize = (bus_size_t)rman_get_size(r); |
| 398 | vaddr = rman_get_bushandle(r); |
| 399 | |
| 400 | if (vaddr != 0) { |
| 401 | #ifdef FDT |
| 402 | bus_space_unmap(fdtbus_bs_tag, vaddr, psize); |
| 403 | #else |
| 404 | pmap_unmapdev((vm_offset_t)vaddr, (vm_size_t)psize); |
| 405 | #endif |
| 406 | rman_set_virtual(r, NULL); |
| 407 | rman_set_bushandle(r, 0); |
| 408 | } |
| 409 | } else if (type == SYS_RES_IRQ) { |
| 410 | intr_deactivate_irq(child, r); |
| 411 | } |
| 412 | |
| 413 | return (rman_deactivate_resource(r)); |
| 414 | } |
| 415 | |
| 416 | #ifdef FDT |
| 417 | static int |
nothing calls this directly
no test coverage detected