From 91aa0f3296ea0b38dd8d008224271639e5d7b53a Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Fri, 2 Sep 2011 14:35:58 -0400 Subject: [PATCH] Move copy_pte_u; fits vm.c in one less column and aligns proc.h --- vm.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/vm.c b/vm.c index c30694e..10687fc 100644 --- a/vm.c +++ b/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; -}