|
| static void | tlb_invalidate (void *addr, size_t amount) |
| | Invalidates a region of pages in the TLB.
|
| |
| static bool | pml_is_empty (pml_t *pml) |
| | Checks if a page table level is empty (all entries are 0).
|
| |
| static uint64_t | pml_new (page_table_t *table, pml_t **outPml) |
| | Allocates and initializes a new page table level.
|
| |
| static void | pml_free (page_table_t *table, pml_t *pml, pml_level_t level) |
| | Recursively frees a page table level, all its children and any owned pages.
|
| |
| static uint64_t | page_table_init (page_table_t *table, pml_alloc_pages_t allocPages, pml_free_pages_t freePages) |
| | Initializes a page table.
|
| |
| static void | page_table_deinit (page_table_t *table) |
| | Deinitializes a page table, freeing all allocated pages.
|
| |
| static void | page_table_load (page_table_t *table) |
| | Loads the page table into the CR3 register if it is not already loaded.
|
| |
| static uint64_t | page_table_get_pml (page_table_t *table, pml_t *current, pml_index_t index, pml_flags_t flags, pml_t **out) |
| | Retrieves or allocates the next level page table.
|
| |
| static uint64_t | page_table_traverse (page_table_t *table, page_table_traverse_t *traverse, const void *addr, pml_flags_t flags) |
| | Allows for fast traversal of the page table by caching previously accessed layers.
|
| |
| static uint64_t | page_table_get_phys_addr (page_table_t *table, void *addr, phys_addr_t *out) |
| | Retrieves the physical address mapped to a given virtual address.
|
| |
| static bool | page_table_is_mapped (page_table_t *table, const void *addr, size_t amount) |
| | Checks if a range of virtual addresses is completely mapped.
|
| |
| static bool | page_table_is_unmapped (page_table_t *table, void *addr, size_t amount) |
| | Checks if a range of virtual addresses is completely unmapped.
|
| |
| static uint64_t | page_table_map (page_table_t *table, void *addr, phys_addr_t phys, size_t amount, pml_flags_t flags, pml_callback_id_t callbackId) |
| | Maps a range of virtual addresses to physical addresses in the page table.
|
| |
| static uint64_t | page_table_map_pages (page_table_t *table, void *addr, const pfn_t *pfns, size_t amount, pml_flags_t flags, pml_callback_id_t callbackId) |
| | Maps an array of physical pages to contiguous virtual addresses in the page table.
|
| |
| static void | page_table_unmap (page_table_t *table, void *addr, size_t amount) |
| | Unmaps a range of virtual addresses from the page table.
|
| |
| static void | page_table_page_buffer_push (page_table_t *table, page_table_page_buffer_t *buffer, void *address) |
| | Pushes a page table level onto the page buffer, freeing the buffer if full.
|
| |
| static void | page_table_page_buffer_flush (page_table_t *table, page_table_page_buffer_t *buffer) |
| | Flushes the page buffer, freeing any remaining pages.
|
| |
| static void | page_table_clear_pml1_pml2_pml3 (page_table_t *table, page_table_traverse_t *prevTraverse, page_table_traverse_t *traverse, page_table_page_buffer_t *pageBuffer) |
| | Clears any empty page table levels any time a pml1, pml2 or pml3 boundry is crossed.
|
| |
| static void | page_table_clear (page_table_t *table, void *addr, size_t amount) |
| | Clears page table entries in the specified range and frees any owned pages.
|
| |
| static void | page_table_collect_callbacks (page_table_t *table, void *addr, size_t amount, uint64_t *callbacks) |
| | Collects the number of pages associated with each callback ID in the specified range.
|
| |
| static uint64_t | page_table_set_flags (page_table_t *table, void *addr, size_t amount, pml_flags_t flags) |
| | Sets the flags for a range of pages in the page table.
|
| |
| static uint64_t | page_table_find_unmapped_region (page_table_t *table, void *startAddr, void *endAddr, size_t amount, size_t alignment, void **outAddr) |
| | Finds the first contiguous unmapped region with the given number of pages within the specified address range.
|
| |
| static bool | page_table_is_pinned (page_table_t *table, void *addr, size_t amount) |
| | Checks if any page in a range is pinned.
|
| |
| static uint64_t | page_table_count_pages_with_flags (page_table_t *table, void *addr, size_t amount, pml_flags_t flags) |
| | Counts the number of pages in a range that have all the specified flags set.
|
| |