Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/pc532 PMAP_NEW is no longer optional on the pc532; ...



details:   https://anonhg.NetBSD.org/src/rev/f40700d46aa0
branches:  trunk
changeset: 473728:f40700d46aa0
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Jun 17 00:22:41 1999 +0000

description:
PMAP_NEW is no longer optional on the pc532; the old pmap's page table
allocation strategy no longer works at all.  Move pmap.new.* to pmap.*.

To read the revision history of PMAP_NEW up until this merge, use cvs
rlog of the old pmap.new.* files.

diffstat:

 sys/arch/pc532/conf/files.pc532   |     5 +-
 sys/arch/pc532/conf/std.pc532     |     5 +-
 sys/arch/pc532/include/Makefile   |     4 +-
 sys/arch/pc532/include/pcb.h      |     8 +-
 sys/arch/pc532/include/pmap.h     |   600 +++-
 sys/arch/pc532/include/pmap.new.h |   497 ---
 sys/arch/pc532/include/vmparam.h  |    13 +-
 sys/arch/pc532/pc532/genassym.cf  |     9 +-
 sys/arch/pc532/pc532/locore.s     |    23 +-
 sys/arch/pc532/pc532/machdep.c    |    34 +-
 sys/arch/pc532/pc532/mem.c        |     4 +-
 sys/arch/pc532/pc532/pmap.c       |  4934 ++++++++++++++++++++++++------------
 sys/arch/pc532/pc532/pmap.new.c   |  3494 --------------------------
 sys/arch/pc532/pc532/trap.c       |    30 +-
 sys/arch/pc532/pc532/vm_machdep.c |    34 +-
 15 files changed, 3728 insertions(+), 5966 deletions(-)

diffs (truncated from 10242 to 300 lines):

diff -r 6330afeec524 -r f40700d46aa0 sys/arch/pc532/conf/files.pc532
--- a/sys/arch/pc532/conf/files.pc532   Thu Jun 17 00:12:40 1999 +0000
+++ b/sys/arch/pc532/conf/files.pc532   Thu Jun 17 00:22:41 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.pc532,v 1.39 1999/06/07 20:31:33 thorpej Exp $
+#      $NetBSD: files.pc532,v 1.40 1999/06/17 00:22:41 thorpej Exp $
 #
 # new style config file for pc532 architecture
 #
@@ -62,8 +62,7 @@
 file   arch/pc532/pc532/intr.c
 file   arch/pc532/pc532/machdep.c
 file   arch/pc532/pc532/mem.c
-file   arch/pc532/pc532/pmap.c         !pmap_new
-file   arch/pc532/pc532/pmap.new.c     pmap_new
+file   arch/pc532/pc532/pmap.c
 file   arch/pc532/pc532/process_machdep.c
 file   arch/pc532/pc532/sys_machdep.c
 file   arch/pc532/pc532/trap.c
diff -r 6330afeec524 -r f40700d46aa0 sys/arch/pc532/conf/std.pc532
--- a/sys/arch/pc532/conf/std.pc532     Thu Jun 17 00:12:40 1999 +0000
+++ b/sys/arch/pc532/conf/std.pc532     Thu Jun 17 00:22:41 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: std.pc532,v 1.8 1999/03/24 06:06:11 mrg Exp $
+#      $NetBSD: std.pc532,v 1.9 1999/06/17 00:22:41 thorpej Exp $
 #
 # Standard configuration info for NetBSD/pc532.
 
@@ -27,7 +27,8 @@
 scn6           at mainbus? flags 0x0 # addr 0x28000030
 scn7           at mainbus? flags 0x0 # addr 0x28000038
 
-# UVM is the standard VM system on NetBSD/i386.
+# NOTE: PMAP_NEW is no longer optional on the pc532 -- the old pmap
+# no longer works, and has been deleted from the source tree.
 options        PMAP_NEW        # UVM's new pmap interface
 
 options        EXEC_AOUT       # #! scripts
diff -r 6330afeec524 -r f40700d46aa0 sys/arch/pc532/include/Makefile
--- a/sys/arch/pc532/include/Makefile   Thu Jun 17 00:12:40 1999 +0000
+++ b/sys/arch/pc532/include/Makefile   Thu Jun 17 00:22:41 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.2 1999/01/16 02:31:54 bouyer Exp $
+#      $NetBSD: Makefile,v 1.3 1999/06/17 00:22:41 thorpej Exp $
 
 KDIR=  /sys/arch/pc532/include
 INCSDIR= /usr/include/pc532
@@ -6,7 +6,7 @@
 INCS=  ansi.h aout_machdep.h asm.h autoconf.h bswap.h byte_swap.h cdefs.h \
        conf.h cpu.h cpufunc.h db_machdep.h disklabel.h endian.h float.h \
        fpu.h frame.h icu.h ieeefp.h jmpbuf.h kcore.h limits.h mtpr.h param.h \
-       pcb.h pmap.h pmap.new.h proc.h profile.h psl.h pte.h ptrace.h reg.h \
+       pcb.h pmap.h proc.h profile.h psl.h pte.h ptrace.h reg.h \
        setjmp.h signal.h stdarg.h trap.h types.h varargs.h vmparam.h
 
 .include <bsd.kinc.mk>
diff -r 6330afeec524 -r f40700d46aa0 sys/arch/pc532/include/pcb.h
--- a/sys/arch/pc532/include/pcb.h      Thu Jun 17 00:12:40 1999 +0000
+++ b/sys/arch/pc532/include/pcb.h      Thu Jun 17 00:22:41 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pcb.h,v 1.9 1998/03/18 21:59:39 matthias Exp $ */
+/*     $NetBSD: pcb.h,v 1.10 1999/06/17 00:22:41 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -41,10 +41,6 @@
 #ifndef _MACHINE_PCB_H_
 #define _MACHINE_PCB_H_
 
-#if defined(_KERNEL) && !defined(_LKM)
-#include "opt_pmap_new.h"
-#endif
-
 /*
  * PC 532 process control block
  *
@@ -70,9 +66,7 @@
  * Software pcb (extension)
  */
        caddr_t pcb_onfault;    /* copyin/out fault recovery */
-#if defined(PMAP_NEW)
        struct pmap *pcb_pmap;          /* back pointer to our pmap */
-#endif
 };
 
 /*    
diff -r 6330afeec524 -r f40700d46aa0 sys/arch/pc532/include/pmap.h
--- a/sys/arch/pc532/include/pmap.h     Thu Jun 17 00:12:40 1999 +0000
+++ b/sys/arch/pc532/include/pmap.h     Thu Jun 17 00:22:41 1999 +0000
@@ -1,49 +1,10 @@
-/*     $NetBSD: pmap.h,v 1.23 1999/03/01 14:27:59 matthias Exp $       */
-
-/*-
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Charles M. Hannum.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*     $NetBSD: pmap.h,v 1.24 1999/06/17 00:22:41 thorpej Exp $        */
 
 /*
- * Copyright (c) 1991 Regents of the University of California.
+ *
+ * Copyright (c) 1997 Charles D. Cranor and Washington University.
  * All rights reserved.
  *
- * This code is derived from software contributed to Berkeley by
- * the Systems Programming Group of the University of Utah Computer
- * Science Department and William Jolitz of UUNET Technologies Inc.
- *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
@@ -53,211 +14,484 @@
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
  * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
+ *    must display the following acknowledgment:
+ *      This product includes software developed by Charles D. Cranor and
+ *      Washington University.
+ * 4. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
  *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *     @(#)pmap.h      7.4 (Berkeley) 5/12/91
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 /*
- * Derived from hp300 version by Mike Hibler, this version by William
- * Jolitz uses a recursive map [a pde points to the page directory] to
- * map the page tables using the pagetables themselves. This is done to
- * reduce the impact on kernel virtual memory for lots of sparse address
- * space, and to reduce the cost of memory to each process.
- *
- * from hp300: @(#)pmap.h      7.2 (Berkeley) 12/16/90
+ * pmap.h: see pmap.c for the history of this pmap module.
  */
 
-#if defined(_KERNEL) && !defined(_LKM)
-#include "opt_pmap_new.h"
-#endif
-
-#ifdef PMAP_NEW                        /* redirect */
-#include <machine/pmap.new.h>  /* defines _NS532_PMAP_H_ */
-#endif
-
 #ifndef        _NS532_PMAP_H_
 #define        _NS532_PMAP_H_
 
 #include <machine/cpufunc.h>
 #include <machine/pte.h>
+#include <uvm/uvm_object.h>
 
 /*
- * 386 page table entry and page table directory
- * W.Jolitz, 8/89
+ * See pte.h for a description of ns32k MMU terminology and hardware
+ * interface.
+ *
+ * A pmap describes a processes' 4GB virtual address space. This
+ * virtual address space can be broken up into 1024 4MB regions which
+ * are described by PDEs in the PDP. The PDEs are defined as follows:
+ *
+ * (ranges are inclusive -> exclusive, just like vm_map_entry start/end)
+ * (the following assumes that KERNBASE is 0xf8000000)
+ *
+ * PDE#s       VA range                usage
+ * 0->991      0x0 -> 0xf7c00000       user address space
+ * 991         0xf7c00000->            recursive mapping of PDP (used for
+ *                     0xf8000000      linear mapping of PTPs)
+ * 992->1022   0xf8000000->            kernel address space (constant
+ *                     0xff800000      across all pmap's/processes)
+ * 1022                0xff800000->            "alternate" recursive PDP mapping
+ *                     0xffc00000      (for other pmaps)
+ * 1023                0xffc00000->            memory mapped i/o
+ *                     <end>
+ *
+ *
+ * Note: A recursive PDP mapping provides a way to map all the PTEs for
+ * a 4GB address space into a linear chunk of virtual memory. In other
+ * words, the PTE for page 0 is the first int mapped into the 4MB recursive 
+ * area. The PTE for page 1 is the second int. The very last int in the
+ * 4MB range is the PTE that maps VA 0xffffe000 (the last page in a 4GB
+ * address).
+ *
+ * All pmap's PD's must have the same values in slots 991->1023 so that
+ * the kernel and the i/o is always mapped in every process. These values
+ * are loaded into the PD at pmap creation time.
+ *
+ * At any one time only one pmap can be active on a processor. This is
+ * the pmap whose PDP is pointed to by processor register ptb0. This pmap
+ * will have all its PTEs mapped into memory at the recursive mapping
+ * point (slot #991 as show above). When the pmap code wants to find the
+ * PTE for a virtual address, all it has to do is the following:
+ *
+ * address of PTE = (991 * 4MB) + (VA / NBPG) * sizeof(pt_entry_t)
+ *                = 0xf7c00000 + (VA / 4096) * 4
+ *
+ * What happens if the pmap layer is asked to perform an operation
+ * on a pmap that is not the one which is currently active? In that
+ * case we take the PA of the PDP of non-active pmap and put it in 
+ * slot 1022 of the active pmap. This causes the non-active pmap's 
+ * PTEs to get mapped in the 4MB just before the last 4MB of the
+ * 4GB address space (e.g. starting at 0xff800000).
+ *
+ * The following figure shows the effects of the recursive PDP mapping:
+ *
+ *   PDP (ptb0)
+ *   +----+
+ *   |   0| -> PTP#0 that maps VA 0x0 -> 0x400000
+ *   |    |
+ *   |    |
+ *   | 991| -> points back to PDP (ptb0) mapping VA 0xf7c00000 -> 0xf8000000
+ *   | 992| -> first kernel PTP (maps 0xf8000000 -> 0xf8400000)
+ *   |    |
+ *   |1022| -> points to alternate pmap's PDP (maps 0xff800000 -> 0xffc00000)
+ *   +----+
+ *
+ * Note that the PDE#991 VA (0xf7c00000) is defined as "PTE_BASE"
+ * Note that the PDE#1022 VA (0xff800000) is defined as "APTE_BASE"
+ *
+ * starting at VA 0xf7c00000 the current active PDP (ptb0) acts as a
+ * PTP:
+ *
+ * PTP#991 == PDP(ptb0) => maps VA 0xf7c00000 -> 0xf8000000
+ *   +----+
+ *   |   0| -> maps the contents of PTP#0 at VA 0xf7c00000->0xf7c01000
+ *   |    |
+ *   |    |
+ *   | 991| -> maps contents of PTP#991 (the PDP) at VA 0xf7fdf000
+ *   | 992| -> maps contents of first kernel PTP 
+ *   |    |
+ *   |1023|
+ *   +----+
+ *
+ * Note that mapping of the PDP at PTP#991's VA (0xf7fdf000) is 
+ * defined as "PDP_BASE".... within that mapping there are two
+ * defines: 
+ *   "PDP_PDE" (0xf7fdff7c) is the VA of the PDE in the PDP
+ *      which points back to itself.     
+ *   "APDP_PDE" (0xf7fdfff8) is the VA of the PDE in the PDP which
+ *      establishes the recursive mapping of the alternate pmap.
+ *      To set the alternate PDP, one just has to put the correct
+ *     PA info in *APDP_PDE.



Home | Main Index | Thread Index | Old Index