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

Function nexus_activate_resource

freebsd/mips/mips/nexus.c:418–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

416}
417
418static int
419nexus_activate_resource(device_t bus, device_t child, int type, int rid,
420 struct resource *r)
421{
422 void *vaddr;
423 vm_paddr_t paddr;
424 vm_size_t psize;
425 int err;
426
427 /*
428 * If this is a memory resource, use pmap_mapdev to map it.
429 */
430 if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) {
431 paddr = rman_get_start(r);
432 psize = rman_get_size(r);
433 rman_set_bustag(r, mips_bus_space_generic);
434 err = bus_space_map(rman_get_bustag(r), paddr, psize, 0,
435 (bus_space_handle_t *)&vaddr);
436 if (err != 0) {
437 rman_deactivate_resource(r);
438 return (err);
439 }
440 rman_set_virtual(r, vaddr);
441 rman_set_bushandle(r, (bus_space_handle_t)(uintptr_t)vaddr);
442 } else if (type == SYS_RES_IRQ) {
443#ifdef INTRNG
444 err = mips_pic_activate_intr(child, r);
445 if (err != 0) {
446 rman_deactivate_resource(r);
447 return (err);
448 }
449#endif
450 }
451
452 return (rman_activate_resource(r));
453}
454
455static int
456nexus_deactivate_resource(device_t bus, device_t child, int type, int rid,

Callers

nothing calls this directly

Calls 10

rman_get_startFunction · 0.85
rman_get_sizeFunction · 0.85
rman_set_bustagFunction · 0.85
bus_space_mapFunction · 0.85
rman_get_bustagFunction · 0.85
rman_deactivate_resourceFunction · 0.85
rman_set_virtualFunction · 0.85
rman_set_bushandleFunction · 0.85
mips_pic_activate_intrFunction · 0.85
rman_activate_resourceFunction · 0.85

Tested by

no test coverage detected