MCPcopy Index your code
hub / github.com/F-Stack/f-stack / vmspace_alloc

Function vmspace_alloc

freebsd/vm/vm_map.c:324–347  ·  view source on GitHub ↗

* Allocate a vmspace structure, including a vm_map and pmap, * and initialize those structures. The refcnt is set to 1. */

Source from the content-addressed store, hash-verified

322 * and initialize those structures. The refcnt is set to 1.
323 */
324struct vmspace *
325vmspace_alloc(vm_offset_t min, vm_offset_t max, pmap_pinit_t pinit)
326{
327 struct vmspace *vm;
328
329 vm = uma_zalloc(vmspace_zone, M_WAITOK);
330 KASSERT(vm->vm_map.pmap == NULL, ("vm_map.pmap must be NULL"));
331 if (!pinit(vmspace_pmap(vm))) {
332 uma_zfree(vmspace_zone, vm);
333 return (NULL);
334 }
335 CTR1(KTR_VM, "vmspace_alloc: %p", vm);
336 _vm_map_init(&vm->vm_map, vmspace_pmap(vm), min, max);
337 refcount_init(&vm->vm_refcnt, 1);
338 vm->vm_shm = NULL;
339 vm->vm_swrss = 0;
340 vm->vm_tsize = 0;
341 vm->vm_dsize = 0;
342 vm->vm_ssize = 0;
343 vm->vm_taddr = 0;
344 vm->vm_daddr = 0;
345 vm->vm_maxsaddr = 0;
346 return (vm);
347}
348
349#ifdef RACCT
350static void

Callers 4

svm_npt_allocFunction · 0.85
ept_vmspace_allocFunction · 0.85
vmspace_forkFunction · 0.85
vmspace_execFunction · 0.85

Calls 5

vmspace_pmapFunction · 0.85
_vm_map_initFunction · 0.85
refcount_initFunction · 0.85
uma_zallocFunction · 0.70
uma_zfreeFunction · 0.70

Tested by

no test coverage detected