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

Function kmem_subinit

freebsd/vm/vm_kern.c:375–393  ·  view source on GitHub ↗

* kmem_subinit: * * Initializes a map to manage a subrange * of the kernel virtual address space. * * Arguments are as follows: * * parent Map to take range from * min, max Returned endpoints of map * size Size of range to find * superpage_align Request that min is superpage aligned */

Source from the content-addressed store, hash-verified

373 * superpage_align Request that min is superpage aligned
374 */
375void
376kmem_subinit(vm_map_t map, vm_map_t parent, vm_offset_t *min, vm_offset_t *max,
377 vm_size_t size, bool superpage_align)
378{
379 int ret;
380
381 size = round_page(size);
382
383 *min = vm_map_min(parent);
384 ret = vm_map_find(parent, NULL, 0, min, size, 0, superpage_align ?
385 VMFS_SUPER_SPACE : VMFS_ANY_SPACE, VM_PROT_ALL, VM_PROT_ALL,
386 MAP_ACC_NO_CHARGE);
387 if (ret != KERN_SUCCESS)
388 panic("kmem_subinit: bad status return of %d", ret);
389 *max = *min + size;
390 vm_map_init(map, vm_map_pmap(parent), *min, *max);
391 if (vm_map_submap(parent, *min, *max, map) != KERN_SUCCESS)
392 panic("kmem_subinit: unable to change range to submap");
393}
394
395/*
396 * kmem_malloc_domain:

Callers 1

vm_ksubmap_initFunction · 0.85

Calls 6

vm_map_minFunction · 0.85
vm_map_findFunction · 0.85
vm_map_initFunction · 0.85
vm_map_pmapFunction · 0.85
vm_map_submapFunction · 0.85
panicFunction · 0.50

Tested by

no test coverage detected