From fde3b8ee3eaf48b1a6bb14568aedc207e62accab Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 6 Nov 2008 21:19:34 -0800 Subject: [PATCH] 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. --- src/threads/init.c | 8 ++++---- src/threads/init.h | 2 +- src/userprog/pagedir.c | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) 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 -- 2.30.2