pc64: implement checkmmu() debug function
This commit is contained in:
parent
2e713acc2c
commit
7bc8f4d993
1 changed files with 10 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue