|
Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
|
Go to the source code of this file.
Data Structures | |
| struct | virtual_memory_block |
| struct | virtual_memory |
| struct | virtual_memory_tree_node |
| struct | virtual_memory_tree |
| struct | virtual_memory_page |
Macros | |
| #define | KERNEL_BASE 0xFFFF800000000000ULL |
| #define | REGION_SIZE 0x0000008000000000ULL |
| #define | USER_STACK_VADDR 0x7FFFFFFFE000ULL |
| #define | USER_MMAP_BASE 0x100000000ULL |
Typedefs | |
| typedef struct virtual_memory_block | virtual_memory_block_t |
| typedef struct virtual_memory | virtual_memory_t |
Enumerations | |
| enum | mem_vma_region : uintptr_t { VMA_REGION_A = 0xFFFF800000000000ULL , VMA_REGION_B = 0xFFFF800000000000ULL + ( 0x0000008000000000ULL * 1) , VMA_REGION_C = 0xFFFF800000000000ULL + ( 0x0000008000000000ULL * 2) , VMA_REGION_KMODULE , KALLOC_BASE_ADDR , mem_vma_phys_window_pt = 0xFFFFB00000000000ULL , mem_vma_phys_window_start = 0xFFFFD00000000000ULL , VMA_REGION_PROCESS = 0x400000 } |
Functions | |
| struct virtual_memory | __attribute__ ((aligned(64))) |
| struct virtual_memory_tree_node | __attribute__ ((aligned(8))) |
| 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) |
| uintptr_t | vma_lookup_free_vaddr (struct virtual_memory_page *page, mem_vma_region region, size_t size) |
| struct virtual_memory_page * | get_kernel_vmm_page () |
| struct virtual_memory_page * | create_vmm_page () |
Variables | |
| uintptr_t | start_address |
| uintptr_t | end_address |
| uintptr_t | phys_address |
| size_t | length |
| int | flags |
| int | core |
| struct virtual_memory_tree_node * | parent |
| struct virtual_memory_tree_node * | next |
| struct virtual_memory_tree | __attribute__ |
| spinlock_t | lock |
| struct virtual_memory_tree | vma_tree_zone_process |
| struct virtual_memory_tree | vma_tree_zone_a |
| struct rbt_node * | tree |
| uint8_t | _pad [6] |
| struct virtual_memory_tree | vma_tree_zone_b |
| struct virtual_memory_tree | vma_tree_zone_c |
| struct virtual_memory_tree | vma_tree_zone_kmodule |
| #define KERNEL_BASE 0xFFFF800000000000ULL |
Definition at line 7 of file vm_manager.h.
| #define REGION_SIZE 0x0000008000000000ULL |
Definition at line 8 of file vm_manager.h.
| #define USER_MMAP_BASE 0x100000000ULL |
Definition at line 10 of file vm_manager.h.
| #define USER_STACK_VADDR 0x7FFFFFFFE000ULL |
Definition at line 9 of file vm_manager.h.
Referenced by execve().
| typedef struct virtual_memory_block virtual_memory_block_t |
Definition at line 28 of file vm_manager.h.
| typedef struct virtual_memory virtual_memory_t |
Definition at line 35 of file vm_manager.h.
| enum mem_vma_region : uintptr_t |
| Enumerator | |
|---|---|
| VMA_REGION_A | |
| VMA_REGION_B | |
| VMA_REGION_C | |
| VMA_REGION_KMODULE | |
| KALLOC_BASE_ADDR | |
| mem_vma_phys_window_pt | |
| mem_vma_phys_window_start | |
| VMA_REGION_PROCESS | |
Definition at line 12 of file vm_manager.h.
| struct virtual_memory __attribute__ | ( | (aligned(64)) | ) |
| struct virtual_memory_tree_node __attribute__ | ( | (aligned(8)) | ) |
| 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().
| struct virtual_memory_page * get_kernel_vmm_page | ( | ) |
Referenced by __attribute__(), acpi_map_phys_page(), acpi_phys_page_unmap(), alloc_page_locked(), elf_load(), execve(), INIT(), INIT(), INIT(), mcfg_parse(), proccess_elf(), and vxPCIGatheringBusInfo().
| 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().
| 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().
| 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().
| struct virtual_memory_tree __attribute__ |
| uint8_t _pad[6] |
Definition at line 4 of file vm_manager.h.
| int core |
Definition at line 5 of file vm_manager.h.
Referenced by __attribute__(), __attribute__(), attach_to_scheduler(), get_current_core_data(), irq_alloc_entry(), irq_register(), irq_setup(), set_tss_stack(), setup_gdt(), usleep(), usleep_backend(), vxACPIRegisterNewCore(), vxAddWorkqueueTask(), vxAllocScheduler(), vxGetCoreDataByCoreID(), vxGetCpuInfo(), vxGetNumberOfCores(), vxGetSchedulerCore(), vxSchedulerGetCurrentQueue(), and workqueue_process().
| uintptr_t end_address |
Definition at line 1 of file vm_manager.h.
Referenced by vma_tree_add_locked().
| int flags |
Definition at line 4 of file vm_manager.h.
| size_t length |
Definition at line 3 of file vm_manager.h.
| spinlock_t lock |
Definition at line 0 of file vm_manager.h.
| struct virtual_memory_tree_node* next |
Definition at line 3 of file vm_manager.h.
| struct virtual_memory_tree_node* parent |
Definition at line 0 of file vm_manager.h.
| uintptr_t phys_address |
Definition at line 2 of file vm_manager.h.
Referenced by vma_register().
| uintptr_t start_address |
Definition at line 0 of file vm_manager.h.
Referenced by vma_tree_add_locked().
| struct rbt_node* tree |
Definition at line 3 of file vm_manager.h.
| struct virtual_memory_tree vma_tree_zone_a |
Definition at line 2 of file vm_manager.h.
| struct virtual_memory_tree vma_tree_zone_b |
Definition at line 5 of file vm_manager.h.
| struct virtual_memory_tree vma_tree_zone_c |
Definition at line 6 of file vm_manager.h.
| struct virtual_memory_tree vma_tree_zone_kmodule |
Definition at line 7 of file vm_manager.h.
| struct virtual_memory_tree vma_tree_zone_process |
Definition at line 1 of file vm_manager.h.