Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x68k/x68k Fix uvm fault at startup on 040/060. (pat...



details:   https://anonhg.NetBSD.org/src/rev/9248811ae90b
branches:  trunk
changeset: 520980:9248811ae90b
user:      nsmrtks <nsmrtks%NetBSD.org@localhost>
date:      Mon Jan 21 17:21:52 2002 +0000

description:
Fix uvm fault at startup on 040/060. (patch by minoura)

diffstat:

 sys/arch/x68k/x68k/pmap_bootstrap.c |  25 ++++++++++---------------
 1 files changed, 10 insertions(+), 15 deletions(-)

diffs (76 lines):

diff -r 65225098c234 -r 9248811ae90b sys/arch/x68k/x68k/pmap_bootstrap.c
--- a/sys/arch/x68k/x68k/pmap_bootstrap.c       Mon Jan 21 17:20:05 2002 +0000
+++ b/sys/arch/x68k/x68k/pmap_bootstrap.c       Mon Jan 21 17:21:52 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap_bootstrap.c,v 1.21 2001/01/11 13:18:37 minoura Exp $      */
+/*     $NetBSD: pmap_bootstrap.c,v 1.22 2002/01/21 17:21:52 nsmrtks Exp $      */
 
 /* 
  * Copyright (c) 1991, 1993
@@ -42,7 +42,7 @@
 #include "opt_m680x0.h"
 
 #include <sys/param.h>
-#include <uvm/uvm_extern.h>    /* XXX needed? */
+#include <uvm/uvm_extern.h>
 #include <machine/pte.h>
 #include <machine/vmparam.h>
 #include <machine/cpu.h>
@@ -111,9 +111,6 @@
         *      iiopa           internal IO space
         *                      PT pages                IIOMAPSIZE pages
         *
-        *      eiiopa          page following
-        *                      internal IO space
-        *
         * [ Sysptsize is the number of pages of PT, and IIOMAPSIZE
         *   is the number of PTEs, hence we need to round
         *   the total to a page boundary with IO maps at the end. ]
@@ -143,6 +140,12 @@
        nextpa += USPACE;
 
        /*
+        * Clear all PTEs to zero
+        */
+       for (pte = (pt_entry_t *)kstpa; pte < (pt_entry_t *)p0upa; pte++)
+               *pte = 0;
+
+       /*
         * Initialize segment table and kernel page table map.
         *
         * On 68030s and earlier MMUs the two are identical except for
@@ -202,13 +205,6 @@
                        protoste += (SG4_LEV2SIZE * sizeof(st_entry_t));
                }
                /*
-                * Initialize the final level 1 descriptor to map the last
-                * block of level 2 descriptors.
-                */
-               ste = &((u_int *)kstpa)[SG4_LEV1SIZE-1];
-               pte = &((u_int *)kstpa)[kstsize*NPTEPG - SG4_LEV2SIZE];
-               *ste = (u_int)pte | SG_U | SG_RW | SG_V;
-               /*
                 * Initialize Sysptmap
                 */
                pte = (u_int *)kptmpa;
@@ -274,10 +270,10 @@
        }
        /*
         * Validate PTEs for kernel data/bss, dynamic data allocated
-        * by us so far (nextpa - firstpa bytes), and pages for proc0
+        * by us so far (kstpa - firstpa bytes), and pages for proc0
         * u-area and page table allocated below (RW).
         */
-       epte = &((u_int *)kptpa)[m68k_btop(nextpa - firstpa)];
+       epte = &((u_int *)kptpa)[m68k_btop(kstpa - firstpa)];
        protopte = (protopte & ~PG_PROT) | PG_RW;
        /*
         * Enable copy-back caching of data pages
@@ -422,7 +418,6 @@
                                      SG4_LEV2SIZE) / SG4_LEV2SIZE;
                        while (num)
                                kpm->pm_stfree &= ~l2tobm(num--);
-                       kpm->pm_stfree &= ~l2tobm(MAXKL2SIZE-1);
                        for (num = MAXKL2SIZE;
                             num < sizeof(kpm->pm_stfree)*NBBY;
                             num++)



Home | Main Index | Thread Index | Old Index