// void os::paging::unmap(phys_ptr<PML4T> PLM4T, page* virt, std::uint64_t length) { }
// void os::paging::map(phys_ptr<PML4T> PLM4T, page* virt, std::uint64_t length, phys_ptr<page> phys) { }
-template<int order> void print_mapping(os::phys_ptr<os::paging::paging_table<order>> table, std::uint64_t virt_address) {
- for (std::size_t i = 0; i < 512; i++) {
+template<int order> void print_mapping(os::phys_ptr<os::paging::paging_table<order>> table, std::uint64_t virt_address, bool show_higher_half) {
+ for (std::size_t i = 0; i < (order == 3 && !show_higher_half ? 256 : 512); i++) {
const auto& page = table->contents[i];
if (!page.P()) { continue; }
std::uint64_t new_virt = virt_address + i * (4096ul << (order * 9));
os::print(")\n");
} else {
if constexpr (order > 0) { // Will never be false when !page.is_page().
- print_mapping<order - 1>(page.base_address(), new_virt);
+ print_mapping<order - 1>(page.base_address(), new_virt, show_higher_half);
}
}
}
}
-void os::paging::print_mapping(phys_ptr<PML4T> PML4T) {
- ::print_mapping(PML4T, 0);
+void os::paging::print_mapping(phys_ptr<PML4T> PML4T, bool show_higher_half) {
+ ::print_mapping(PML4T, 0, show_higher_half);
}
os::paging::page one_past_end_page_for_page_allocator;
void unmap(phys_ptr<PML4T> PLM4T, page* virt, std::uint64_t length);
void map(phys_ptr<PML4T> PLM4T, page* virt, std::uint64_t length, phys_ptr<page> phys);
-void print_mapping(phys_ptr<PML4T> PML4T);
+void print_mapping(phys_ptr<PML4T> PML4T, bool show_higher_half = false);
class page_allocator_t;
extern page_allocator_t page_allocator;