Source-Changes-HG archive

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

[src/trunk]: src/sys eliminate the PMAP_NEW option by making it required for ...



details:   https://anonhg.NetBSD.org/src/rev/5a3e50b79ad1
branches:  trunk
changeset: 476278:5a3e50b79ad1
user:      chs <chs%NetBSD.org@localhost>
date:      Sun Sep 12 01:16:55 1999 +0000

description:
eliminate the PMAP_NEW option by making it required for all ports.
ports which previously had no support for PMAP_NEW now implement
the pmap_k* interfaces as wrappers around the non-k versions.

diffstat:

 sys/arch/alpha/alpha/machdep.c              |   14 +-
 sys/arch/alpha/alpha/pmap.c                 |  162 +----------------------
 sys/arch/alpha/common/bus_dma.c             |    6 +-
 sys/arch/alpha/conf/std.alpha               |    4 +-
 sys/arch/amiga/amiga/machdep.c              |   11 +-
 sys/arch/amiga/amiga/pmap.c                 |   86 +++++++++---
 sys/arch/arm32/arm32/pmap.c                 |   84 +++++++++---
 sys/arch/atari/atari/pmap.c                 |   85 ++++++++---
 sys/arch/hp300/conf/std.hp300               |    4 +-
 sys/arch/hp300/hp300/machdep.c              |   11 +-
 sys/arch/hp300/hp300/pmap.c                 |   78 ++++++++--
 sys/arch/i386/conf/std.i386                 |    6 +-
 sys/arch/i386/i386/machdep.c                |    4 +-
 sys/arch/i386/include/pcb.h                 |    6 +-
 sys/arch/mac68k/conf/std.mac68k             |    4 +-
 sys/arch/mac68k/mac68k/pmap.c               |   81 ++++++++---
 sys/arch/macppc/conf/std.macppc             |    4 +-
 sys/arch/macppc/macppc/bus_dma.c            |    4 +-
 sys/arch/mips/mips/pmap.c                   |   95 +++++++++----
 sys/arch/mvme68k/conf/std.mvme68k           |    4 +-
 sys/arch/mvme68k/mvme68k/machdep.c          |   11 +-
 sys/arch/mvme68k/mvme68k/pmap.c             |   84 ++++++++---
 sys/arch/newsmips/newsmips/machdep.c        |   13 +-
 sys/arch/next68k/dev/bus_dma.c              |    6 +-
 sys/arch/next68k/next68k/machdep.c          |   11 +-
 sys/arch/pc532/conf/std.pc532               |    6 +-
 sys/arch/pmax/pmax/bus_dma.c                |    4 +-
 sys/arch/pmax/pmax/machdep.c                |   13 +-
 sys/arch/powerpc/include/pmap.h             |   14 +-
 sys/arch/powerpc/powerpc/pmap.c             |   60 +++++++-
 sys/arch/sparc/conf/std.sparc               |    4 +-
 sys/arch/sparc/include/pmap.h               |   52 +++++--
 sys/arch/sparc/sparc/pmap.c                 |  182 ++++++++++++++++++++------
 sys/arch/sparc64/conf/GENERIC               |    3 +-
 sys/arch/sparc64/conf/GENERIC64             |    3 +-
 sys/arch/sparc64/conf/NONPLUS               |    3 +-
 sys/arch/sparc64/conf/NONPLUS64             |    3 +-
 sys/arch/sparc64/conf/POWEROFSEVEN          |    3 +-
 sys/arch/sparc64/sparc64/pmap.c             |  192 +---------------------------
 sys/arch/sun3/conf/std.sun3                 |    5 +-
 sys/arch/sun3/conf/std.sun3x                |    5 +-
 sys/arch/sun3/sun3/machdep.c                |   11 +-
 sys/arch/sun3/sun3/pmap.c                   |  101 ++++++++++----
 sys/arch/sun3/sun3x/machdep.c               |   11 +-
 sys/arch/sun3/sun3x/pmap.c                  |   95 ++++++++----
 sys/arch/vax/conf/std.vax                   |    4 +-
 sys/arch/vax/vax/pmap.c                     |    4 +-
 sys/arch/x68k/x68k/machdep.c                |   11 +-
 sys/arch/x68k/x68k/pmap.c                   |  127 +-----------------
 sys/arch/x68k/x68k/vm_machdep.c             |    9 +-
 sys/compat/linux/arch/alpha/linux_machdep.c |    4 +-
 sys/conf/files                              |    3 +-
 sys/lkm/Makefile.inc                        |    9 +-
 sys/uvm/uvm_amap.c                          |   10 +-
 sys/uvm/uvm_amap_i.h                        |    5 +-
 sys/uvm/uvm_anon.c                          |    4 +-
 sys/uvm/uvm_aobj.c                          |   14 +-
 sys/uvm/uvm_fault.c                         |   20 +-
 sys/uvm/uvm_km.c                            |    8 +-
 sys/uvm/uvm_loan.c                          |   12 +-
 sys/uvm/uvm_map.c                           |   15 +-
 sys/uvm/uvm_page.c                          |   12 +-
 sys/uvm/uvm_page_i.h                        |    6 +-
 sys/uvm/uvm_pager.c                         |   19 +-
 sys/uvm/uvm_pdaemon.c                       |   19 +-
 sys/uvm/uvm_vnode.c                         |   27 +--
 sys/vm/pmap.h                               |   46 +------
 67 files changed, 943 insertions(+), 1093 deletions(-)

diffs (truncated from 4753 to 300 lines):

diff -r 269592fa0338 -r 5a3e50b79ad1 sys/arch/alpha/alpha/machdep.c
--- a/sys/arch/alpha/alpha/machdep.c    Sun Sep 12 00:31:34 1999 +0000
+++ b/sys/arch/alpha/alpha/machdep.c    Sun Sep 12 01:16:55 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.181 1999/08/19 21:31:43 mjacob Exp $ */
+/* $NetBSD: machdep.c,v 1.182 1999/09/12 01:16:55 chs Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -66,7 +66,6 @@
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
-#include "opt_pmap_new.h"
 #include "opt_dec_3000_300.h"
 #include "opt_dec_3000_500.h"
 #include "opt_compat_osf1.h"
@@ -80,7 +79,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.181 1999/08/19 21:31:43 mjacob Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.182 1999/09/12 01:16:55 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -943,13 +942,8 @@
                        if (pg == NULL)
                                panic("cpu_startup: not enough memory for "
                                    "buffer cache");
-#if defined(PMAP_NEW)
-                       pmap_kenter_pgs(curbuf, &pg, 1);
-#else
-                       pmap_enter(kernel_map->pmap, curbuf,
-                           VM_PAGE_TO_PHYS(pg), VM_PROT_READ|VM_PROT_WRITE,
-                           TRUE, VM_PROT_READ|VM_PROT_WRITE);
-#endif
+                       pmap_kenter_pa(curbuf, VM_PAGE_TO_PHYS(pg),
+                                       VM_PROT_READ|VM_PROT_WRITE);
                        curbuf += PAGE_SIZE;
                        curbufsize -= PAGE_SIZE;
                }
diff -r 269592fa0338 -r 5a3e50b79ad1 sys/arch/alpha/alpha/pmap.c
--- a/sys/arch/alpha/alpha/pmap.c       Sun Sep 12 00:31:34 1999 +0000
+++ b/sys/arch/alpha/alpha/pmap.c       Sun Sep 12 01:16:55 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.110 1999/08/17 18:48:22 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.111 1999/09/12 01:16:56 chs Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -148,14 +148,13 @@
  */
 
 #include "opt_lockdebug.h"
-#include "opt_pmap_new.h"
 #include "opt_new_scc_driver.h"
 #include "opt_sysv.h"
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.110 1999/08/17 18:48:22 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.111 1999/09/12 01:16:56 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1102,34 +1101,16 @@
  *
  *     Note: no locking is necessary in this function.
  */
-#if defined(PMAP_NEW)
 pmap_t
 pmap_create()
-#else /* ! PMAP_NEW */
-pmap_t
-pmap_create(size)
-       vsize_t         size;
-#endif /* PMAP_NEW */
 {
        pmap_t pmap;
        int i;
 
-#if defined(PMAP_NEW)
 #ifdef DEBUG
        if (pmapdebug & (PDB_FOLLOW|PDB_CREATE))
                printf("pmap_create()\n");
 #endif
-#else /* ! PMAP_NEW */
-#ifdef DEBUG
-       if (pmapdebug & (PDB_FOLLOW|PDB_CREATE))
-               printf("pmap_create(%lx)\n", size);
-#endif
-       /*
-        * Software use map does not need a pmap
-        */
-       if (size)
-               return(NULL);
-#endif /* PMAP_NEW */
 
        pmap = pool_get(&pmap_pmap_pool, PR_WAITOK);
        bzero(pmap, sizeof(*pmap));
@@ -1358,24 +1339,16 @@
  *     Lower the permission for all mappings to a given page to
  *     the permissions specified.
  */
-#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)
-       paddr_t         pa;
-       vm_prot_t       prot;
-#endif /* PMAP_NEW */
 {
        struct pv_head *pvh;
        pv_entry_t pv, nextpv;
        int s, ps;
        boolean_t needisync = FALSE;
        long cpu_id = alpha_pal_whami();
-#if defined(PMAP_NEW)
        paddr_t pa = VM_PAGE_TO_PHYS(pg);
 
 #ifdef DEBUG
@@ -1384,17 +1357,6 @@
                printf("pmap_page_protect(%p, %x)\n", pg, prot);
 #endif
 
-#else /* ! PMAP_NEW */
-
-#ifdef DEBUG
-       if ((pmapdebug & (PDB_FOLLOW|PDB_PROTECT)) ||
-           (prot == VM_PROT_NONE && (pmapdebug & PDB_REMOVE)))
-               printf("pmap_page_protect(%lx, %x)\n", pa, prot);
-#endif
-       if (!PAGE_IS_MANAGED(pa))
-               return;
-#endif /* PMAP_NEW */
-
        /*
         * Even though we don't change the mapping of the page,
         * we still flush the I-cache if VM_PROT_EXECUTE is set
@@ -1426,7 +1388,7 @@
        pvh = pa_to_pvh(pa);
        PMAP_HEAD_TO_MAP_LOCK();
        simple_lock(&pvh->pvh_slock);
-       s = splimp();                   /* XXX needed w/ PMAP_NEW? */
+       s = splimp();                   /* XXX needed? */
        for (pv = LIST_FIRST(&pvh->pvh_list); pv != NULL; pv = nextpv) {
                struct pmap *pmap = pv->pv_pmap;
 
@@ -1755,7 +1717,7 @@
         * Enter the mapping into the pv_table if appropriate.
         */
        if (managed) {
-               int s = splimp();       /* XXX needed w/ PMAP_NEW? */
+               int s = splimp();       /* XXX needed? */
                pmap_pv_enter(pmap, pa, va, pte, TRUE);
                splx(s);
        }
@@ -1837,7 +1799,6 @@
        PMAP_MAP_TO_HEAD_UNLOCK();
 }
 
-#if defined(PMAP_NEW)
 /*
  * pmap_kenter_pa:             [ INTERFACE ]
  *
@@ -2007,7 +1968,6 @@
 #endif
        }
 }
-#endif /* PMAP_NEW */
 
 /*
  * pmap_unwire:                        [ INTERFACE ]
@@ -2312,7 +2272,6 @@
  *
  *     Clear the modify bits on the specified physical page.
  */
-#if defined(PMAP_NEW)
 boolean_t
 pmap_clear_modify(pg)
        struct vm_page *pg;
@@ -2343,42 +2302,12 @@
 
        return (rv);
 }
-#else /* ! PMAP_NEW */
-void
-pmap_clear_modify(pa)
-       paddr_t pa;
-{
-       struct pv_head *pvh;
-       long cpu_id = alpha_pal_whami();
-
-#ifdef DEBUG
-       if (pmapdebug & PDB_FOLLOW)
-               printf("pmap_clear_modify(%lx)\n", pa);
-#endif
-       if (!PAGE_IS_MANAGED(pa))               /* XXX why not panic? */
-               return;
-
-       pvh = pa_to_pvh(pa);
-
-       PMAP_HEAD_TO_MAP_LOCK();
-       simple_lock(&pvh->pvh_slock);
-
-       if (pvh->pvh_attrs & PGA_MODIFIED) {
-               pmap_changebut(pa, PG_FOW, ~0);
-               pvh->pvh_attrs &= ~PGA_MODIFIED;
-       }
-
-       simple_unlock(&pvh->pvh_slock);
-       PMAP_HEAD_TO_MAP_UNLOCK();
-}
-#endif /* PMAP_NEW */
 
 /*
  * pmap_clear_reference:       [ INTERFACE ]
  *
  *     Clear the reference bit on the specified physical page.
  */
-#if defined(PMAP_NEW)
 boolean_t
 pmap_clear_reference(pg)
        struct vm_page *pg;
@@ -2409,35 +2338,6 @@
 
        return (rv);
 }
-#else /* ! PMAP_NEW */
-void
-pmap_clear_reference(pa)
-       paddr_t pa;
-{
-       struct pv_head *pvh;
-       long cpu_id = alpha_pal_whami();
-
-#ifdef DEBUG
-       if (pmapdebug & PDB_FOLLOW)
-               printf("pmap_clear_reference(%lx)\n", pa);
-#endif
-       if (!PAGE_IS_MANAGED(pa))               /* XXX why not panic? */
-               return;
-
-       pvh = pa_to_pvh(pa);
-
-       PMAP_HEAD_TO_MAP_LOCK();
-       simple_lock(&pvh->pvh_slock);
-
-       if (pvh->pvh_attrs & PGA_REFERENCED) {
-               pmap_changebit(pa, PG_FOR | PG_FOW | PG_FOE, ~0, cpu_id);
-               pvh->pvh_attrs &= ~PGA_REFERENCED;
-       }
-
-       simple_unlock(&pvh->pvh_slock);
-       PMAP_HEAD_TO_MAP_UNLOCK();
-}
-#endif /* PMAP_NEW */
 
 /*
  * pmap_is_referenced:         [ INTERFACE ]
@@ -2445,7 +2345,6 @@
  *     Return whether or not the specified physical page is referenced
  *     by any physical maps.
  */
-#if defined(PMAP_NEW)
 boolean_t
 pmap_is_referenced(pg)
        struct vm_page *pg;
@@ -2465,29 +2364,6 @@
 #endif
        return (rv);
 }
-#else /* ! PMAP_NEW */
-boolean_t
-pmap_is_referenced(pa)
-       paddr_t pa;
-{
-       struct pv_head *pvh;
-       boolean_t rv;
-
-       if (!PAGE_IS_MANAGED(pa))               /* XXX why not panic? */
-               return 0;
-
-       pvh = pa_to_pvh(pa);
-       simple_lock(&pvh->pvh_slock);
-       rv = ((pvh->pvh_attrs & PGA_REFERENCED) != 0);
-       simple_unlock(&pvh->pvh_slock);
-#ifdef DEBUG
-       if (pmapdebug & PDB_FOLLOW) {
-               printf("pmap_is_referenced(%lx) -> %c\n", pa, "FT"[rv]);
-       }
-#endif
-       return rv;
-}



Home | Main Index | Thread Index | Old Index