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

Function xlp_simplebus_activate_resource

freebsd/mips/nlm/xlp_simplebus.c:269–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267}
268
269static int
270xlp_simplebus_activate_resource(device_t bus, device_t child, int type, int rid,
271 struct resource *r)
272{
273 void *vaddr;
274 vm_paddr_t paddr;
275 vm_size_t psize;
276
277 /*
278 * If this is a memory resource, use pmap_mapdev to map it.
279 */
280 if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) {
281 paddr = rman_get_start(r);
282 psize = rman_get_size(r);
283 vaddr = pmap_mapdev(paddr, psize);
284
285 rman_set_virtual(r, vaddr);
286 rman_set_bushandle(r, (bus_space_handle_t)(uintptr_t)vaddr);
287 }
288
289 return (rman_activate_resource(r));
290}
291
292static int
293xlp_simplebus_setup_intr(device_t dev, device_t child, struct resource *res, int flags,

Callers

nothing calls this directly

Calls 6

rman_get_startFunction · 0.85
rman_get_sizeFunction · 0.85
rman_set_virtualFunction · 0.85
rman_set_bushandleFunction · 0.85
rman_activate_resourceFunction · 0.85
pmap_mapdevFunction · 0.50

Tested by

no test coverage detected