paging: fix free unused pte

This commit is contained in:
Mathieu Maret 2018-11-15 22:53:27 +01:00
parent ea9e5f7f23
commit ac64b124da

View File

@ -150,7 +150,7 @@ int pageMap(vaddr_t vaddr, paddr_t paddr, int flags)
__native_flush_tlb_single((vaddr_t)pt); __native_flush_tlb_single((vaddr_t)pt);
memset((void *)pt, 0, PAGE_SIZE); memset((void *)pt, 0, PAGE_SIZE);
} } else {
// Already mapped ? Remove old mapping // Already mapped ? Remove old mapping
if (pt[ptEntry].present) { if (pt[ptEntry].present) {
@ -159,6 +159,7 @@ int pageMap(vaddr_t vaddr, paddr_t paddr, int flags)
else { else {
refPhyPage(pd[pdEntry].pt_addr << PAGE_SHIFT); refPhyPage(pd[pdEntry].pt_addr << PAGE_SHIFT);
} }
}
pt[ptEntry].user = (flags & PAGING_MEM_USER) ? 1 : 0; pt[ptEntry].user = (flags & PAGING_MEM_USER) ? 1 : 0;
pt[ptEntry].present = 1; pt[ptEntry].present = 1;