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

Function vm_map_fixed

freebsd/vm/vm_map.c:1975–2004  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1973}
1974
1975int
1976vm_map_fixed(vm_map_t map, vm_object_t object, vm_ooffset_t offset,
1977 vm_offset_t start, vm_size_t length, vm_prot_t prot,
1978 vm_prot_t max, int cow)
1979{
1980 vm_offset_t end;
1981 int result;
1982
1983 end = start + length;
1984 KASSERT((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0 ||
1985 object == NULL,
1986 ("vm_map_fixed: non-NULL backing object for stack"));
1987 vm_map_lock(map);
1988 VM_MAP_RANGE_CHECK(map, start, end);
1989 if ((cow & MAP_CHECK_EXCL) == 0) {
1990 result = vm_map_delete(map, start, end);
1991 if (result != KERN_SUCCESS)
1992 goto out;
1993 }
1994 if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) != 0) {
1995 result = vm_map_stack_locked(map, start, length, sgrowsiz,
1996 prot, max, cow);
1997 } else {
1998 result = vm_map_insert(map, object, offset, start, end,
1999 prot, max, cow);
2000 }
2001out:
2002 vm_map_unlock(map);
2003 return (result);
2004}
2005
2006static const int aslr_pages_rnd_64[2] = {0x1000, 0x10};
2007static const int aslr_pages_rnd_32[2] = {0x100, 0x4};

Callers 4

exec_new_vmspaceFunction · 0.85
__elfN(map_partial)Function · 0.85
__elfN(map_insert)Function · 0.85
vm_mmap_objectFunction · 0.85

Calls 3

vm_map_deleteFunction · 0.85
vm_map_stack_lockedFunction · 0.85
vm_map_insertFunction · 0.85

Tested by

no test coverage detected