MOS Source Code
|
#include "mos/platform/platform.h"
#include <mos/mm/paging/paging.h>
#include <mos/tasks/task_types.h>
#include <mos/types.h>
Go to the source code of this file.
Functions | |
ptr_t | mmap_anonymous (mm_context_t *ctx, ptr_t hint_addr, mmap_flags_t flags, vm_flags vm_flags, size_t n_pages) |
Map a page into the current process's address space. | |
ptr_t | mmap_file (mm_context_t *ctx, ptr_t hint_addr, mmap_flags_t flags, vm_flags vm_flags, size_t n_pages, io_t *io, off_t offset) |
Map a file into the current process's address space. | |
bool | munmap (ptr_t addr, size_t size) |
Unmap a page from the current process's address space. | |
bool | vm_protect (mm_context_t *mmctx, ptr_t addr, size_t size, vm_flags perm) |
Change the permissions of a mapping. | |
ptr_t mmap_anonymous | ( | mm_context_t * | ctx, |
ptr_t | hint_addr, | ||
mmap_flags_t | flags, | ||
vm_flags | vm_flags, | ||
size_t | n_pages ) |
Map a page into the current process's address space.
ctx | The memory management context |
hint_addr | A hint for the address to map the page at, the actual address is determined based on the flags |
flags | Flags to control the mapping, see mmap_flags_t |
vm_flags | Flags to control the permissions of the mapping, see vm_flags |
n_pages | Number of pages to map |
Definition at line 54 of file mmap.c.
ptr_t mmap_file | ( | mm_context_t * | ctx, |
ptr_t | hint_addr, | ||
mmap_flags_t | flags, | ||
vm_flags | vm_flags, | ||
size_t | n_pages, | ||
io_t * | io, | ||
off_t | offset ) |
Map a file into the current process's address space.
ctx | The memory management context |
hint_addr | A hint for the address to map the page at, the actual address is determined based on the flags |
flags | Flags to control the mapping, see mmap_flags_t |
vm_flags | Flags to control the permissions of the mapping, see vm_flags |
n_pages | Number of pages to map |
io | The io object to map, the io object must be backed by a file_t |
offset | The offset into the file to map, must be page aligned |
Definition at line 73 of file mmap.c.
Referenced by elf_map_segment().
Unmap a page from the current process's address space.
addr | The address to unmap |
size | The size of the mapping to unmap |
addr
nor size
need to be page aligned, all pages contained within the range specified will be unmapped even if they are not fully contained within the range. Definition at line 111 of file mmap.c.
bool vm_protect | ( | mm_context_t * | mmctx, |
ptr_t | addr, | ||
size_t | size, | ||
vm_flags | perm ) |