|
Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
|
#include "autoconf.h"#include "init/init.h"#include <hal/cpu/paging.h>#include <libk/serial.h>#include <memory/memory_utils.h>#include <memory/phys_base_allocator.h>#include <memory/slab.h>#include <memory/vm_manager.h>#include <spinlock.h>#include <str.h>#include <type.h>#include <libk/tree/rbt.h>Go to the source code of this file.
Macros | |
| #define | RBT_TYPE virtual_memory_t |
| #define | RBT_ID_NAME start_address |
| #define | PERCPU __attribute__((section(".data.percpu"))) |
Functions | |
| static void | vma_tree_add_locked (struct virtual_memory_page *page, mem_vma_region region, uintptr_t start_address, uintptr_t end_address) |
| struct virtual_memory_page * | create_vmm_page () |
| INIT (vma) | |
| void | vma_register (struct virtual_memory_page *page, uintptr_t phys_address, uintptr_t virt_addr, size_t size) |
| virtual_memory_t * | vma_find (struct virtual_memory_page *page, uintptr_t virt_addr) |
| void | vma_unregister (struct virtual_memory_page *page, uintptr_t virt_addr) |
| static void | vma_rbt_debug_node (rbt_node *node, int level) |
| __attribute__ ((unused)) | |
| uintptr_t | vma_lookup_free_vaddr (struct virtual_memory_page *page, mem_vma_region region, size_t size) |
| __attribute__ ((always_inline)) | |
Variables | |
| boolean_t | paging_has_been_set |
| static rbt_node * | VMA_RBT_NIL = 0 |
| static struct virtual_memory_page * | kernel_vmm_page = 0 |
| static struct slab_cache * | rbt_node_cache = 0 |
| static struct slab_cache * | vma_cache = 0 |
| static struct slab_cache * | vma_tree_zone_cache = 0 |
| static struct slab_cache * | vma_block_cache = 0 |
| static struct slab_cache * | vma_page = 0 |
| #define PERCPU __attribute__((section(".data.percpu"))) |
Definition at line 17 of file vm_manager.c.
| #define RBT_ID_NAME start_address |
Definition at line 14 of file vm_manager.c.
| #define RBT_TYPE virtual_memory_t |
Definition at line 13 of file vm_manager.c.
| __attribute__ | ( | (always_inline) | ) |
Definition at line 200 of file vm_manager.c.
References kernel_vmm_page.
| __attribute__ | ( | (unused) | ) |
Definition at line 152 of file vm_manager.c.
References root, and vma_rbt_debug_node().
| struct virtual_memory_page * create_vmm_page | ( | ) |
Definition at line 73 of file vm_manager.c.
References memset(), vma_page, VMA_RBT_NIL, and vxSlabAlloc().
| INIT | ( | vma | ) |
Definition at line 80 of file vm_manager.c.
References create_vmm_page(), kernel_vmm_page, rbt_node_cache, serial_trace, vma_block_cache, vma_cache, vma_page, VMA_RBT_NIL, vma_tree_zone_cache, vxCreateSlabCache(), and vxSlabAlloc().
| virtual_memory_t * vma_find | ( | struct virtual_memory_page * | page, |
| uintptr_t | virt_addr ) |
Definition at line 117 of file vm_manager.c.
References rbt_node::data, NULL, page, rbt_search_node(), spin_acquire(), spin_release(), and VMA_RBT_NIL.
Referenced by syscall_mprotect().
| uintptr_t vma_lookup_free_vaddr | ( | struct virtual_memory_page * | page, |
| mem_vma_region | region, | ||
| size_t | size ) |
Definition at line 156 of file vm_manager.c.
References virtual_memory_tree_node::end_address, NULL, page, size, spin_acquire(), spin_release(), VMA_REGION_A, VMA_REGION_B, VMA_REGION_C, VMA_REGION_KMODULE, VMA_REGION_PROCESS, and vma_tree_add_locked().
Referenced by acpi_map_phys_page(), elf_load(), execve(), INIT(), INIT(), mcfg_parse(), mmap_resolve_virt_addr(), proccess_elf(), and vxPCIGatheringBusInfo().
|
static |
Definition at line 138 of file vm_manager.c.
References rbt_node::data, rbt_node::left, NULL, rbt_node::right, serial_trace, vma_rbt_debug_node(), and VMA_RBT_NIL.
Referenced by __attribute__(), and vma_rbt_debug_node().
| void vma_register | ( | struct virtual_memory_page * | page, |
| uintptr_t | phys_address, | ||
| uintptr_t | virt_addr, | ||
| size_t | size ) |
Definition at line 101 of file vm_manager.c.
References virtual_memory::core, virtual_memory::end_address, virtual_memory::flags, virtual_memory::length, page, phys_address, virtual_memory::phys_address, rbt_insert_node(), rbt_node_cache, size, spin_acquire(), spin_release(), virtual_memory::start_address, vma_cache, VMA_RBT_NIL, and vxSlabAlloc().
Referenced by __attribute__(), acpi_map_phys_page(), alloc_page_locked(), execve(), INIT(), INIT(), INIT(), mmap_handle_anonymous(), and vxPCIGatheringBusInfo().
|
static |
Definition at line 31 of file vm_manager.c.
References end_address, virtual_memory_tree_node::end_address, memset(), virtual_memory_tree_node::next, page, slab_free(), start_address, virtual_memory_tree_node::start_address, VMA_REGION_A, VMA_REGION_B, VMA_REGION_C, VMA_REGION_KMODULE, VMA_REGION_PROCESS, vma_tree_zone_cache, and vxSlabAlloc().
Referenced by vma_lookup_free_vaddr().
| void vma_unregister | ( | struct virtual_memory_page * | page, |
| uintptr_t | virt_addr ) |
Definition at line 126 of file vm_manager.c.
References page, rbt_remove_node(), rbt_search_node(), spin_acquire(), spin_release(), and VMA_RBT_NIL.
Referenced by acpi_phys_page_unmap(), and execve().
|
static |
Definition at line 23 of file vm_manager.c.
Referenced by __attribute__(), and INIT().
|
extern |
Definition at line 18 of file paging.c.
Referenced by INIT(), paging_create_page_directory(), paging_setup(), paging_unmap_page(), and vxMmap().
|
static |
Definition at line 25 of file vm_manager.c.
Referenced by __attribute__(), INIT(), INIT(), and vma_register().
|
static |
Definition at line 28 of file vm_manager.c.
Referenced by INIT().
|
static |
Definition at line 26 of file vm_manager.c.
Referenced by INIT(), and vma_register().
|
static |
Definition at line 29 of file vm_manager.c.
Referenced by create_vmm_page(), and INIT().
|
static |
Definition at line 21 of file vm_manager.c.
Referenced by create_vmm_page(), INIT(), vma_find(), vma_rbt_debug_node(), vma_register(), and vma_unregister().
|
static |
Definition at line 27 of file vm_manager.c.
Referenced by INIT(), and vma_tree_add_locked().