Move copy_pte_u; fits vm.c in one less column and aligns proc.h
This commit is contained in:
parent
9e4272c14e
commit
91aa0f3296
1 changed files with 13 additions and 13 deletions
26
vm.c
26
vm.c
|
@ -289,6 +289,19 @@ freevm(pde_t *pgdir)
|
|||
kfree((char*)pgdir);
|
||||
}
|
||||
|
||||
// Clear PTE_U on a page. Used to create an inaccessible
|
||||
// page beneath the user stack.
|
||||
void
|
||||
clear_pte_u(pde_t *pgdir, char *uva)
|
||||
{
|
||||
pte_t *pte;
|
||||
|
||||
pte = walkpgdir(pgdir, uva, 0);
|
||||
if(pte == 0)
|
||||
panic("clear_pte_u");
|
||||
*pte &= ~PTE_U;
|
||||
}
|
||||
|
||||
// Given a parent process's page table, create a copy
|
||||
// of it for a child.
|
||||
pde_t*
|
||||
|
@ -360,16 +373,3 @@ copyout(pde_t *pgdir, uint va, void *p, uint len)
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Clear PTE_U on a page. Used to create an inaccessible
|
||||
// page beneath the user stack.
|
||||
void
|
||||
clear_pte_u(pde_t *pgdir, char *uva)
|
||||
{
|
||||
pte_t *pte;
|
||||
|
||||
pte = walkpgdir(pgdir, uva, 0);
|
||||
if(pte == 0)
|
||||
panic("clear_pte_u");
|
||||
*pte &= ~PTE_U;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue