summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2008-07-02 05:41:23 +0000
committeralc <alc@FreeBSD.org>2008-07-02 05:41:23 +0000
commit04dc8c2e9ca4c8f78470df89b1e5bdb533e64838 (patch)
tree40466f7608fc42f4c14a4ba4f2a5cd8ec8f0d00d /sys/amd64
parent31d44ce02d9145b4036bf1623d725f9bd0ffdf19 (diff)
downloadFreeBSD-src-04dc8c2e9ca4c8f78470df89b1e5bdb533e64838.zip
FreeBSD-src-04dc8c2e9ca4c8f78470df89b1e5bdb533e64838.tar.gz
Eliminate an unnecessary static variable: nkpt.
Diffstat (limited to 'sys/amd64')
-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 2d33c2a..a8c0b3c 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);
OpenPOWER on IntegriCloud