Move copy_pte_u; fits vm.c in one less column and aligns proc.h

This commit is contained in:
Austin Clements 2011-09-02 14:35:58 -04:00
parent 9e4272c14e
commit 91aa0f3296

26
vm.c
View file

@ -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;
}