|
Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
|
#include "hal/cpu/core.h"#include "hal/cpu/paging.h"#include "libk/serial.h"#include "memory/memory_utils.h"#include "memory/phys_base_allocator.h"#include "memory/vm_manager.h"#include "sys/err_no.h"#include <str.h>#include <sys/syscall.h>Go to the source code of this file.
Macros | |
| #define | MAP_FAILED ((void*)-1) |
| #define | MAP_SHARED 0x01 |
| #define | MAP_PRIVATE 0x02 |
| #define | MAP_SHARED_VALIDATE 0x03 |
| #define | MAP_TYPE 0x0f |
| #define | MAP_FIXED 0x10 |
| #define | MAP_ANON 0x20 |
| #define | MAP_ANONYMOUS MAP_ANON |
| #define | MAP_NORESERVE 0x4000 |
| #define | MAP_GROWSDOWN 0x0100 |
| #define | MAP_DENYWRITE 0x0800 |
| #define | MAP_EXECUTABLE 0x1000 |
| #define | MAP_LOCKED 0x2000 |
| #define | MAP_POPULATE 0x8000 |
| #define | MAP_NONBLOCK 0x10000 |
| #define | MAP_STACK 0x20000 |
| #define | MAP_HUGETLB 0x40000 |
| #define | MAP_SYNC 0x80000 |
| #define | MAP_FIXED_NOREPLACE 0x100000 |
| #define | MAP_FILE 0 |
| #define | MAP_HUGE_SHIFT 26 |
| #define | MAP_HUGE_MASK 0x3f |
| #define | MAP_HUGE_16KB (14 << 26) |
| #define | MAP_HUGE_64KB (16 << 26) |
| #define | MAP_HUGE_512KB (19 << 26) |
| #define | MAP_HUGE_1MB (20 << 26) |
| #define | MAP_HUGE_2MB (21 << 26) |
| #define | MAP_HUGE_8MB (23 << 26) |
| #define | MAP_HUGE_16MB (24 << 26) |
| #define | MAP_HUGE_32MB (25 << 26) |
| #define | MAP_HUGE_256MB (28 << 26) |
| #define | MAP_HUGE_512MB (29 << 26) |
| #define | MAP_HUGE_1GB (30 << 26) |
| #define | MAP_HUGE_2GB (31 << 26) |
| #define | MAP_HUGE_16GB (34U << 26) |
Functions | |
| static uint64_t | mmap_prot_to_flags (int prot) |
| static uintptr_t | mmap_resolve_virt_addr (void *addr, int flags, struct virtual_memory_page *vm_page, size_t len_4kb) |
| static void * | mmap_handle_anonymous (thread_t *thr, process_t *procc, void *addr, int flags, size_t len_4kb, uint64_t mmap_flags) |
| void * | syscall_mmap (void *addr, size_t len, int prot, int flags, int fd, long off) |
| #define MAP_ANONYMOUS MAP_ANON |
Definition at line 19 of file mmap.c.
Referenced by syscall_mmap().
| #define MAP_FIXED 0x10 |
Definition at line 17 of file mmap.c.
Referenced by mmap_handle_anonymous(), and mmap_resolve_virt_addr().
| #define MAP_PRIVATE 0x02 |
Definition at line 14 of file mmap.c.
Referenced by syscall_mmap().
|
static |
Definition at line 76 of file mmap.c.
References addr, BLOCK_SIZE, EINVAL, ENOMEM, flags, MAP_FIXED, mmap_resolve_virt_addr(), thread::page, phys_base_alloc(), serial2_printf(), vma_register(), and vxMultipleMmap().
Referenced by syscall_mmap().
|
static |
Definition at line 49 of file mmap.c.
References flags, PAGE_NO_EXECUTE, PAGE_PRESENT, PAGE_WRITABLE, PROT_EXEC, PROT_NONE, PROT_READ, and PROT_WRITE.
Referenced by syscall_mmap().
|
static |
Definition at line 64 of file mmap.c.
References addr, flags, MAP_FIXED, vm_page, vma_lookup_free_vaddr(), and VMA_REGION_PROCESS.
Referenced by mmap_handle_anonymous().
| void * syscall_mmap | ( | void * | addr, |
| size_t | len, | ||
| int | prot, | ||
| int | flags, | ||
| int | fd, | ||
| long | off ) |
Definition at line 100 of file mmap.c.
References addr, ALIGN_UP, EINVAL, ENOENT, ENOSPC, flags, get_current_core_data(), len, MAP_ANONYMOUS, MAP_PRIVATE, mmap_handle_anonymous(), mmap_prot_to_flags(), serial2_printf(), and serial_trace.
Referenced by syscall_dispatch().