12#ifndef PAGE_TABLE_PAGE_TABLE_H
13#define PAGE_TABLE_PAGE_TABLE_H
25#define PAGE_SIZE LINKER_PAGE_SIZE
31#define PTRS_PER_TABLE 512
36#define NUM_PAGES(size) (((size) + PAGE_SIZE - 1) / PAGE_SIZE)
128 uint64_t protected : 1;
280 struct __attribute__((packed)) {
Header that interfaces with libfdt for Device Tree Blob (DTB) parsing.
Preprocessor define values used in the linker script and referenced in C code.
Memory layout definitions.
uint64_t virt_addr
Type for representing virtual addresses.
Definition mem_layout.h:20
uint64_t phy_addr
Type for representing physical addresses.
Definition mem_layout.h:17
bool setup_kernel_map(memory_map_t *mmap)
Set up the kernel's higher-half virtual-memory map.
Definition page_table.c:911
#define PTRS_PER_TABLE
Number of pointers per page table. from table D4-21 in the Armv8-A architecture reference manual.
Definition page_table.h:31
bool map_page(page_table_t *root, virt_addr v_addr, phy_addr phy_addr, page_permissions_t perms, mem_type_t mem_typ)
Map a virtual address to a physical address in the page table.
Definition page_table.c:748
bool setup_kernel_id_map(phy_addr serial_device_addr_base)
Set up the initial identity-mapped region for the kernel.
Definition page_table.c:840
void dump_memory_map(page_table_t *root)
Dump the memory map for debugging.
Definition page_table.c:833
mem_type_t
Memory type used as an index into the MAIR_EL1 register.
Definition page_table.h:68
@ DEVICE
Definition page_table.h:71
@ NORMAL
Definition page_table.h:74
Container for the system physical memory layout.
Definition fdt.h:39
FLAT BLOCK/PAGE DATA DESCRIPTOR LAYOUT — maps real physical memory.
Definition page_table.h:168
uint64_t valid
Definition page_table.h:170
uint64_t non_global
Definition page_table.h:203
uint64_t po_index
Definition page_table.h:251
uint64_t frame_addr_49_48
Definition page_table.h:212
uint64_t guarded_page
Definition page_table.h:216
uint64_t sw_reserved
Definition page_table.h:240
uint64_t attr_indx_3
Definition page_table.h:245
uint64_t ap
Definition page_table.h:189
uint64_t access_flag
Definition page_table.h:198
uint64_t attr_indx
Definition page_table.h:180
uint64_t pxn
Definition page_table.h:230
uint64_t non_secure
Definition page_table.h:184
uint64_t contiguous
Definition page_table.h:226
uint64_t sh
Definition page_table.h:194
uint64_t xn
Definition page_table.h:235
uint64_t is_page
Definition page_table.h:175
uint64_t amec
Definition page_table.h:256
uint64_t dirty_bit
Definition page_table.h:221
uint64_t frame_addr_47_12
Definition page_table.h:208
Software representation of architectural page mapping privileges.
Definition page_table.h:45
bool user_accessible
Definition page_table.h:58
bool write
Definition page_table.h:50
bool execute
Definition page_table.h:54
bool read
Definition page_table.h:47
Represents a single page table level (512 entries).
Definition page_table.h:315
TABLE DESCRIPTOR LAYOUT (Lookup levels 0, 1, or 2).
Definition page_table.h:86
uint64_t ap_table
Definition page_table.h:147
uint64_t ns_table
Definition page_table.h:151
uint64_t xn_table
Definition page_table.h:141
uint64_t nlta_51_50
Definition page_table.h:102
uint64_t access_flag
Definition page_table.h:107
uint64_t ignored_58_53
Definition page_table.h:131
uint64_t is_table
Definition page_table.h:95
uint64_t nlta_47_12
Definition page_table.h:114
uint64_t nlta_49_48
Definition page_table.h:118
uint64_t ignored_7_2
Definition page_table.h:98
uint64_t ignored_11
Definition page_table.h:110
uint64_t ignored_51
Definition page_table.h:124
uint64_t pxn_table
Definition page_table.h:136
uint64_t res_50
Definition page_table.h:121
uint64_t valid
Definition page_table.h:89
Flat, architecturally stable AArch64 Stage 1 Descriptor structure.
Definition page_table.h:267
uint64_t rest
Definition page_table.h:291
table_desc_t table_desc
full descriptor.
Definition page_table.h:301
uint64_t type
Definition page_table.h:287
page_desc_t page_desc
Structured layout for block mappings (L1/L2) or page mappings (L3). Maps physical memory output windo...
Definition page_table.h:308
uint64_t valid
Definition page_table.h:283
uint64_t value
Raw 64-bit integer presentation of the full descriptor. Useful for atomic page table writes or direct...
Definition page_table.h:272