Fix flag usage

This commit is contained in:
Mathieu Maret 2018-11-13 10:37:28 +01:00
parent a120647ecb
commit 8f5c68efaf

View File

@ -138,7 +138,7 @@ int pageMap(vaddr_t vaddr, paddr_t paddr, int flags)
paddr_t ptPhy = allocPhyPage();
memset((void *)ptPhy, 0, PAGE_SIZE);
pd[pdEntry].user = (flags & PAGING_MEM_USER) ? 0:1;
pd[pdEntry].user = (flags & PAGING_MEM_USER) ? 1:0;
pd[pdEntry].present = 1;
pd[pdEntry].write = 1;
pd[pdEntry].pt_addr = (ptPhy >> PT_SHIFT);
@ -154,9 +154,9 @@ int pageMap(vaddr_t vaddr, paddr_t paddr, int flags)
refPhyPage(pd[pdEntry].pt_addr << PAGE_SHIFT);
}
pt[ptEntry].user = (flags & PAGING_MEM_USER) ? 0 : 1;
pt[ptEntry].user = (flags & PAGING_MEM_USER) ? 1 : 0;
pt[ptEntry].present = 1;
pt[ptEntry].write = (flags & PAGING_MEM_WRITE) ? 0 : 1;
pt[ptEntry].write = (flags & PAGING_MEM_WRITE) ? 1 : 0;
pt[ptEntry].paddr = paddr >> PAGE_SHIFT;
refPhyPage(paddr);