Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sh3 Catch up with -current.



details:   https://anonhg.NetBSD.org/src/rev/a108dcc33849
branches:  trunk
changeset: 476353:a108dcc33849
user:      tsubai <tsubai%NetBSD.org@localhost>
date:      Tue Sep 14 10:22:34 1999 +0000

description:
Catch up with -current.

diffstat:

 sys/arch/sh3/conf/files.sh3     |     9 +-
 sys/arch/sh3/dev/pcic_shb.c     |     6 +-
 sys/arch/sh3/dev/pcic_shbsubr.c |     6 +-
 sys/arch/sh3/dev/shpcic.c       |    10 +-
 sys/arch/sh3/include/cpu.h      |     3 +-
 sys/arch/sh3/include/intr.h     |     5 +-
 sys/arch/sh3/include/pcb.h      |     4 +-
 sys/arch/sh3/include/pmap.h     |   554 +++-
 sys/arch/sh3/include/pmap.new.h |   488 ----
 sys/arch/sh3/include/vmparam.h  |     9 +-
 sys/arch/sh3/sh3/autoconf.c     |     5 +-
 sys/arch/sh3/sh3/pmap.c         |  4691 ++++++++++++++++++++++++++------------
 sys/arch/sh3/sh3/pmap.new.c     |  3469 ----------------------------
 sys/arch/sh3/sh3/trap.c         |    60 +-
 sys/arch/sh3/sh3/vm_machdep.c   |    49 +-
 15 files changed, 3622 insertions(+), 5746 deletions(-)

diffs (truncated from 9939 to 300 lines):

diff -r 91cc030f80f0 -r a108dcc33849 sys/arch/sh3/conf/files.sh3
--- a/sys/arch/sh3/conf/files.sh3       Tue Sep 14 09:29:05 1999 +0000
+++ b/sys/arch/sh3/conf/files.sh3       Tue Sep 14 10:22:34 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.sh3,v 1.2 1999/09/13 16:26:19 msaitoh Exp $
+#      $NetBSD: files.sh3,v 1.3 1999/09/14 10:22:34 tsubai Exp $
 #
 # new style config file for sh3 architecture
 #
@@ -21,9 +21,8 @@
 file   arch/sh3/sh3/Locore.c
 file   arch/sh3/sh3/math_emulate.c     math_emulate
 file   arch/sh3/sh3/mem.c
-file   arch/sh3/sh3/ns_cksum.c ns
-file   arch/sh3/sh3/pmap.c             !pmap_new
-file   arch/sh3/sh3/pmap.new.c         pmap_new
+file   arch/sh3/sh3/ns_cksum.c         ns
+file   arch/sh3/sh3/pmap.c
 file   arch/sh3/sh3/process_machdep.c
 file   arch/sh3/sh3/sys_machdep.c
 file   arch/sh3/sh3/trap.c
@@ -75,4 +74,4 @@
 file arch/sh3/sh3/coff_exec.c  exec_coff
 
 # network devices MII bus
-include "../../../dev/mii/files.mii"
+include "dev/mii/files.mii"
diff -r 91cc030f80f0 -r a108dcc33849 sys/arch/sh3/dev/pcic_shb.c
--- a/sys/arch/sh3/dev/pcic_shb.c       Tue Sep 14 09:29:05 1999 +0000
+++ b/sys/arch/sh3/dev/pcic_shb.c       Tue Sep 14 10:22:34 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pcic_shb.c,v 1.1 1999/09/13 10:31:08 itojun Exp $ */
+/* $NetBSD: pcic_shb.c,v 1.2 1999/09/14 10:22:35 tsubai Exp $ */
 
 #define        PCICSHBDEBUG
 
@@ -60,8 +60,8 @@
 #include <dev/pcmcia/pcmciavar.h>
 #include <dev/pcmcia/pcmciachip.h>
 
-#include <sh3/sh3/shpcicreg.h>
-#include <sh3/sh3/shpcicvar.h>
+#include <sh3/dev/shpcicreg.h>
+#include <sh3/dev/shpcicvar.h>
 
 #ifdef TODO
 #include <dev/isa/i82365_isavar.h>
diff -r 91cc030f80f0 -r a108dcc33849 sys/arch/sh3/dev/pcic_shbsubr.c
--- a/sys/arch/sh3/dev/pcic_shbsubr.c   Tue Sep 14 09:29:05 1999 +0000
+++ b/sys/arch/sh3/dev/pcic_shbsubr.c   Tue Sep 14 10:22:34 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pcic_shbsubr.c,v 1.1 1999/09/13 10:31:12 itojun Exp $  */
+/*     $NetBSD: pcic_shbsubr.c,v 1.2 1999/09/14 10:22:35 tsubai Exp $  */
 
 #define        SHPCICSUBRDEBUG
 
@@ -55,8 +55,8 @@
 #include <dev/pcmcia/pcmciavar.h>
 #include <dev/pcmcia/pcmciachip.h>
 
-#include <sh3/sh3/shpcicreg.h>
-#include <sh3/sh3/shpcicvar.h>
+#include <sh3/dev/shpcicreg.h>
+#include <sh3/dev/shpcicvar.h>
 #if 0
 #include <dev/isa/i82365_isavar.h>
 #endif
diff -r 91cc030f80f0 -r a108dcc33849 sys/arch/sh3/dev/shpcic.c
--- a/sys/arch/sh3/dev/shpcic.c Tue Sep 14 09:29:05 1999 +0000
+++ b/sys/arch/sh3/dev/shpcic.c Tue Sep 14 10:22:34 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: shpcic.c,v 1.1 1999/09/13 10:31:13 itojun Exp $        */
+/*     $NetBSD: shpcic.c,v 1.2 1999/09/14 10:22:35 tsubai Exp $        */
 
 #define        SHPCICDEBUG
 
@@ -48,8 +48,8 @@
 #include <dev/pcmcia/pcmciareg.h>
 #include <dev/pcmcia/pcmciavar.h>
 
-#include <sh3/sh3/shpcicreg.h>
-#include <sh3/sh3/shpcicvar.h>
+#include <sh3/dev/shpcicreg.h>
+#include <sh3/dev/shpcicvar.h>
 
 #include "locators.h"
 
@@ -278,7 +278,7 @@
                panic("shpcic_create_event_thread: unknown pcic socket");
        }
 
-       if (kthread_create(shpcic_event_thread, h, &h->event_thread,
+       if (kthread_create1(shpcic_event_thread, h, &h->event_thread,
            "%s,%s", h->sc->dev.dv_xname, cs)) {
                printf("%s: unable to create event thread for sock 0x%02x\n",
                    h->sc->dev.dv_xname, h->sock);
@@ -386,7 +386,7 @@
        if (h->event_thread != NULL)
                panic("shpcic_attach_socket: event thread");
 #endif
-       kthread_create_deferred(shpcic_create_event_thread, h);
+       kthread_create(shpcic_create_event_thread, h);
 
        /* if there's a card there, then attach it. */
 
diff -r 91cc030f80f0 -r a108dcc33849 sys/arch/sh3/include/cpu.h
--- a/sys/arch/sh3/include/cpu.h        Tue Sep 14 09:29:05 1999 +0000
+++ b/sys/arch/sh3/include/cpu.h        Tue Sep 14 10:22:34 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.1 1999/09/13 10:31:16 itojun Exp $   */
+/*     $NetBSD: cpu.h,v 1.2 1999/09/14 10:22:35 tsubai Exp $   */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -60,6 +60,7 @@
  */
 #define        cpu_swapin(p)                   /* nothing */
 #define        cpu_wait(p)                     /* nothing */
+#define        cpu_number()                    0
 
 /*
  * Arguments to hardclock, softclock and statclock
diff -r 91cc030f80f0 -r a108dcc33849 sys/arch/sh3/include/intr.h
--- a/sys/arch/sh3/include/intr.h       Tue Sep 14 09:29:05 1999 +0000
+++ b/sys/arch/sh3/include/intr.h       Tue Sep 14 10:22:34 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.h,v 1.1 1999/09/13 10:31:19 itojun Exp $  */
+/*     $NetBSD: intr.h,v 1.2 1999/09/14 10:22:35 tsubai Exp $  */
 
 /*
  * Copyright (c) 1996, 1997 Charles M. Hannum.  All rights reserved.
@@ -133,7 +133,8 @@
  * NOTE: splsoftclock() is used by hardclock() to lower the priority from
  * clock to softclock before it calls softclock().
  */
-#define        splsoftclock()  spllower(imask[IPL_SOFTCLOCK])
+#define        spllowersoftclock() spllower(imask[IPL_SOFTCLOCK])
+#define        splsoftclock()  splraise(imask[IPL_SOFTCLOCK])
 #define        splsoftnet()    splraise(imask[IPL_SOFTNET])
 #define        splsoftserial() splraise(imask[IPL_SOFTSERIAL])
 
diff -r 91cc030f80f0 -r a108dcc33849 sys/arch/sh3/include/pcb.h
--- a/sys/arch/sh3/include/pcb.h        Tue Sep 14 09:29:05 1999 +0000
+++ b/sys/arch/sh3/include/pcb.h        Tue Sep 14 10:22:34 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pcb.h,v 1.1 1999/09/13 10:31:19 itojun Exp $   */
+/*     $NetBSD: pcb.h,v 1.2 1999/09/14 10:22:35 tsubai Exp $   */
 
 /*-
  * Copyright (c) 1995 Charles M. Hannum.  All rights reserved.
@@ -86,9 +86,7 @@
        int     pcb_flags;
        caddr_t pcb_onfault;    /* copyin/out fault recovery */
        int     fusubail;
-#if defined(PMAP_NEW)
        struct pmap *pcb_pmap;  /* back pointer to our pmap */
-#endif
 };
 
 /*
diff -r 91cc030f80f0 -r a108dcc33849 sys/arch/sh3/include/pmap.h
--- a/sys/arch/sh3/include/pmap.h       Tue Sep 14 09:29:05 1999 +0000
+++ b/sys/arch/sh3/include/pmap.h       Tue Sep 14 10:22:34 1999 +0000
@@ -1,14 +1,9 @@
-/*     $NetBSD: pmap.h,v 1.1 1999/09/13 10:31:20 itojun Exp $  */
+/*     $NetBSD: pmap.h,v 1.2 1999/09/14 10:22:35 tsubai Exp $  */
 
 /*
- * Copyright (c) 1995 Charles M. Hannum.  All rights reserved.
- * 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:
@@ -18,213 +13,476 @@
  *    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 <sh3/pmap.new.h>      /* defines _SH3_PMAP_H_ */
-#endif
-
-#ifndef        _SH3_PMAP_H_
-#define        _SH3_PMAP_H_
+#ifndef _SH3_PMAP_H_
+#define _SH3_PMAP_H_
 
 #include <machine/cpufunc.h>
 #include <machine/pte.h>
+#include <uvm/uvm_object.h>
 
 /*
- * SH3 page table entry and page table directory
- * T.Horiuchi 06/02/1998
+ * see pte.h for a description of i386 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 0xf0000000)
+ *
+ * PDE#s       VA range                usage
+ * 0->959      0x0 -> 0xefc00000       user address space, note that the
+ *                                     max user address is 0xefbfe000
+ *                                     the final two pages in the last 4MB
+ *                                     used to be reserved for the UAREA
+ *                                     but now are no longer used
+ * 959         0xefc00000->            recursive mapping of PDP (used for
+ *                     0xf0000000      linear mapping of PTPs)
+ * 960->1023   0xf0000000->            kernel address space (constant
+ *                     0xffc00000      across all pmap's/processes)
+ * 1023                0xffc00000->            "alternate" recursive PDP mapping
+ *                     <end>           (for other pmaps)
+ *
+ *
+ * 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 960->1023 so that
+ * the kernel 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 %cr3.  this pmap
+ * will have all its PTEs mapped into memory at the recursive mapping
+ * point (slot #959 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 = (959 * 4MB) + (VA / NBPG) * sizeof(pt_entry_t)
+ *                = 0xefc00000 + (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 1023 of the active pmap.  this causes the non-active pmap's



Home | Main Index | Thread Index | Old Index