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

Function kva_import

freebsd/vm/vm_kern.c:702–720  ·  view source on GitHub ↗

* Import KVA from the kernel map into the kernel arena. */

Source from the content-addressed store, hash-verified

700 * Import KVA from the kernel map into the kernel arena.
701 */
702static int
703kva_import(void *unused, vmem_size_t size, int flags, vmem_addr_t *addrp)
704{
705 vm_offset_t addr;
706 int result;
707
708 KASSERT((size % KVA_QUANTUM) == 0,
709 ("kva_import: Size %jd is not a multiple of %d",
710 (intmax_t)size, (int)KVA_QUANTUM));
711 addr = vm_map_min(kernel_map);
712 result = vm_map_find(kernel_map, NULL, 0, &addr, size, 0,
713 VMFS_SUPER_SPACE, VM_PROT_ALL, VM_PROT_ALL, MAP_NOFAULT);
714 if (result != KERN_SUCCESS)
715 return (ENOMEM);
716
717 *addrp = addr;
718
719 return (0);
720}
721
722/*
723 * Import KVA from a parent arena into a per-domain arena. Imports must be

Callers

nothing calls this directly

Calls 2

vm_map_minFunction · 0.85
vm_map_findFunction · 0.85

Tested by

no test coverage detected