x86: fix crash in _x86_mmu_get_flags
Looking up the PTE flags was page faulting if the address wasn't marked as present in the page directory, since there is no page table for that directory entry. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
4d831a7bdd
commit
094f2cb77b
1 changed files with 5 additions and 1 deletions
|
@ -36,7 +36,11 @@ void _x86_mmu_get_flags(void *addr, u32_t *pde_flags, u32_t *pte_flags)
|
|||
{
|
||||
|
||||
*pde_flags = X86_MMU_GET_PDE(addr)->value & ~MMU_PDE_PAGE_TABLE_MASK;
|
||||
if (*pde_flags & MMU_ENTRY_PRESENT) {
|
||||
*pte_flags = X86_MMU_GET_PTE(addr)->value & ~MMU_PTE_PAGE_MASK;
|
||||
} else {
|
||||
*pte_flags = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue