Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/mips/mips make the code that deals with mapping reg...



details:   https://anonhg.NetBSD.org/src/rev/fbd38a1a3bea
branches:  trunk
changeset: 769750:fbd38a1a3bea
user:      macallan <macallan%NetBSD.org@localhost>
date:      Wed Sep 21 16:37:54 2011 +0000

description:
make the code that deals with mapping regular memory non-cached work again:
- honour PMAP_NOCACHE
- move the PGC_NOCACHE stuff out of #ifdef PARANOIADIAG
we need this to mmap DMA buffers non-cached on sgimips

diffstat:

 sys/arch/mips/mips/pmap.c |  19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)

diffs (75 lines):

diff -r 8fbb4a00066d -r fbd38a1a3bea sys/arch/mips/mips/pmap.c
--- a/sys/arch/mips/mips/pmap.c Wed Sep 21 16:13:51 2011 +0000
+++ b/sys/arch/mips/mips/pmap.c Wed Sep 21 16:37:54 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.202 2011/06/12 01:28:29 tsutsui Exp $       */
+/*     $NetBSD: pmap.c,v 1.203 2011/09/21 16:37:54 macallan Exp $      */
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.202 2011/06/12 01:28:29 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.203 2011/09/21 16:37:54 macallan Exp $");
 
 /*
  *     Manages physical address maps.
@@ -1372,9 +1372,7 @@
        pt_entry_t *pte;
        u_int npte;
        struct vm_page *pg;
-#if defined(_MIPS_PADDR_T_64BIT) || defined(_LP64)
        bool cached = true;
-#endif
        bool wired = (flags & PMAP_WIRED) != 0;
 
 #ifdef DEBUG
@@ -1405,6 +1403,11 @@
        if (pa & 0x80000000)    /* this is not error in general. */
                panic("pmap_enter: pa");
 #endif
+
+       if (!(prot & VM_PROT_READ))
+               panic("pmap_enter: prot");
+#endif
+
        if (flags & PMAP_NOCACHE)
                cached = 0;
 
@@ -1414,10 +1417,6 @@
                pa &= ~PGC_NOCACHE;
        }
 #endif
-
-       if (!(prot & VM_PROT_READ))
-               panic("pmap_enter: prot");
-#endif
        pg = PHYS_TO_VM_PAGE(pa);
 
        if (pg) {
@@ -1438,7 +1437,6 @@
                         */
                        npte = mips_pg_ropage_bit();
                else {
-#if defined(_MIPS_PADDR_T_64BIT) || defined(_LP64)
                        if (cached == false) {
                                if (PG_MD_MODIFIED_P(md)) {
                                        npte = mips_pg_rwncpage_bit();
@@ -1447,15 +1445,12 @@
                                }
                                PMAP_COUNT(uncached_mappings);
                        } else {
-#endif
                                if (PG_MD_MODIFIED_P(md)) {
                                        npte = mips_pg_rwpage_bit();
                                } else {
                                        npte = mips_pg_cwpage_bit();
                                }
-#if defined(_MIPS_PADDR_T_64BIT) || defined(_LP64)
                        }
-#endif
                }
                PMAP_COUNT(managed_mappings);
        } else {



Home | Main Index | Thread Index | Old Index