summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-06-17 16:29:12 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-06-17 16:29:12 +0000
commitf1553a4136f90ff275ea219f01956c86bd7afeff (patch)
tree5c7f101826834efdec2989db19626f645b693966
parenta2aeb9f207e15e74bc8f59dfc7c1ac40dcaafb56 (diff)
Introduce pmap_kenter_cache(), similar to pmap_kenter_pa() but allowing
the pte cache bits to be specified. Will be used very soon.
-rw-r--r--sys/arch/m68k/include/pmap_motorola.h4
-rw-r--r--sys/arch/m68k/m68k/pmap_motorola.c36
2 files changed, 29 insertions, 11 deletions
diff --git a/sys/arch/m68k/include/pmap_motorola.h b/sys/arch/m68k/include/pmap_motorola.h
index f76d47f5b44..00dba40bd9a 100644
--- a/sys/arch/m68k/include/pmap_motorola.h
+++ b/sys/arch/m68k/include/pmap_motorola.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap_motorola.h,v 1.13 2005/10/23 19:00:25 martin Exp $ */
+/* $OpenBSD: pmap_motorola.h,v 1.14 2006/06/17 16:29:10 miod Exp $ */
/*
* Copyright (c) 1987 Carnegie-Mellon University
@@ -135,6 +135,8 @@ extern char *vmmap; /* map for mem, dumps, etc. */
void pmap_proc_iflush(struct proc *, vaddr_t, vsize_t);
+void pmap_kenter_cache(vaddr_t, paddr_t, pt_entry_t);
+
#ifdef M68K_MMU_HP
void pmap_prefer(vaddr_t, vaddr_t *);
#define PMAP_PREFER(foff, vap) pmap_prefer((foff), (vap))
diff --git a/sys/arch/m68k/m68k/pmap_motorola.c b/sys/arch/m68k/m68k/pmap_motorola.c
index 7c25cce0c8a..41ffb3eb0cb 100644
--- a/sys/arch/m68k/m68k/pmap_motorola.c
+++ b/sys/arch/m68k/m68k/pmap_motorola.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap_motorola.c,v 1.43 2006/06/11 20:48:51 miod Exp $ */
+/* $OpenBSD: pmap_motorola.c,v 1.44 2006/06/17 16:29:11 miod Exp $ */
/*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -1291,12 +1291,32 @@ pmap_kenter_pa(va, pa, prot)
paddr_t pa;
vm_prot_t prot;
{
+ pt_entry_t pte;
+
+ pte = pte_prot(prot);
+#if defined(M68040) || defined(M68060)
+ if (mmutype <= MMU_68040 && (pte & (PG_PROT)) == PG_RW)
+ pte |= PG_CCB;
+#endif
+ pmap_kenter_cache(va, pa, pte);
+}
+
+/*
+ * Similar to pmap_kenter_pa(), but allows the caller to control the
+ * cacheability of the mapping.
+ */
+void
+pmap_kenter_cache(va, pa, template)
+ vaddr_t va;
+ paddr_t pa;
+ pt_entry_t template;
+{
struct pmap *pmap = pmap_kernel();
pt_entry_t *pte;
int s, npte, error;
PMAP_DPRINTF(PDB_FOLLOW|PDB_ENTER,
- ("pmap_kenter_pa(%lx, %lx, %x)\n", va, pa, prot));
+ ("pmap_kenter_cache(%lx, %lx, %x)\n", va, pa, prot));
/*
* Segment table entry not valid, we need a new PT page
@@ -1306,14 +1326,14 @@ pmap_kenter_pa(va, pa, prot)
s = splvm();
error = pmap_enter_ptpage(pmap, va);
if (error != 0)
- panic("pmap_kenter_pa: out of address space");
+ panic("pmap_kenter_cache: out of address space");
splx(s);
}
pa = trunc_page(pa);
pte = pmap_pte(pmap, va);
- PMAP_DPRINTF(PDB_ENTER, ("enter: pte %p, *pte %x\n", pte, *pte));
+ PMAP_DPRINTF(PDB_ENTER, ("kenter: pte %p, *pte %x\n", pte, *pte));
KASSERT(!pmap_pte_v(pte));
/*
@@ -1327,13 +1347,9 @@ pmap_kenter_pa(va, pa, prot)
* Build the new PTE.
*/
- npte = pa | pte_prot(prot) | PG_V | PG_W;
-#if defined(M68040) || defined(M68060)
- if (mmutype <= MMU_68040 && (npte & (PG_PROT)) == PG_RW)
- npte |= PG_CCB;
-#endif
+ npte = pa | template | PG_V | PG_W;
- PMAP_DPRINTF(PDB_ENTER, ("enter: new pte value %x\n", npte));
+ PMAP_DPRINTF(PDB_ENTER, ("kenter: new pte value %x\n", npte));
#if defined(M68040) || defined(M68060)
if (mmutype <= MMU_68040) {
DCFP(pa);