summaryrefslogtreecommitdiff
path: root/sys/arch/mvmeppc/mvmeppc/pmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/mvmeppc/mvmeppc/pmap.c')
-rw-r--r--sys/arch/mvmeppc/mvmeppc/pmap.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/sys/arch/mvmeppc/mvmeppc/pmap.c b/sys/arch/mvmeppc/mvmeppc/pmap.c
index fd04d8590c8..84edaf00974 100644
--- a/sys/arch/mvmeppc/mvmeppc/pmap.c
+++ b/sys/arch/mvmeppc/mvmeppc/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.4 2001/07/06 05:14:30 smurph Exp $ */
+/* $OpenBSD: pmap.c,v 1.5 2001/07/18 10:47:05 art Exp $ */
/* $NetBSD: pmap.c,v 1.1 1996/09/30 16:34:52 ws Exp $ */
/*
@@ -806,14 +806,8 @@ pmap_next_page(paddr)
/*
* Create and return a physical map.
*/
-#if defined(PMAP_NEW)
struct pmap *
pmap_create()
-#else
-struct pmap *
-pmap_create(size)
- vsize_t size;
-#endif
{
struct pmap *pm;
@@ -1426,9 +1420,9 @@ pmap_protect(pm, sva, eva, prot)
pmap_remove(pm, sva, eva);
}
-void
+boolean_t
ptemodify(pa, mask, val)
- vm_offset_t pa;
+ paddr_t pa;
u_int mask;
u_int val;
{
@@ -1437,10 +1431,13 @@ ptemodify(pa, mask, val)
struct pte_ovfl *po;
int i, s;
char * pattr;
+ boolean_t ret;
+
+ ret = ptebits(pa, mask);
pv = pmap_find_pv(pa);
if (pv == NULL)
- return;
+ return (ret);
pattr = pmap_find_attr(pa);
/*
@@ -1450,7 +1447,7 @@ ptemodify(pa, mask, val)
*pattr |= val >> ATTRSHFT;
if (pv->pv_idx < 0)
- return;
+ return (ret);
s = splimp();
for (; pv; pv = pv->pv_next) {
@@ -1485,6 +1482,8 @@ ptemodify(pa, mask, val)
}
}
splx(s);
+
+ return (ret);
}
int
@@ -1553,21 +1552,12 @@ ptebits(pa, bit)
* There are only two cases: either the protection is going to 0,
* or it is going to read-only.
*/
-#if defined(PMAP_NEW)
void
pmap_page_protect(pg, prot)
struct vm_page *pg;
vm_prot_t prot;
-#else
-void
-pmap_page_protect(pa, prot)
- vm_offset_t pa;
- vm_prot_t prot;
-#endif
{
-#if defined(PMAP_NEW)
vm_offset_t pa = VM_PAGE_TO_PHYS(pg);
-#endif
vm_offset_t va;
pte_t *ptp;
struct pte_ovfl *po, *npo;
@@ -1577,7 +1567,7 @@ pmap_page_protect(pa, prot)
pa &= ~ADDR_POFF;
if (prot & VM_PROT_READ) {
- ptemodify(pa, PTE_PP, PTE_RO);
+ ptemodify(pg, PTE_PP, PTE_RO);
return;
}