summaryrefslogtreecommitdiff
path: root/sys/arch/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/powerpc')
-rw-r--r--sys/arch/powerpc/include/pmap.h25
-rw-r--r--sys/arch/powerpc/powerpc/pmap.c30
2 files changed, 15 insertions, 40 deletions
diff --git a/sys/arch/powerpc/include/pmap.h b/sys/arch/powerpc/include/pmap.h
index 1bcba5c2b3e..4d1f268427d 100644
--- a/sys/arch/powerpc/include/pmap.h
+++ b/sys/arch/powerpc/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.13 2001/07/10 01:34:32 drahn Exp $ */
+/* $OpenBSD: pmap.h,v 1.14 2001/07/18 10:47:05 art Exp $ */
/* $NetBSD: pmap.h,v 1.1 1996/09/30 16:34:29 ws Exp $ */
/*-
@@ -38,10 +38,6 @@
#include <machine/pte.h>
/*
- * FUCK
-#define PMAP_NEW
- */
-/*
* Segment registers
*/
#ifndef _LOCORE
@@ -84,22 +80,11 @@ extern struct pmap kernel_pmap_;
int ptebits(paddr_t pa, int bit);
-#ifdef PMAP_NEW
-#define pmap_clear_modify(page) (ptemodify((page)->phys_addr, PTE_CHG, 0))
-#define pmap_clear_reference(page) (ptemodify((page)->phys_addr, PTE_REF, 0))
-#define pmap_is_modified(page) (ptebits((page)->phys_addr, PTE_CHG))
-#define pmap_is_referenced(page) (ptebits((page)->phys_addr, PTE_REF))
+#define pmap_clear_modify(page) (ptemodify(VM_PAGE_TO_PHYS(page), PTE_CHG, 0))
+#define pmap_clear_reference(page) (ptemodify(VM_PAGE_TO_PHYS(page), PTE_REF, 0))
+#define pmap_is_modified(page) (ptebits(VM_PAGE_TO_PHYS(page), PTE_CHG))
+#define pmap_is_referenced(page) (ptebits(VM_PAGE_TO_PHYS(page), PTE_REF))
#define pmap_unwire(pm, va)
-#else
-#define pmap_clear_modify(pa) (ptemodify((pa), PTE_CHG, 0))
-#define pmap_clear_reference(pa) (ptemodify((pa), PTE_REF, 0))
-#define pmap_is_modified(pa) (ptebits((pa), PTE_CHG))
-#define pmap_is_referenced(pa) (ptebits((pa), PTE_REF))
-#define pmap_unwire(pm, va)
-/* XXX */
-void pmap_kenter_pa(vaddr_t va, paddr_t pa, vm_prot_t prot);
-#endif
-
#define pmap_phys_address(x) (x)
#define pmap_resident_count(pmap) ((pmap)->pm_stats.resident_count)
diff --git a/sys/arch/powerpc/powerpc/pmap.c b/sys/arch/powerpc/powerpc/pmap.c
index 7938f0fea2d..44c104b4edf 100644
--- a/sys/arch/powerpc/powerpc/pmap.c
+++ b/sys/arch/powerpc/powerpc/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.35 2001/07/09 02:14:05 mickey Exp $ */
+/* $OpenBSD: pmap.c,v 1.36 2001/07/18 10:47:05 art Exp $ */
/* $NetBSD: pmap.c,v 1.1 1996/09/30 16:34:52 ws Exp $ */
/*
@@ -825,14 +825,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;
@@ -1442,9 +1436,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;
{
@@ -1453,10 +1447,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);
/*
@@ -1466,7 +1463,7 @@ ptemodify(pa, mask, val)
*pattr |= val >> ATTRSHFT;
if (pv->pv_idx < 0)
- return;
+ return (ret);
s = splimp();
for (; pv; pv = pv->pv_next) {
@@ -1501,6 +1498,8 @@ ptemodify(pa, mask, val)
}
}
splx(s);
+
+ return (ret);
}
int
@@ -1569,21 +1568,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;
int s;
struct pmap *pm;