|
PatchworkOS
|
#include <paging_types.h>
Data Fields | ||
| union { | ||
| uint64_t raw | ||
| struct { | ||
| uint64_t present: 1 | ||
| If set the page is present in memory and readable. More... | ||
| uint64_t write: 1 | ||
| If set the page is writable. More... | ||
| uint64_t user: 1 | ||
| If set the page is accessible from user mode. More... | ||
| uint64_t writeThrough: 1 | ||
| If set write-through caching is enabled for the page. More... | ||
| uint64_t cacheDisabled: 1 | ||
| If set caching is disabled for the page. More... | ||
| uint64_t accessed: 1 | ||
| If set the page has been accessed (read or written to). More... | ||
| uint64_t dirty: 1 | ||
| If set the page has been written to. More... | ||
| uint64_t size: 1 | ||
| uint64_t global: 1 | ||
| If set the page is not flushed from the TLB on a context switch. More... | ||
| uint64_t owned: 1 | ||
| uint64_t pinned: 1 | ||
| uint64_t lowCallbackId: 1 | ||
| uint64_t addr: 40 | ||
| The address contained in the entry, note that this is shifted right by 12 bits. More... | ||
| uint64_t highCallbackId: 7 | ||
| uint64_t protection: 4 | ||
| uint64_t noExecute: 1 | ||
| } | ||
| }; | ||
Definition at line 37 of file paging_types.h.
| union { ... } pml_entry_t |
| uint64_t pml_entry_t::accessed |
If set the page has been accessed (read or written to).
Definition at line 48 of file paging_types.h.
| uint64_t pml_entry_t::addr |
The address contained in the entry, note that this is shifted right by 12 bits.
Definition at line 79 of file paging_types.h.
Referenced by page_table_get_phys_addr(), page_table_map(), page_table_map_pages(), and pml_accessible_addr().
| uint64_t pml_entry_t::cacheDisabled |
If set caching is disabled for the page.
Definition at line 47 of file paging_types.h.
| uint64_t pml_entry_t::dirty |
If set the page has been written to.
Definition at line 49 of file paging_types.h.
| uint64_t pml_entry_t::global |
If set the page is not flushed from the TLB on a context switch.
Definition at line 51 of file paging_types.h.
| uint64_t pml_entry_t::highCallbackId |
The high bits of the callback ID associated with this page.
Check the virtual memory manager for more information. (Defined by PatchworkOS)
Definition at line 85 of file paging_types.h.
Referenced by page_table_collect_callbacks(), page_table_map(), and page_table_map_pages().
| uint64_t pml_entry_t::lowCallbackId |
The low bit of the callback ID associated with this page.
Check the virtual memory manager for more information. (Defined by PatchworkOS)
Definition at line 78 of file paging_types.h.
Referenced by page_table_collect_callbacks(), page_table_map(), and page_table_map_pages().
| uint64_t pml_entry_t::noExecute |
Definition at line 87 of file paging_types.h.
| uint64_t pml_entry_t::owned |
If set, then when the entry is unmapped or the page table is freed, the physical page will be freed. (Defined by PatchworkOS)
Definition at line 56 of file paging_types.h.
Referenced by page_table_clear(), page_table_set_flags(), pml_free(), and space_map_kernel_space_region().
| uint64_t pml_entry_t::pinned |
If set, the page is pinned and cannot be unmapped or have its mappings modified.
Used to prevent TOCTOU vulnerabilities by preventing a page from being unmapped or its mappings modified while its being used, in for example a system call.
For performance the paging code will never check this flag instead its the responsibility of the virtual memory manager to check this flag.
Note that recursive pinning is implemented in the virtual memory manager, not here, meaning that this flag only indicates if the page is pinned or not, for faster access, while the pin depth is tracked elsewhere.
(Defined by PatchworkOS)
Definition at line 72 of file paging_types.h.
Referenced by page_table_is_pinned(), space_pin_depth_dec(), and space_pin_depth_inc().
| uint64_t pml_entry_t::present |
If set the page is present in memory and readable.
Definition at line 43 of file paging_types.h.
Referenced by page_table_clear(), page_table_collect_callbacks(), page_table_find_unmapped_region(), page_table_get_phys_addr(), page_table_get_pml(), page_table_is_mapped(), page_table_is_pinned(), page_table_is_unmapped(), page_table_map(), page_table_map_pages(), page_table_set_flags(), page_table_unmap(), pml_free(), space_pin_depth_dec(), and space_pin_depth_inc().
| uint64_t pml_entry_t::protection |
Definition at line 86 of file paging_types.h.
| uint64_t pml_entry_t::raw |
Definition at line 40 of file paging_types.h.
Referenced by page_table_clear(), page_table_clear_pml1_pml2_pml3(), page_table_get_pml(), page_table_map(), page_table_map_pages(), page_table_set_flags(), pml_is_empty(), space_unmap_kernel_space_region(), and vmm_unmap_bootloader_lower_half().
| uint64_t pml_entry_t::size |
Definition at line 50 of file paging_types.h.
| uint64_t pml_entry_t::user |
If set the page is accessible from user mode.
Definition at line 45 of file paging_types.h.
| uint64_t pml_entry_t::write |
If set the page is writable.
Definition at line 44 of file paging_types.h.
| uint64_t pml_entry_t::writeThrough |
If set write-through caching is enabled for the page.
Definition at line 46 of file paging_types.h.