summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorHugh Graham <hugh@cvs.openbsd.org>2001-05-16 17:29:41 +0000
committerHugh Graham <hugh@cvs.openbsd.org>2001-05-16 17:29:41 +0000
commit8ef519c605c6713e9d25630a5dae5cdb2390b0ed (patch)
tree08b9d1386f29abfca2acc1d3e36c9e0a20b1a579 /sys/arch
parenta90a299e35c9e4e00e2ca50d19e1297d5dd3db16 (diff)
Fix vax to work with recent pmap_change_wiring() -> pmap_unwire()
changes. Mostly from NetBSD.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/vax/include/pmap.h3
-rw-r--r--sys/arch/vax/vax/pmap.c30
2 files changed, 16 insertions, 17 deletions
diff --git a/sys/arch/vax/include/pmap.h b/sys/arch/vax/include/pmap.h
index 412aefaff0f..c1d9ea00686 100644
--- a/sys/arch/vax/include/pmap.h
+++ b/sys/arch/vax/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.9 2000/04/26 03:08:42 bjc Exp $ */
+/* $OpenBSD: pmap.h,v 1.10 2001/05/16 17:29:40 hugh Exp $ */
/* $NetBSD: pmap.h,v 1.37 1999/08/01 13:48:07 ragge Exp $ */
/*
@@ -123,7 +123,6 @@ extern struct pmap kernel_pmap_store;
/* Routines that are best to define as macros */
#define pmap_phys_address(phys) ((u_int)(phys) << PGSHIFT)
-#define pmap_unwire(pmap, v) /* no need */
#define pmap_copy(a,b,c,d,e) /* Dont do anything */
#define pmap_update() mtpr(0,PR_TBIA) /* Update buffes */
#define pmap_collect(pmap) /* No need so far */
diff --git a/sys/arch/vax/vax/pmap.c b/sys/arch/vax/vax/pmap.c
index a00a8ca75ef..a619e1d4887 100644
--- a/sys/arch/vax/vax/pmap.c
+++ b/sys/arch/vax/vax/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.15 2001/05/09 15:31:28 art Exp $ */
+/* $OpenBSD: pmap.c,v 1.16 2001/05/16 17:29:39 hugh Exp $ */
/* $NetBSD: pmap.c,v 1.74 1999/11/13 21:32:25 matt Exp $ */
/*
* Copyright (c) 1994, 1998, 1999 Ludd, University of Lule}, Sweden.
@@ -351,7 +351,7 @@ pmap_decpteref(pmap, pte)
return;
index = ((vaddr_t)pte - (vaddr_t)pmap->pm_p0br) >> PGSHIFT;
- pte = (struct pte *)trunc_page(pte);
+ pte = (struct pte *)trunc_page((vaddr_t)pte);
#ifdef PMAPDEBUG
if (startpmapdebug)
printf("pmap_decpteref: pmap %p pte %p index %d refcnt %d\n",
@@ -457,7 +457,6 @@ if(startpmapdebug)printf("pmap_release: pmap %p\n",pmap);
#endif
extent_free(ptemap, (u_long)pmap->pm_p0br,
USRPTSIZE * sizeof(struct pte), EX_WAITOK);
- mtpr(0, PR_TBIA);
}
void
@@ -586,7 +585,6 @@ if(startpmapdebug)
ptp[5] = ptp[0] + 5;
ptp[6] = ptp[0] + 6;
ptp[7] = ptp[0] + 7;
- mtpr(0, PR_TBIA);
}
void
@@ -650,7 +648,6 @@ if(startpmapdebug)
ptp[7] = ptp[0] + 7;
ptp += LTOHPN;
}
- mtpr(0, PR_TBIA);
}
/*
@@ -704,6 +701,9 @@ if (startpmapdebug)
(prot & VM_PROT_WRITE ? PG_RW : PG_RO);
}
+ if (wired)
+ newpte |= PG_W;
+
/*
* Check if a pte page must be mapped in.
*/
@@ -744,15 +744,19 @@ if (startpmapdebug)
oldpte = patch[i] & ~(PG_V|PG_M);
- /* No mapping change. Can this happen??? */
- if (newpte == oldpte) {
+ /* No mapping change. Not allowed to happen. */
+ if (newpte == oldpte)
+ panic("pmap_enter onto myself");
+
+ pv = pv_table + (p >> PGSHIFT);
+
+ /* wiring change? */
+ if (newpte == (oldpte | PG_W)) {
+ patch[i] |= PG_W; /* Just wiring change */
RECURSEEND;
- mtpr(0, PR_TBIA); /* Always; safety belt */
return;
}
- pv = pv_table + (p >> PGSHIFT);
-
/* Changing mapping? */
oldpte &= PG_FRAME;
if ((newpte & PG_FRAME) != oldpte) {
@@ -780,14 +784,11 @@ if (startpmapdebug)
}
splx(s);
} else {
- /* No mapping change, just flush the TLB */
+ /* No mapping change, just flush the TLB; necessary? */
mtpr(0, PR_TBIA);
}
pmap->pm_stats.resident_count++;
- if(wired)
- newpte |= PG_W;
-
if (access_type & VM_PROT_READ) {
pv->pv_attr |= PG_V;
newpte |= PG_V;
@@ -856,7 +857,6 @@ if(startpmapdebug)
*pentry++ = (count>>VAX_PGSHIFT)|PG_V|
(prot & VM_PROT_WRITE ? PG_KW : PG_KR);
}
- mtpr(0,PR_TBIA);
return(virtuell+(count-pstart)+KERNBASE);
}