* Added <sys/mman.h> header. It declares only mmap() and munmap() yet
and defines the macros needed by them.
* Renamed syscall sys_vm_map_file() to _kern_map_file() and changed the
path to an FD parameter. Changed vm_map_file() accordingly and
adjusted the kernel ELF loader and the runtime loader.
* Added syscall _kern_unmap_memory().
* Added bool unmapAddressRange parameter to vm_create_anonymous_area()
and map_backing_store(). If true and the address specification is
B_EXACT_ADDRESS, all areas in the specified address range will be
deleted (unless an area is covered only partially).
* Introduced B_SHARED_AREA flag, which is set on areas that have been
created by {vm,_user}_map_file() with REGION_NO_PRIVATE_MAP. When
fork()ing those areas won't be copied CoW, but rather be cloned. This
is needed for mmap() MAP_SHARED.
* {vm,_user}_map_file() also accept an FD argument < 0, in which case an
anonymous area is created.
* Implemented mmap() and munmap(). Currently there's the restriction
that we can't partially unmap areas. Otherwise the functions should be
rather compliant. We also support the non-POSIX extension
MAP_ANONYMOUS.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24964 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1406,7 +1406,7 @@ elf_load_user_image(const char *path, struct team *team, int flags, addr_t *entr
|
||||
B_EXACT_ADDRESS,
|
||||
fileUpperBound,
|
||||
B_READ_AREA | B_WRITE_AREA, REGION_PRIVATE_MAP,
|
||||
path, ROUNDOWN(programHeaders[i].p_offset, B_PAGE_SIZE));
|
||||
fd, ROUNDOWN(programHeaders[i].p_offset, B_PAGE_SIZE));
|
||||
if (id < B_OK) {
|
||||
dprintf("error mapping file data: %s!\n", strerror(id));
|
||||
status = B_NOT_AN_EXECUTABLE;
|
||||
@@ -1453,7 +1453,7 @@ elf_load_user_image(const char *path, struct team *team, int flags, addr_t *entr
|
||||
B_EXACT_ADDRESS,
|
||||
ROUNDUP(programHeaders[i].p_memsz + (programHeaders[i].p_vaddr % B_PAGE_SIZE), B_PAGE_SIZE),
|
||||
B_READ_AREA | B_EXECUTE_AREA, REGION_PRIVATE_MAP,
|
||||
path, ROUNDOWN(programHeaders[i].p_offset, B_PAGE_SIZE));
|
||||
fd, ROUNDOWN(programHeaders[i].p_offset, B_PAGE_SIZE));
|
||||
if (id < B_OK) {
|
||||
dprintf("error mapping file text: %s!\n", strerror(id));
|
||||
status = B_NOT_AN_EXECUTABLE;
|
||||
|
||||
Reference in New Issue
Block a user