Source-Changes-HG archive

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

[src/uebayasi-xip]: src/sys/arch Support PMAP_UNMANAGED in some pmaps.



details:   https://anonhg.NetBSD.org/src/rev/8b751d18200b
branches:  uebayasi-xip
changeset: 751683:8b751d18200b
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Tue Apr 27 07:19:27 2010 +0000

description:
Support PMAP_UNMANAGED in some pmaps.

(Others should be converted eventually, but no problem while managed
device page is not used.)

diffstat:

 sys/arch/acorn26/acorn26/pmap.c    |   7 ++++---
 sys/arch/arm/arm32/pmap.c          |   7 ++++---
 sys/arch/hppa/hppa/pmap.c          |   7 ++++---
 sys/arch/m68k/m68k/pmap_motorola.c |   6 +++---
 sys/arch/mips/mips/pmap.c          |   9 ++++++---
 sys/arch/powerpc/ibm4xx/pmap.c     |   6 +++---
 sys/arch/sh3/sh3/pmap.c            |   9 ++++++---
 sys/arch/sparc64/sparc64/pmap.c    |   9 ++++++---
 sys/arch/x86/x86/pmap.c            |  11 ++++++++---
 9 files changed, 44 insertions(+), 27 deletions(-)

diffs (260 lines):

diff -r 7b7986c49c1f -r 8b751d18200b sys/arch/acorn26/acorn26/pmap.c
--- a/sys/arch/acorn26/acorn26/pmap.c   Tue Apr 27 07:17:25 2010 +0000
+++ b/sys/arch/acorn26/acorn26/pmap.c   Tue Apr 27 07:19:27 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.30 2009/11/07 07:27:40 cegger Exp $ */
+/* $NetBSD: pmap.c,v 1.30.2.1 2010/04/27 07:19:27 uebayasi Exp $ */
 /*-
  * Copyright (c) 1997, 1998, 2000 Ben Harris
  * All rights reserved.
@@ -102,7 +102,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.30 2009/11/07 07:27:40 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.30.2.1 2010/04/27 07:19:27 uebayasi Exp $");
 
 #include <sys/kernel.h> /* for cold */
 #include <sys/malloc.h>
@@ -634,7 +634,8 @@
        UVMHIST_FUNC("pmap_enter");
 
        UVMHIST_CALLED(pmaphist);
-       return pmap_enter1(pmap, va, pa, prot, flags, 0);
+       return pmap_enter1(pmap, va, pa, prot, flags,
+           (flags & PMAP_UNMANAGED) != 0);
 }
 
 static int
diff -r 7b7986c49c1f -r 8b751d18200b sys/arch/arm/arm32/pmap.c
--- a/sys/arch/arm/arm32/pmap.c Tue Apr 27 07:17:25 2010 +0000
+++ b/sys/arch/arm/arm32/pmap.c Tue Apr 27 07:19:27 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.211.2.9 2010/02/25 03:30:22 uebayasi Exp $  */
+/*     $NetBSD: pmap.c,v 1.211.2.10 2010/04/27 07:19:28 uebayasi Exp $ */
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -213,7 +213,7 @@
 #include <machine/param.h>
 #include <arm/arm32/katelib.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.211.2.9 2010/02/25 03:30:22 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.211.2.10 2010/04/27 07:19:28 uebayasi Exp $");
 
 #ifdef PMAP_DEBUG
 
@@ -2781,7 +2781,8 @@
         * Get a pointer to the page.  Later on in this function, we
         * test for a managed page by checking pg != NULL.
         */
-       pg = pmap_initialized ? PHYS_TO_VM_PAGE(pa) : NULL;
+       pg = (pmap_initialized && ((flags & PMAP_UNMANAGED) == 0)) ?
+           PHYS_TO_VM_PAGE(pa) : NULL;
 
        nflags = 0;
        if (prot & VM_PROT_WRITE)
diff -r 7b7986c49c1f -r 8b751d18200b sys/arch/hppa/hppa/pmap.c
--- a/sys/arch/hppa/hppa/pmap.c Tue Apr 27 07:17:25 2010 +0000
+++ b/sys/arch/hppa/hppa/pmap.c Tue Apr 27 07:19:27 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.63.2.1 2010/02/25 04:11:29 uebayasi Exp $   */
+/*     $NetBSD: pmap.c,v 1.63.2.2 2010/04/27 07:19:28 uebayasi Exp $   */
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.63.2.1 2010/02/25 04:11:29 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.63.2.2 2010/04/27 07:19:28 uebayasi Exp $");
 
 #include "opt_device_page.h"
 #include "opt_xip.h"
@@ -1306,7 +1306,8 @@
                        ptp->wire_count++;
        }
 
-       if (pmap_initialized && (pg = PHYS_TO_VM_PAGE(pa))) {
+       if (pmap_initialized && ((flags & PMAP_UNMANAGED) == 0) &&
+           (pg = PHYS_TO_VM_PAGE(pa))) {
                struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
                mutex_enter(&md->pvh_lock);
 
diff -r 7b7986c49c1f -r 8b751d18200b sys/arch/m68k/m68k/pmap_motorola.c
--- a/sys/arch/m68k/m68k/pmap_motorola.c        Tue Apr 27 07:17:25 2010 +0000
+++ b/sys/arch/m68k/m68k/pmap_motorola.c        Tue Apr 27 07:19:27 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap_motorola.c,v 1.55 2009/12/11 18:28:35 tsutsui Exp $        */
+/*     $NetBSD: pmap_motorola.c,v 1.55.2.1 2010/04/27 07:19:28 uebayasi Exp $        */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -117,7 +117,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_motorola.c,v 1.55 2009/12/11 18:28:35 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_motorola.c,v 1.55.2.1 2010/04/27 07:19:28 uebayasi Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1270,7 +1270,7 @@
         * Note that we raise IPL while manipulating pv_table
         * since pmap_enter can be called at interrupt time.
         */
-       if (PAGE_IS_MANAGED(pa)) {
+       if (PAGE_IS_MANAGED(pa) && ((flags & PMAP_UNMANAGED) == 0)) {
                struct pv_header *pvh;
                struct pv_entry *pv, *npv;
                int s;
diff -r 7b7986c49c1f -r 8b751d18200b sys/arch/mips/mips/pmap.c
--- a/sys/arch/mips/mips/pmap.c Tue Apr 27 07:17:25 2010 +0000
+++ b/sys/arch/mips/mips/pmap.c Tue Apr 27 07:19:27 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.188.2.1 2010/02/25 04:46:28 uebayasi Exp $  */
+/*     $NetBSD: pmap.c,v 1.188.2.2 2010/04/27 07:19:28 uebayasi 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.188.2.1 2010/02/25 04:46:28 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.188.2.2 2010/04/27 07:19:28 uebayasi Exp $");
 
 /*
  *     Manages physical address maps.
@@ -1190,7 +1190,10 @@
        if (!(prot & VM_PROT_READ))
                panic("pmap_enter: prot");
 #endif
-       pg = PHYS_TO_VM_PAGE(pa);
+       if ((flags & PMAP_UNMANAGED) != 0)
+               pg = NULL;
+       else
+               pg = PHYS_TO_VM_PAGE(pa);
 
        if (pg) {
                struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
diff -r 7b7986c49c1f -r 8b751d18200b sys/arch/powerpc/ibm4xx/pmap.c
--- a/sys/arch/powerpc/ibm4xx/pmap.c    Tue Apr 27 07:17:25 2010 +0000
+++ b/sys/arch/powerpc/ibm4xx/pmap.c    Tue Apr 27 07:19:27 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.60 2009/11/21 17:40:29 rmind Exp $  */
+/*     $NetBSD: pmap.c,v 1.60.2.1 2010/04/27 07:19:29 uebayasi Exp $   */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.60 2009/11/21 17:40:29 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.60.2.1 2010/04/27 07:19:29 uebayasi Exp $");
 
 #include <sys/param.h>
 #include <sys/malloc.h>
@@ -808,7 +808,7 @@
        if (flags & PMAP_WIRED)
                flags |= prot;
 
-       managed = uvm_pageismanaged(pa);
+       managed = ((flags & PMAP_UNMANAGED) == 0) && uvm_pageismanaged(pa);
 
        /*
         * Generate TTE.
diff -r 7b7986c49c1f -r 8b751d18200b sys/arch/sh3/sh3/pmap.c
--- a/sys/arch/sh3/sh3/pmap.c   Tue Apr 27 07:17:25 2010 +0000
+++ b/sys/arch/sh3/sh3/pmap.c   Tue Apr 27 07:19:27 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.74.2.1 2010/02/25 05:05:23 uebayasi Exp $   */
+/*     $NetBSD: pmap.c,v 1.74.2.2 2010/04/27 07:19:29 uebayasi Exp $   */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.74.2.1 2010/02/25 05:05:23 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.74.2.2 2010/04/27 07:19:29 uebayasi Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -333,7 +333,10 @@
        /* "flags" never exceed "prot" */
        KDASSERT(prot != 0 && ((flags & VM_PROT_ALL) & ~prot) == 0);
 
-       pg = PHYS_TO_VM_PAGE(pa);
+       if ((flags & PMAP_UNMANAGED) != 0)
+               pg = NULL;
+       else
+               pg = PHYS_TO_VM_PAGE(pa);
        entry = (pa & PG_PPN) | PG_4K;
        if (flags & PMAP_WIRED)
                entry |= _PG_WIRED;
diff -r 7b7986c49c1f -r 8b751d18200b sys/arch/sparc64/sparc64/pmap.c
--- a/sys/arch/sparc64/sparc64/pmap.c   Tue Apr 27 07:17:25 2010 +0000
+++ b/sys/arch/sparc64/sparc64/pmap.c   Tue Apr 27 07:19:27 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.250.2.1 2010/02/25 05:54:03 uebayasi Exp $  */
+/*     $NetBSD: pmap.c,v 1.250.2.2 2010/04/27 07:19:29 uebayasi Exp $  */
 /*
  *
  * Copyright (C) 1996-1999 Eduardo Horvath.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.250.2.1 2010/02/25 05:54:03 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.250.2.2 2010/04/27 07:19:29 uebayasi Exp $");
 
 #undef NO_VCACHE /* Don't forget the locked TLB in dostart */
 #define        HWREF
@@ -1669,7 +1669,10 @@
        /*
         * Construct the TTE.
         */
-       pg = PHYS_TO_VM_PAGE(pa);
+       if ((flags & PMAP_UNMANAGED) != 0)
+               pg = NULL;
+       else
+               pg = PHYS_TO_VM_PAGE(pa);
        if (pg) {
                struct vm_page_md * const md = VM_PAGE_TO_MD(pg);
 
diff -r 7b7986c49c1f -r 8b751d18200b sys/arch/x86/x86/pmap.c
--- a/sys/arch/x86/x86/pmap.c   Tue Apr 27 07:17:25 2010 +0000
+++ b/sys/arch/x86/x86/pmap.c   Tue Apr 27 07:19:27 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.100.2.1 2010/02/25 02:57:17 uebayasi Exp $  */
+/*     $NetBSD: pmap.c,v 1.100.2.2 2010/04/27 07:19:28 uebayasi Exp $  */
 
 /*
  * Copyright (c) 2007 Manuel Bouyer.
@@ -149,7 +149,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.100.2.1 2010/02/25 02:57:17 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.100.2.2 2010/04/27 07:19:28 uebayasi Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -4063,7 +4063,12 @@
                pg = NULL;
        else
 #endif
-               pg = PHYS_TO_VM_PAGE(pa);
+       {
+               if ((flags & PMAP_UNMANAGED) != 0)
+                       pg = NULL;
+               else
+                       pg = PHYS_TO_VM_PAGE(pa);
+       }
        if (pg != NULL) {
                /* This is a managed page */
                npte |= PG_PVLIST;



Home | Main Index | Thread Index | Old Index