diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-06-07 09:26:57 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-06-07 09:26:57 +0200 |
commit | 7bc8f4d993fce693f664a9bc8361e7b5633ed7df (patch) | |
tree | b37251e0eb8a61d0bcfbaac3a921aedfca65f4dc | |
parent | 2e713acc2c24b59003c4abeb099d87c88064842d (diff) | |
download | plan9front-7bc8f4d993fce693f664a9bc8361e7b5633ed7df.tar.xz |
pc64: implement checkmmu() debug function
-rw-r--r-- | sys/src/9/pc64/mmu.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/src/9/pc64/mmu.c b/sys/src/9/pc64/mmu.c index 8081eb7d6..eeed702ed 100644 --- a/sys/src/9/pc64/mmu.c +++ b/sys/src/9/pc64/mmu.c @@ -438,10 +438,19 @@ putmmu(uintptr va, uintptr pa, Page *) invlpg(va); } +/* + * Double-check the user MMU. + * Error checking only. + */ void checkmmu(uintptr va, uintptr pa) { - USED(va, pa); + uintptr *pte; + + pte = mmuwalk(m->pml4, va, 0, 0); + if(pte != 0 && (*pte & PTEVALID) != 0 && PPN(*pte) != pa) + print("%ld %s: va=%#p pa=%#p pte=%#p\n", + up->pid, up->text, va, pa, *pte); } uintptr |