Minor comments.
This commit is contained in:
parent
4fdf4028a4
commit
ddb1b65d61
2 changed files with 3 additions and 3 deletions
|
@ -38,7 +38,7 @@ proc_mapstacks(pagetable_t kpgtbl)
|
|||
char *pa = kalloc();
|
||||
if(pa == 0)
|
||||
panic("kalloc");
|
||||
uint64 va = KSTACK((int) (p - proc));
|
||||
uint64 va = KSTACK((int) (p - proc)); // p-proc = to get an index (0 to 7)
|
||||
kvmmap(kpgtbl, va, (uint64)pa, PGSIZE, PTE_R | PTE_W);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -158,9 +158,9 @@ mappages(pagetable_t pagetable, uint64 va, uint64 size, uint64 pa, int perm)
|
|||
a = va;
|
||||
last = va + size - PGSIZE;
|
||||
for(;;){
|
||||
if((pte = walk(pagetable, a, 1)) == 0)
|
||||
if((pte = walk(pagetable, a, 1)) == 0) // In case the PTE hasn't been allocated.
|
||||
return -1;
|
||||
if(*pte & PTE_V)
|
||||
if(*pte & PTE_V) // In case the PTE already was allocated to someone else (it is valid).
|
||||
panic("mappages: remap");
|
||||
*pte = PA2PTE(pa) | perm | PTE_V;
|
||||
if(a == last)
|
||||
|
|
Loading…
Add table
Reference in a new issue