all of PTE_FLAGS

This commit is contained in:
Robert Morris 2019-09-17 06:07:58 -04:00
parent 036b5edf12
commit 2df42355f7
3 changed files with 5 additions and 5 deletions

View file

@ -338,7 +338,7 @@ sfence_vma()
#define PTE2PA(pte) (((pte) >> 10) << 12)
#define PTE_FLAGS(pte) ((pte) & (PTE_V|PTE_R|PTE_W|PTE_X|PTE_U))
#define PTE_FLAGS(pte) ((pte) & 0x3FF)
// extract the three 9-bit page table indices from a virtual address.
#define PXMASK 0x1FF // 9 bits

View file

@ -95,10 +95,10 @@ usertrapret(void)
// now from kerneltrap() to usertrap().
intr_off();
// send interrupts and exceptions to trampoline.S
// send syscalls, interrupts, and exceptions to trampoline.S
w_stvec(TRAMPOLINE + (uservec - trampoline));
// set up values that uservec will need when
// set up trapframe values that uservec will need when
// the process next re-enters the kernel.
p->tf->kernel_satp = r_satp(); // kernel page table
p->tf->kernel_sp = p->kstack + PGSIZE; // process's kernel stack

View file

@ -314,9 +314,9 @@ uvmcopy(pagetable_t old, pagetable_t new, uint64 sz)
for(i = 0; i < sz; i += PGSIZE){
if((pte = walk(old, i, 0)) == 0)
panic("copyuvm: pte should exist");
panic("uvmcopy: pte should exist");
if((*pte & PTE_V) == 0)
panic("copyuvm: page not present");
panic("uvmcopy: page not present");
pa = PTE2PA(*pte);
flags = PTE_FLAGS(*pte);
if((mem = kalloc()) == 0)