|
Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
|
#include "paging.h"#include "autoconf.h"#include "init/init.h"#include <libk/serial.h>#include <memory/memory_utils.h>#include <memory/phys_base_allocator.h>#include <memory/phys_window.h>#include <memory/vm_manager.h>#include <spinlock.h>#include <str.h>#include <type.h>Go to the source code of this file.
Data Structures | |
| struct | paging_page |
Macros | |
| #define | EXPORT_SYMBOL(sym) |
Typedefs | |
| typedef struct paging_page | paging_page |
Functions | |
| void | paging_physwindow_mmap (page_t page_dir, uint64_t virt, uint64_t phys, uint64_t flags) |
| struct paging_page | __attribute__ ((aligned(32))) |
| page_t | paging_create_page_directory () |
| static void | initialize_physical_paging_window (page_t page) |
| INIT (paging) | |
| void | paging_debug (page_t pml4_phys, uint64_t virt) |
| void | paging_setup (page_t p) |
| void | vxMmap (page_t page_dir, uint64_t virt, uint64_t phys, uint64_t flags) |
| void | vxMultipleMmap (page_t page_dir, uint64_t virt, uint64_t phys, uint64_t size, uint64_t flags) |
| void | paging_unmap_page (page_t page_dir, uint64_t virt) |
| void | paging_unmap_fill (page_t page_dir, uint64_t virt, size_t size) |
| void | paging_reload (page_t p) |
| page_t | paging_get_highest_page_map (void) |
| uint64_t | vaddr_to_paddr (page_t p, uint64_t vaddr) |
Variables | |
| static uintptr_t | PHYS_BASE_METADATA_ADDR = 0xffffffe000000000 |
| volatile boolean_t | paging_has_been_set = 0 |
| uint8_t * | bitmap_base_ |
| uint8_t * | dma_bitmap_base_ |
| uint64_t | metadata_size |
| size_t | dma_bitmap_size |
| uintptr_t | page |
| paging_page * | next |
| static spinlock_t | paging_lock = {0} |
| static page_t | kernel_pml4 |
| static page_t | physwindow_pt = 0 |
| #define EXPORT_SYMBOL | ( | sym | ) |
| struct paging_page __attribute__ | ( | (aligned(32)) | ) |
Definition at line 1 of file framebuffer.h.
| INIT | ( | paging | ) |
Definition at line 93 of file paging.c.
References bitmap_base_, initialize_physical_paging_window(), kernel_pml4, LOG_INFO, metadata_size, PAGE_PRESENT, PAGE_SIZE, PAGE_WRITABLE, paging_has_been_set, paging_reload(), PHYS_BASE_METADATA_ADDR, VMM_PAGE, vxMmap(), and vxMultipleMmap().
|
static |
Definition at line 78 of file paging.c.
References LOG_INFO, mem_vma_phys_window_pt, mem_vma_phys_window_start, page, PAGE_PRESENT, PAGE_WRITABLE, paging_physwindow_mmap(), physwindow_pt, and vxMultipleMmap().
Referenced by INIT().
| page_t paging_create_page_directory | ( | ) |
Definition at line 36 of file paging.c.
References mem_create_physwindow(), memset(), page, PAGE_SIZE, paging_has_been_set, paging_lock, phys_base_alloc(), spin_acquire(), and spin_release().
Referenced by execve().
Definition at line 117 of file paging.c.
References mem_create_physwindow(), mem_release_physwindow(), PAGE_PHYS_MASK, PHYS_WINDOW_FLAG_LOCK, PHYS_WINDOW_FLAG_READ, and serial_trace.
| page_t paging_get_highest_page_map | ( | void | ) |
Definition at line 463 of file paging.c.
References kernel_pml4.
Referenced by __attribute__(), acpi_map_phys_page(), acpi_phys_page_unmap(), alloc_page_locked(), elf_load(), execve(), INIT(), INIT(), INIT(), INIT(), INIT(), mcfg_parse(), mem_create_physwindow(), proccess_elf(), slab_cache_destroy(), vxCreateSlabCache(), vxPCIGatheringBusInfo(), and vxSlabAlloc().
Definition at line 54 of file paging.c.
References flags, PAGE_PHYS_MASK, physwindow_pt, and VMM_PAGE.
Referenced by initialize_physical_paging_window().
| void paging_reload | ( | page_t | p | ) |
Definition at line 457 of file paging.c.
Referenced by acpi_map_phys_page(), acpi_phys_page_unmap(), INIT(), INIT(), INIT(), INIT(), mcfg_parse(), sch_restore_to_next_thread(), vxPCIGatheringBusInfo(), and vxSchedulerTick().
| void paging_setup | ( | page_t | p | ) |
Definition at line 197 of file paging.c.
References dst, kernel_pml4, mem_create_physwindow(), mem_release_physwindow(), paging_has_been_set, PHYS_WINDOW_FLAG_LOCK, PHYS_WINDOW_FLAG_READ, PHYS_WINDOW_FLAG_WRITE, and serial2_printf().
Referenced by execve().
Definition at line 451 of file paging.c.
References paging_unmap_page(), and size.
Referenced by acpi_phys_page_unmap().
Definition at line 360 of file paging.c.
References mem_create_physwindow(), mem_release_physwindow(), PAGE_PHYS_MASK, paging_has_been_set, paging_lock, PHYS_WINDOW_FLAG_LOCK, PHYS_WINDOW_FLAG_READ, PHYS_WINDOW_FLAG_WRITE, spin_acquire(), and spin_release().
Referenced by execve(), paging_unmap_fill(), and slab_cache_destroy().
Definition at line 465 of file paging.c.
References PAGE_PHYS_MASK, and PHYS2VIRT.
Definition at line 223 of file paging.c.
References flags, mem_create_physwindow(), mem_release_physwindow(), memset(), PAGE_INTER_STRIP, PAGE_PHYS_MASK, PAGE_PRESENT, PAGE_SIZE, PAGE_USER, PAGE_WRITABLE, paging_has_been_set, paging_lock, phys_base_alloc(), PHYS_WINDOW_FLAG_LOCK, PHYS_WINDOW_FLAG_READ, PHYS_WINDOW_FLAG_WRITE, spin_acquire(), and spin_release().
Referenced by alloc_page_locked(), INIT(), syscall_brk(), vxCreateSlabCache(), vxMultipleMmap(), and vxSlabAlloc().
| void vxMultipleMmap | ( | page_t | page_dir, |
| uint64_t | virt, | ||
| uint64_t | phys, | ||
| uint64_t | size, | ||
| uint64_t | flags ) |
Definition at line 340 of file paging.c.
References flags, size, and vxMmap().
Referenced by __attribute__(), acpi_map_phys_page(), elf_load(), elf_mmap_got(), execve(), INIT(), INIT(), INIT(), INIT(), INIT(), initialize_physical_paging_window(), mcfg_parse(), mmap_handle_anonymous(), syscall_mprotect(), and vxPCIGatheringBusInfo().
|
extern |
Definition at line 18 of file phys_base_allocator.c.
Referenced by INIT(), INIT(), phys_base_alloc(), pys_base_get_free_block_count(), and vxPhysBaseFree().
|
extern |
Definition at line 19 of file phys_base_allocator.c.
|
extern |
Definition at line 20 of file phys_base_allocator.c.
|
static |
Definition at line 51 of file paging.c.
Referenced by INIT(), paging_get_highest_page_map(), and paging_setup().
|
extern |
Definition at line 22 of file phys_base_allocator.c.
| paging_page* next |
| uintptr_t page |
Definition at line 0 of file paging.c.
Referenced by create_thread(), elf_load(), elf_mmap_got(), execve(), initialize_physical_paging_window(), paging_create_page_directory(), phys_base_alloc_aligned(), vma_find(), vma_lookup_free_vaddr(), vma_register(), vma_tree_add_locked(), and vma_unregister().
| volatile boolean_t paging_has_been_set = 0 |
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 34 of file paging.c.
Referenced by paging_create_page_directory(), paging_unmap_page(), and vxMmap().
|
static |
|
static |
Definition at line 52 of file paging.c.
Referenced by initialize_physical_paging_window(), and paging_physwindow_mmap().