aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2008-07-02 05:41:23 +0000
committerAlan Cox <alc@FreeBSD.org>2008-07-02 05:41:23 +0000
commitc4a6405c88157159ca351597cf83c1a4e5502fbd (patch)
tree40466f7608fc42f4c14a4ba4f2a5cd8ec8f0d00d /sys
parentace7ed5dd5e355e92c6f2da2937d738ee401251c (diff)
downloadsrc-c4a6405c88157159ca351597cf83c1a4e5502fbd.tar.gz
src-c4a6405c88157159ca351597cf83c1a4e5502fbd.zip
Eliminate an unnecessary static variable: nkpt.
Notes
Notes: svn path=/head/; revision=180170
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/pmap.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 2d33c2a575de..a8c0b3c44ab8 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -173,7 +173,6 @@ struct pmap kernel_pmap_store;
vm_offset_t virtual_avail; /* VA of first avail page (after kernel bss) */
vm_offset_t virtual_end; /* VA of last avail page (end of kernel AS) */
-static int nkpt;
static int ndmpdp;
static vm_paddr_t dmaplimit;
vm_offset_t kernel_vm_end;
@@ -543,7 +542,6 @@ pmap_bootstrap(vm_paddr_t *firstaddr)
kernel_pmap->pm_root = NULL;
kernel_pmap->pm_active = -1; /* don't allow deactivation */
TAILQ_INIT(&kernel_pmap->pm_pvchunk);
- nkpt = NKPT;
/*
* Reserve some special page table entries/VA space for temporary
@@ -650,7 +648,7 @@ pmap_init(void)
* page table pages.
*/
pd = pmap_pde(kernel_pmap, VM_MIN_KERNEL_ADDRESS);
- for (i = 0; i < nkpt; i++) {
+ for (i = 0; i < NKPT; i++) {
if ((pd[i] & (PG_PS | PG_V)) == (PG_PS | PG_V))
continue;
mpte = PHYS_TO_VM_PAGE(pd[i] & PG_FRAME);
@@ -1708,10 +1706,8 @@ pmap_growkernel(vm_offset_t addr)
mtx_assert(&kernel_map->system_mtx, MA_OWNED);
if (kernel_vm_end == 0) {
kernel_vm_end = VM_MIN_KERNEL_ADDRESS;
- nkpt = 0;
while ((*pmap_pde(kernel_pmap, kernel_vm_end) & PG_V) != 0) {
kernel_vm_end = (kernel_vm_end + PAGE_SIZE * NPTEPG) & ~(PAGE_SIZE * NPTEPG - 1);
- nkpt++;
if (kernel_vm_end - 1 >= kernel_map->max_offset) {
kernel_vm_end = kernel_map->max_offset;
break;
@@ -1725,7 +1721,7 @@ pmap_growkernel(vm_offset_t addr)
pde = pmap_pde(kernel_pmap, kernel_vm_end);
if (pde == NULL) {
/* We need a new PDP entry */
- nkpg = vm_page_alloc(NULL, nkpt,
+ nkpg = vm_page_alloc(NULL, kernel_vm_end >> PDPSHIFT,
VM_ALLOC_NOOBJ | VM_ALLOC_SYSTEM | VM_ALLOC_WIRED);
if (nkpg == NULL)
panic("pmap_growkernel: no memory to grow kernel");
@@ -1749,9 +1745,6 @@ pmap_growkernel(vm_offset_t addr)
VM_ALLOC_NOOBJ | VM_ALLOC_SYSTEM | VM_ALLOC_WIRED);
if (nkpg == NULL)
panic("pmap_growkernel: no memory to grow kernel");
-
- nkpt++;
-
pmap_zero_page(nkpg);
paddr = VM_PAGE_TO_PHYS(nkpg);
newpdir = (pd_entry_t) (paddr | PG_V | PG_RW | PG_A | PG_M);