Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/amd64/amd64 Rename function variables that shadowed...
details: https://anonhg.NetBSD.org/src/rev/b2f4bb79b71d
branches: trunk
changeset: 581407:b2f4bb79b71d
user: blymn <blymn%NetBSD.org@localhost>
date: Wed Jun 01 13:05:31 2005 +0000
description:
Rename function variables that shadowed globals.
diffstat:
sys/arch/amd64/amd64/pmap.c | 116 ++++++++++++++++++++++----------------------
1 files changed, 58 insertions(+), 58 deletions(-)
diffs (truncated from 405 to 300 lines):
diff -r ccc15fedfe91 -r b2f4bb79b71d sys/arch/amd64/amd64/pmap.c
--- a/sys/arch/amd64/amd64/pmap.c Wed Jun 01 13:05:29 2005 +0000
+++ b/sys/arch/amd64/amd64/pmap.c Wed Jun 01 13:05:31 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.19 2005/05/29 15:56:59 chs Exp $ */
+/* $NetBSD: pmap.c,v 1.20 2005/06/01 13:05:31 blymn Exp $ */
/*
*
@@ -108,7 +108,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.19 2005/05/29 15:56:59 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.20 2005/06/01 13:05:31 blymn Exp $");
#ifndef __x86_64__
#include "opt_cputype.h"
@@ -592,13 +592,13 @@
*/
__inline static boolean_t
-pmap_is_active(pmap, cpu_id)
+pmap_is_active(pmap, cpu_num)
struct pmap *pmap;
- int cpu_id;
+ int cpu_num;
{
return (pmap == pmap_kernel() ||
- (pmap->pm_cpus & (1U << cpu_id)) != 0);
+ (pmap->pm_cpus & (1U << cpu_num)) != 0);
}
/*
@@ -1212,11 +1212,11 @@
void
pmap_prealloc_lowmem_ptps(void)
{
- pd_entry_t *pdes;
+ pd_entry_t *pd_ents;
int level;
paddr_t newp;
- pdes = pmap_kernel()->pm_pdir;
+ pd_ents = pmap_kernel()->pm_pdir;
level = PTP_LEVELS;
for (;;) {
newp = avail_start;
@@ -1224,11 +1224,11 @@
*early_zero_pte = (newp & PG_FRAME) | PG_V | PG_RW;
pmap_update_pg((vaddr_t)early_zerop);
memset(early_zerop, 0, PAGE_SIZE);
- pdes[pl_i(0, level)] = (newp & PG_FRAME) | PG_V | PG_RW;
+ pd_ents[pl_i(0, level)] = (newp & PG_FRAME) | PG_V | PG_RW;
level--;
if (level <= 1)
break;
- pdes = normal_pdes[level - 2];
+ pd_ents = normal_pdes[level - 2];
}
}
@@ -1291,13 +1291,13 @@
* are always all-zero if !LOCKDEBUG.
*/
for (lcv = 0; lcv < vm_nphysseg ; lcv++) {
- int off, npages;
+ int off, num_pages;
struct pmap_physseg *pmsegp;
- npages = vm_physmem[lcv].end - vm_physmem[lcv].start;
+ num_pages = vm_physmem[lcv].end - vm_physmem[lcv].start;
pmsegp = &vm_physmem[lcv].pmseg;
- for (off = 0; off <npages; off++)
+ for (off = 0; off <num_pages; off++)
simple_lock_init(&pmsegp->pvhead[off].pvh_lock);
}
@@ -1704,7 +1704,7 @@
static void
pmap_free_ptp(struct pmap *pmap, struct vm_page *ptp, vaddr_t va,
- pt_entry_t *ptes, pd_entry_t **pdes, int32_t *cpumaskp)
+ pt_entry_t *ptes, pd_entry_t **pd_ents, int32_t *cpumaskp)
{
unsigned long index;
int level;
@@ -1715,9 +1715,9 @@
do {
pmap_freepage(pmap, ptp, level);
index = pl_i(va, level + 1);
- opde = pmap_pte_set(&pdes[level - 1][index], 0);
+ opde = pmap_pte_set(&pd_ents[level - 1][index], 0);
invaladdr = level == 1 ? (vaddr_t)ptes :
- (vaddr_t)pdes[level - 2];
+ (vaddr_t)pd_ents[level - 2];
pmap_tlb_shootdown(curpcb->pcb_pmap,
invaladdr + index * PAGE_SIZE,
opde, cpumaskp);
@@ -1745,7 +1745,7 @@
static struct vm_page *
-pmap_get_ptp(struct pmap *pmap, vaddr_t va, pd_entry_t **pdes)
+pmap_get_ptp(struct pmap *pmap, vaddr_t va, pd_entry_t **pd_ents)
{
struct vm_page *ptp, *pptp;
int i;
@@ -1769,7 +1769,7 @@
ppa = pa;
index = pl_i(va, i);
- pva = pdes[i - 2];
+ pva = pd_ents[i - 2];
if (pmap_valid_entry(pva[index])) {
ppa = pva[index] & PG_FRAME;
@@ -2161,7 +2161,7 @@
*/
static boolean_t
-pmap_pdes_valid(vaddr_t va, pd_entry_t **pdes, pd_entry_t *lastpde)
+pmap_pdes_valid(vaddr_t va, pd_entry_t **pd_ents, pd_entry_t *lastpde)
{
int i;
unsigned long index;
@@ -2169,7 +2169,7 @@
for (i = PTP_LEVELS; i > 1; i--) {
index = pl_i(va, i);
- pde = pdes[i - 2][index];
+ pde = pd_ents[i - 2][index];
if ((pde & PG_V) == 0)
return FALSE;
}
@@ -2189,10 +2189,10 @@
paddr_t *pap;
{
pt_entry_t *ptes, pte;
- pd_entry_t pde, **pdes;
-
- pmap_map_ptes(pmap, &ptes, &pdes);
- if (pmap_pdes_valid(va, pdes, &pde) == FALSE) {
+ pd_entry_t pde, **pd_ents;
+
+ pmap_map_ptes(pmap, &ptes, &pd_ents);
+ if (pmap_pdes_valid(va, pd_ents, &pde) == FALSE) {
pmap_unmap_ptes(pmap);
return FALSE;
}
@@ -2576,7 +2576,7 @@
int flags;
{
pt_entry_t *ptes;
- pd_entry_t **pdes, pde;
+ pd_entry_t **pd_ents, pde;
boolean_t result;
paddr_t ptppa;
vaddr_t blkendva;
@@ -2588,14 +2588,14 @@
*/
PMAP_MAP_TO_HEAD_LOCK();
- pmap_map_ptes(pmap, &ptes, &pdes); /* locks pmap */
+ pmap_map_ptes(pmap, &ptes, &pd_ents); /* locks pmap */
/*
* removing one page? take shortcut function.
*/
if (sva + PAGE_SIZE == eva) {
- if (pmap_pdes_valid(sva, pdes, &pde)) {
+ if (pmap_pdes_valid(sva, pd_ents, &pde)) {
/* PA of the PTP */
ptppa = pde & PG_FRAME;
@@ -2624,7 +2624,7 @@
*/
if (result && ptp && ptp->wire_count <= 1)
- pmap_free_ptp(pmap, ptp, sva, ptes, pdes,
+ pmap_free_ptp(pmap, ptp, sva, ptes, pd_ents,
&cpumask);
}
@@ -2661,7 +2661,7 @@
/* XXXCDC: ugly hack to avoid freeing PDP here */
continue;
- if (!pmap_pdes_valid(sva, pdes, &pde))
+ if (!pmap_pdes_valid(sva, pd_ents, &pde))
continue;
/* PA of the PTP */
@@ -2684,7 +2684,7 @@
/* if PTP is no longer being used, free it! */
if (ptp && ptp->wire_count <= 1) {
- pmap_free_ptp(pmap, ptp, sva, ptes,pdes,
+ pmap_free_ptp(pmap, ptp, sva, ptes,pd_ents,
&cpumask);
}
}
@@ -2709,7 +2709,7 @@
struct pv_head *pvh;
struct pv_entry *pve, *npve, *killlist = NULL;
pt_entry_t *ptes, opte;
- pd_entry_t **pdes;
+ pd_entry_t **pd_ents;
#ifdef DIAGNOSTIC
pd_entry_t pde;
#endif
@@ -2733,10 +2733,10 @@
for (pve = SPLAY_MIN(pvtree, &pvh->pvh_root); pve != NULL; pve = npve) {
npve = SPLAY_NEXT(pvtree, &pvh->pvh_root, pve);
- pmap_map_ptes(pve->pv_pmap, &ptes, &pdes); /* locks pmap */
+ pmap_map_ptes(pve->pv_pmap, &ptes, &pd_ents); /* locks pmap */
#ifdef DIAGNOSTIC
- if (pve->pv_ptp && pmap_pdes_valid(pve->pv_va, pdes, &pde) &&
+ if (pve->pv_ptp && pmap_pdes_valid(pve->pv_va, pd_ents, &pde) &&
(pde & PG_FRAME) != VM_PAGE_TO_PHYS(pve->pv_ptp)) {
printf("pmap_page_remove: pg=%p: va=%lx, pv_ptp=%p\n",
pg, pve->pv_va, pve->pv_ptp);
@@ -2766,7 +2766,7 @@
pve->pv_ptp->wire_count--;
if (pve->pv_ptp->wire_count <= 1) {
pmap_free_ptp(pve->pv_pmap, pve->pv_ptp,
- pve->pv_va, ptes, pdes, &cpumask);
+ pve->pv_va, ptes, pd_ents, &cpumask);
}
}
pmap_unmap_ptes(pve->pv_pmap); /* unlocks pmap */
@@ -2803,7 +2803,7 @@
struct pv_head *pvh;
struct pv_entry *pve;
pt_entry_t *ptes, pte;
- pd_entry_t **pdes;
+ pd_entry_t **pd_ents;
/* XXX: vm_page should either contain pv_head or have a pointer to it */
bank = vm_physseg_find(atop(VM_PAGE_TO_PHYS(pg)), &off);
@@ -2833,7 +2833,7 @@
for (pve = SPLAY_MIN(pvtree, &pvh->pvh_root);
pve != NULL && (*myattrs & testbits) == 0;
pve = SPLAY_NEXT(pvtree, &pvh->pvh_root, pve)) {
- pmap_map_ptes(pve->pv_pmap, &ptes, &pdes);
+ pmap_map_ptes(pve->pv_pmap, &ptes, &pd_ents);
pte = ptes[pl1_i(pve->pv_va)];
pmap_unmap_ptes(pve->pv_pmap);
*myattrs |= pte;
@@ -2866,7 +2866,7 @@
struct pv_head *pvh;
struct pv_entry *pve;
pt_entry_t *ptes, opte;
- pd_entry_t **pdes;
+ pd_entry_t **pd_ents;
unsigned char *myattrs;
int32_t cpumask = 0;
@@ -2885,9 +2885,9 @@
*myattrs &= ~clearbits;
SPLAY_FOREACH(pve, pvtree, &pvh->pvh_root) {
- pmap_map_ptes(pve->pv_pmap, &ptes, &pdes); /* locks pmap */
+ pmap_map_ptes(pve->pv_pmap, &ptes, &pd_ents); /* locks pmap */
#ifdef DIAGNOSTIC
- if (!pmap_pdes_valid(pve->pv_va, pdes, NULL))
+ if (!pmap_pdes_valid(pve->pv_va, pd_ents, NULL))
panic("pmap_change_attrs: mapping without PTP "
"detected");
#endif
@@ -2943,11 +2943,11 @@
vm_prot_t prot;
{
pt_entry_t *ptes, *spte, *epte;
- pd_entry_t **pdes;
+ pd_entry_t **pd_ents;
vaddr_t blockend;
int32_t cpumask = 0;
- pmap_map_ptes(pmap, &ptes, &pdes); /* locks pmap */
+ pmap_map_ptes(pmap, &ptes, &pd_ents); /* locks pmap */
/* should be ok, but just in case ... */
sva &= PG_FRAME;
@@ -2973,7 +2973,7 @@
continue;
/* empty block? */
- if (!pmap_pdes_valid(sva, pdes, NULL))
+ if (!pmap_pdes_valid(sva, pd_ents, NULL))
continue;
#ifdef DIAGNOSTIC
@@ -3014,11 +3014,11 @@
vaddr_t va;
Home |
Main Index |
Thread Index |
Old Index