From: Ben Pfaff Date: Mon, 20 Sep 2004 04:33:15 +0000 (+0000) Subject: Add some `const' qualifiers. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ea405c96b7c50192fe22bd6d8b2af8695c66244;p=pintos-anon Add some `const' qualifiers. --- diff --git a/src/userprog/pagedir.c b/src/userprog/pagedir.c index 39a8f0a..bfcda45 100644 --- a/src/userprog/pagedir.c +++ b/src/userprog/pagedir.c @@ -40,7 +40,6 @@ lookup_page (uint32_t *pd, void *upage, bool create) uint32_t *pde; ASSERT (pd != NULL); - ASSERT (pg_ofs (upage) == 0); ASSERT (upage < PHYS_BASE); /* Check for a page table for UPAGE. @@ -84,9 +83,9 @@ pagedir_set_page (uint32_t *pd, void *upage, void *kpage, } void * -pagedir_get_page (uint32_t *pd, void *upage) +pagedir_get_page (uint32_t *pd, const void *upage) { - uint32_t *pte = lookup_page (pd, upage, false); + uint32_t *pte = lookup_page (pd, (void *) upage, false); return pte != NULL && *pte != 0 ? pte_get_page (*pte) : NULL; } diff --git a/src/userprog/pagedir.h b/src/userprog/pagedir.h index e2fd8a6..d3e2ce8 100644 --- a/src/userprog/pagedir.h +++ b/src/userprog/pagedir.h @@ -8,7 +8,7 @@ uint32_t *pagedir_create (void); void pagedir_destroy (uint32_t *); bool pagedir_set_page (uint32_t *pagedir, void *upage, void *kpage, bool writable); -void *pagedir_get_page (uint32_t *pagedir, void *upage); +void *pagedir_get_page (uint32_t *pagedir, const void *upage); void pagedir_clear_page (uint32_t *pagedir, void *upage); void pagedir_activate (uint32_t *pagedir);