From a9acaf0489610d979e04252bb6c19a1e6900bcbd Mon Sep 17 00:00:00 2001 From: Ali Mashtizadeh Date: Wed, 6 Sep 2023 13:46:47 -0400 Subject: [PATCH] Cleanup pmapdump* commands --- sys/amd64/pmap.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/sys/amd64/pmap.c b/sys/amd64/pmap.c index f782a7b..07ed38d 100644 --- a/sys/amd64/pmap.c +++ b/sys/amd64/pmap.c @@ -409,7 +409,7 @@ AddrFromIJKL(uint64_t i, uint64_t j, uint64_t k, uint64_t l) } void -PMap_Dump(AS *space) +PMap_DumpFull(AS *space) { int i = 0; int j = 0; @@ -465,15 +465,15 @@ PMap_Dump(AS *space) } static void -Debug_PMapDump(int argc, const char *argv[]) +Debug_PMapDumpFull(int argc, const char *argv[]) { - PMap_Dump(currentAS[THISCPU()]); + PMap_DumpFull(currentAS[THISCPU()]); } -REGISTER_DBGCMD(pmapdump, "Dump memory mappings", Debug_PMapDump); +REGISTER_DBGCMD(pmapdumpfull, "Dump memory mappings", Debug_PMapDumpFull); void -PMap_DumpConcise(AS *space) +PMap_Dump(AS *space) { int i = 0; int j = 0; @@ -481,6 +481,7 @@ PMap_DumpConcise(AS *space) int l = 0; PageTable *root = space->root; + kprintf("%-18s %-18s %-5s\n", "Virtual", "Physical PTE", "Flags"); for (i = 0; i < PAGETABLE_ENTRIES/2; i++) { PageEntry pte = root->entries[i]; PageTable *l1 = (PageTable *)DMPA2VA(pte & PGNUMMASK); @@ -507,7 +508,7 @@ PMap_DumpConcise(AS *space) PageEntry pte4 = l3->entries[l]; if (pte4 & PTE_P) - kprintf("%016llx: %016llx P%c%c%c%c%c\n", + kprintf("0x%016llx: 0x%016llx P%c%c%c%c%c\n", AddrFromIJKL(i, j, k, l), (uint64_t)pte4, (pte4 & PTE_W) ? 'W' : ' ', @@ -525,11 +526,11 @@ PMap_DumpConcise(AS *space) } static void -Debug_PMapDumpConcise(int argc, const char *argv[]) +Debug_PMapDump(int argc, const char *argv[]) { - PMap_DumpConcise(currentAS[THISCPU()]); + PMap_Dump(currentAS[THISCPU()]); } -REGISTER_DBGCMD(pmapdumpconcise, "Dump concise memory mappings", Debug_PMapDumpConcise); +REGISTER_DBGCMD(pmapdump, "Dump memory mappings", Debug_PMapDump);