user_space #4

Merged
mathieu merged 40 commits from user_space into master 2021-11-04 16:17:36 +01:00
Showing only changes of commit ebc90d3f06 - Show all commits

View File

@ -162,7 +162,8 @@ 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) {
@ -223,7 +224,7 @@ paddr_t pagingGetPaddr(vaddr_t vaddr)
/* Get the page directory entry and table entry index for this /* Get the page directory entry and table entry index for this
address */ address */
unsigned pdEntry = vaddr >> PD_SHIFT; unsigned pdEntry = vaddr >> PD_SHIFT;
unsigned ptEntry = vaddr >> PT_SHIFT; unsigned ptEntry = vaddr >> PT_SHIFT & PTE_MASK;
unsigned pageOffset = vaddr & PAGE_MASK; unsigned pageOffset = vaddr & PAGE_MASK;
// Thank to mirroring, we can access the PD // Thank to mirroring, we can access the PD