[kernel] Use constants for known pml4e indices

There were a few lingering bugs due to places where 510/511 were
hard-coded as the kernel-space PML4 entries. These are now constants
defined in kernel_memory.h instead.

Tags: boot memory paging
This commit is contained in:
Justin C. Miller
2020-05-24 22:06:24 -07:00
parent cc9cde9bfe
commit 83b330bf2b
6 changed files with 57 additions and 87 deletions

View File

@@ -15,7 +15,7 @@ struct page_table
return static_cast<level>(static_cast<unsigned>(l) + 1);
}
uint64_t entries[512];
uint64_t entries[memory::table_entries];
inline page_table * get(int i, uint16_t *flags = nullptr) const {
uint64_t entry = entries[i];