If the pgdir in debug_print_pgdir is not set, assume rcr3()
authorRon Minnich <rminnich@gmail.com>
Mon, 23 Mar 2015 20:02:29 +0000 (13:02 -0700)
committerRon Minnich <rminnich@gmail.com>
Mon, 23 Mar 2015 20:05:11 +0000 (13:05 -0700)
This is a convenience when using the monitor

Signed-off-by: Ron Minnich <rminnich@gmail.com>
kern/arch/x86/pmap64.c

index 2fb1112..5b76771 100644 (file)
@@ -600,6 +600,8 @@ static int print_pte(kpte_t *kpte, uintptr_t kva, int shift, bool visited_subs,
 
 void debug_print_pgdir(kpte_t *pgdir)
 {
 
 void debug_print_pgdir(kpte_t *pgdir)
 {
+       if (! pgdir)
+               pgdir = KADDR(rcr3());
        printk("Printing the entire page table set for %p, DFS\n", pgdir);
        /* Need to be careful we avoid VPT/UVPT, o/w we'll recurse */
        pml_for_each(pgdir, 0, UVPT, print_pte, 0);
        printk("Printing the entire page table set for %p, DFS\n", pgdir);
        /* Need to be careful we avoid VPT/UVPT, o/w we'll recurse */
        pml_for_each(pgdir, 0, UVPT, print_pte, 0);