MCPcopy Create free account
hub / github.com/F-Stack/f-stack / nexus_deactivate_resource

Function nexus_deactivate_resource

freebsd/arm/arm/nexus.c:389–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

387}
388
389static int
390nexus_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
417static int

Callers

nothing calls this directly

Calls 8

rman_get_sizeFunction · 0.85
rman_get_bushandleFunction · 0.85
bus_space_unmapFunction · 0.85
rman_set_virtualFunction · 0.85
rman_set_bushandleFunction · 0.85
intr_deactivate_irqFunction · 0.85
rman_deactivate_resourceFunction · 0.85
pmap_unmapdevFunction · 0.50

Tested by

no test coverage detected