Make names line up with text
This commit is contained in:
parent
2fa3a8fd05
commit
704775b63d
18
vm.c
18
vm.c
|
@ -66,22 +66,22 @@ seginit(void)
|
||||||
static pte_t *
|
static pte_t *
|
||||||
walkpgdir(pde_t *pml4, const void *va, int alloc)
|
walkpgdir(pde_t *pml4, const void *va, int alloc)
|
||||||
{
|
{
|
||||||
pde_t *pgtab = pml4;
|
pde_t *pgdir = pml4;
|
||||||
pde_t *pte;
|
pde_t *pde;
|
||||||
int level;
|
int level;
|
||||||
|
|
||||||
for (level = L_PML4; level > 0; level--) {
|
for (level = L_PML4; level > 0; level--) {
|
||||||
pte = &pgtab[PX(level, va)];
|
pde = &pgdir[PX(level, va)];
|
||||||
if(*pte & PTE_P)
|
if(*pde & PTE_P)
|
||||||
pgtab = (pte_t*)P2V(PTE_ADDR(*pte));
|
pgdir = (pte_t*)P2V(PTE_ADDR(*pde));
|
||||||
else {
|
else {
|
||||||
if(!alloc || (pgtab = (pte_t*)kalloc()) == 0)
|
if(!alloc || (pgdir = (pde_t*)kalloc()) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
memset(pgtab, 0, PGSIZE);
|
memset(pgdir, 0, PGSIZE);
|
||||||
*pte = V2P(pgtab) | PTE_P | PTE_W | PTE_U;
|
*pde = V2P(pgdir) | PTE_P | PTE_W | PTE_U;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return &pgtab[PX(level, va)];
|
return &pgdir[PX(level, va)];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create PTEs for virtual addresses starting at va that refer to
|
// Create PTEs for virtual addresses starting at va that refer to
|
||||||
|
|
Loading…
Reference in a new issue