From: Ben Pfaff Date: Fri, 7 Nov 2008 05:19:34 +0000 (-0800) Subject: Rename base_page_dir to init_page_dir. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb0dce4c37c08ec17bbc648e8d11afb8a63d24f5;p=pintos-anon Rename base_page_dir to init_page_dir. This makes its name fit the convention that the file name is used as a prefix for global symbol names. Found by Godmar with his process-linker-map.pl script. --- diff --git a/solutions/p3.patch b/solutions/p3.patch index 556be83..a7dafb2 100644 --- a/solutions/p3.patch +++ b/solutions/p3.patch @@ -318,7 +318,7 @@ diff -u src/userprog/pagedir.c~ src/userprog/pagedir.c --- src/userprog/pagedir.c~ +++ src/userprog/pagedir.c @@ -35,15 +35,7 @@ pagedir_destroy (uint32_t *pd) - ASSERT (pd != base_page_dir); + ASSERT (pd != init_page_dir); for (pde = pd; pde < pd + pd_no (PHYS_BASE); pde++) if (*pde & PTE_P) - { diff --git a/solutions/p4.patch b/solutions/p4.patch index d1281ca..1a66b52 100644 --- a/solutions/p4.patch +++ b/solutions/p4.patch @@ -2266,7 +2266,7 @@ diff -u src/userprog/pagedir.c~ src/userprog/pagedir.c --- src/userprog/pagedir.c~ +++ src/userprog/pagedir.c @@ -35,15 +35,7 @@ pagedir_destroy (uint32_t *pd) - ASSERT (pd != base_page_dir); + ASSERT (pd != init_page_dir); for (pde = pd; pde < pd + pd_no (PHYS_BASE); pde++) if (*pde & PTE_P) - { diff --git a/src/threads/init.c b/src/threads/init.c index a831a80..60d6c46 100644 --- a/src/threads/init.c +++ b/src/threads/init.c @@ -40,7 +40,7 @@ size_t ram_pages; /* Page directory with kernel mappings only. */ -uint32_t *base_page_dir; +uint32_t *init_page_dir; #ifdef FILESYS /* -f: Format the file system? */ @@ -152,7 +152,7 @@ ram_init (void) /* Populates the base page directory and page table with the kernel virtual mapping, and then sets up the CPU to use the - new page directory. Points base_page_dir to the page + new page directory. Points init_page_dir to the page directory it creates. At the time this function is called, the active page table @@ -166,7 +166,7 @@ paging_init (void) size_t page; extern char _start, _end_kernel_text; - pd = base_page_dir = palloc_get_page (PAL_ASSERT | PAL_ZERO); + pd = init_page_dir = palloc_get_page (PAL_ASSERT | PAL_ZERO); pt = NULL; for (page = 0; page < ram_pages; page++) { @@ -190,7 +190,7 @@ paging_init (void) new page tables immediately. See [IA32-v2a] "MOV--Move to/from Control Registers" and [IA32-v3a] 3.7.5 "Base Address of the Page Directory". */ - asm volatile ("movl %0, %%cr3" : : "r" (vtop (base_page_dir))); + asm volatile ("movl %0, %%cr3" : : "r" (vtop (init_page_dir))); } /* Breaks the kernel command line into words and returns them as diff --git a/src/threads/init.h b/src/threads/init.h index 963cbd6..f28303c 100644 --- a/src/threads/init.h +++ b/src/threads/init.h @@ -10,7 +10,7 @@ extern size_t ram_pages; /* Page directory with kernel mappings only. */ -extern uint32_t *base_page_dir; +extern uint32_t *init_page_dir; /* -q: Power off when kernel tasks complete? */ extern bool power_off_when_done; diff --git a/src/userprog/pagedir.c b/src/userprog/pagedir.c index 30bdfe2..1442d40 100644 --- a/src/userprog/pagedir.c +++ b/src/userprog/pagedir.c @@ -18,7 +18,7 @@ pagedir_create (void) { uint32_t *pd = palloc_get_page (0); if (pd != NULL) - memcpy (pd, base_page_dir, PGSIZE); + memcpy (pd, init_page_dir, PGSIZE); return pd; } @@ -32,7 +32,7 @@ pagedir_destroy (uint32_t *pd) if (pd == NULL) return; - ASSERT (pd != base_page_dir); + ASSERT (pd != init_page_dir); for (pde = pd; pde < pd + pd_no (PHYS_BASE); pde++) if (*pde & PTE_P) { @@ -104,7 +104,7 @@ pagedir_set_page (uint32_t *pd, void *upage, void *kpage, bool writable) ASSERT (pg_ofs (kpage) == 0); ASSERT (is_user_vaddr (upage)); ASSERT (vtop (kpage) >> PTSHIFT < ram_pages); - ASSERT (pd != base_page_dir); + ASSERT (pd != init_page_dir); pte = lookup_page (pd, upage, true); @@ -220,7 +220,7 @@ void pagedir_activate (uint32_t *pd) { if (pd == NULL) - pd = base_page_dir; + pd = init_page_dir; /* Store the physical address of the page directory into CR3 aka PDBR (page directory base register). This activates our