Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mac68k/mac68k Use common pmap_bootstrap_finalize() ...



details:   https://anonhg.NetBSD.org/src/rev/02ec5753af1c
branches:  trunk
changeset: 749618:02ec5753af1c
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Fri Dec 04 16:57:18 2009 +0000

description:
Use common pmap_bootstrap_finalize() to initialize lwp0 uarea etc.
Tested on LC630.

diffstat:

 sys/arch/mac68k/mac68k/locore.s         |  12 +++++-------
 sys/arch/mac68k/mac68k/pmap_bootstrap.c |  23 ++++++++++++-----------
 2 files changed, 17 insertions(+), 18 deletions(-)

diffs (111 lines):

diff -r 9cc24abb4397 -r 02ec5753af1c sys/arch/mac68k/mac68k/locore.s
--- a/sys/arch/mac68k/mac68k/locore.s   Fri Dec 04 16:47:33 2009 +0000
+++ b/sys/arch/mac68k/mac68k/locore.s   Fri Dec 04 16:57:18 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.s,v 1.156 2009/11/26 00:19:18 matt Exp $        */
+/*     $NetBSD: locore.s,v 1.157 2009/12/04 16:57:18 tsutsui Exp $     */
 
 /*
  * Copyright (c) 1982, 1990 The Regents of the University of California.
@@ -336,15 +336,13 @@
 /* select the software page size now */
        lea     _ASM_LABEL(tmpstk),%sp  | temporary stack
        jbsr    _C_LABEL(uvm_setpagesize)  | select software page size
-
+/* call final pmap setup which initialize lwp0, curlwp, and curpcb */
+       jbsr    _C_LABEL(pmap_bootstrap_finalize)
 /* set kernel stack, user SP, lwp0, and initial pcb */
-       lea     _C_LABEL(lwp0),%a2      | get lwp0.l_addr
-       movl    %a2@(L_ADDR),%a1        |   set kernel stack to end of area 
-       lea     %a1@(USPACE-4),%sp      |   and curlwp so that we don't
-       movl    %a2,_C_LABEL(curlwp)    |   deref NULL in trap()
+       movl    _C_LABEL(lwp0uarea),%a1 | get lwp0 uarea
+       lea     %a1@(USPACE-4),%sp      |   set kernel stack to end of area
        movl    #USRSTACK-4,%a2
        movl    %a2,%usp                | init %USP
-       movl    %a1,_C_LABEL(curpcb)    | lwp0 is running
 
 /* flush TLB and turn on caches */
        cmpl    #MMU_68040,_C_LABEL(mmutype) | 68040?
diff -r 9cc24abb4397 -r 02ec5753af1c sys/arch/mac68k/mac68k/pmap_bootstrap.c
--- a/sys/arch/mac68k/mac68k/pmap_bootstrap.c   Fri Dec 04 16:47:33 2009 +0000
+++ b/sys/arch/mac68k/mac68k/pmap_bootstrap.c   Fri Dec 04 16:57:18 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap_bootstrap.c,v 1.80 2009/11/27 03:23:10 rmind Exp $        */
+/*     $NetBSD: pmap_bootstrap.c,v 1.81 2009/12/04 16:57:18 tsutsui Exp $      */
 
 /* 
  * Copyright (c) 1991, 1993
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.80 2009/11/27 03:23:10 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.81 2009/12/04 16:57:18 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -110,7 +110,7 @@
 void
 pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
 {
-       paddr_t kstpa, kptpa, kptmpa, l0upa;
+       paddr_t kstpa, kptpa, kptmpa, lwp0upa;
        u_int nptpages, kstsize;
        paddr_t avail_next;
        int avail_remaining;
@@ -138,7 +138,7 @@
         *
         *      kptmpa          kernel PT map           1 page
         *
-        *      l0upa           lwp 0 u-area            UPAGES pages
+        *      lwp0upa         lwp 0 u-area            UPAGES pages
         *
         */
        if (mmutype == MMU_68040)
@@ -149,7 +149,7 @@
        nextpa += kstsize * PAGE_SIZE;
        kptmpa = nextpa;
        nextpa += PAGE_SIZE;
-       l0upa = nextpa;
+       lwp0upa = nextpa;
        nextpa += USPACE;
        kptpa = nextpa;
        nptpages = Sysptsize +
@@ -335,7 +335,7 @@
        }
        /*
         * Validate PTEs for kernel data/bss, dynamic data allocated
-        * by us so far (nextpa - firstpa bytes), and pages for proc0
+        * by us so far (nextpa - firstpa bytes), and pages for lwp0
         * u-area and page table allocated below (RW).
         */
        epte = &(PA2VA(kptpa, u_int *))[m68k_btop(nextpa - firstpa)];
@@ -399,21 +399,22 @@
        Sysmap = (pt_entry_t *)m68k_ptob((NPTEPG - 1) * NPTEPG);
 
        /*
-        * Setup u-area for process 0.
+        * Setup u-area for lwp 0.
         */
        /*
         * Zero the u-area.
         * NOTE: `pte' and `epte' aren't PTEs here.
         */
-       pte = PA2VA(l0upa, u_int *);
-       epte = (u_int *)(PA2VA(l0upa, u_int) + USPACE);
+       pte = PA2VA(lwp0upa, u_int *);
+       epte = (u_int *)(PA2VA(lwp0upa, u_int) + USPACE);
        while (pte < epte)
                *pte++ = 0;
 
        /*
-        * Store the u-area address
+        * Remember the u-area address so it can be loaded in the lwp0
+        * via uvm_lwp_setuarea() later in pmap_bootstrap_finalize().
         */
-       uvm_lwp_setuarea(&lwp0, PA2VA(l0upa, vaddr_t));
+       lwp0uarea = PA2VA(lwp0upa, vaddr_t);
 
        /*
         * VM data structures are now initialized, set up data for



Home | Main Index | Thread Index | Old Index