Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/a682fdfa1c51
branches:  trunk
changeset: 749571:a682fdfa1c51
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Wed Dec 02 15:54:19 2009 +0000

description:
Use common pmap_bootstrap_finalize() to initialize lwp0 uarea etc.
Tested on NWS-1750.

diffstat:

 sys/arch/news68k/news68k/locore.s         |  14 +++++++-------
 sys/arch/news68k/news68k/pmap_bootstrap.c |  24 ++++++++++++------------
 2 files changed, 19 insertions(+), 19 deletions(-)

diffs (111 lines):

diff -r e30ba172fa20 -r a682fdfa1c51 sys/arch/news68k/news68k/locore.s
--- a/sys/arch/news68k/news68k/locore.s Wed Dec 02 15:53:34 2009 +0000
+++ b/sys/arch/news68k/news68k/locore.s Wed Dec 02 15:54:19 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.s,v 1.48 2009/11/26 00:19:19 matt Exp $ */
+/*     $NetBSD: locore.s,v 1.49 2009/12/02 15:54:19 tsutsui Exp $      */
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -445,13 +445,13 @@
 /* select the software page size now */
        lea     _ASM_LABEL(tmpstk),%sp  | temporary stack
        jbsr    _C_LABEL(uvm_setpagesize)  | select software page size
-/* set kernel stack, user SP, 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()
+/* call final pmap setup which initialize lwp0, curlwp, and curpcb */
+       jbsr    _C_LABEL(pmap_bootstrap_finalize)
+/* set kernel stack, user SP */
+       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 user SP
-       movl    %a1,_C_LABEL(curpcb)    | lwp0 is running
 
        tstl    _C_LABEL(fputype)       | Have an FPU?
        jeq     Lenab2                  | No, skip.
diff -r e30ba172fa20 -r a682fdfa1c51 sys/arch/news68k/news68k/pmap_bootstrap.c
--- a/sys/arch/news68k/news68k/pmap_bootstrap.c Wed Dec 02 15:53:34 2009 +0000
+++ b/sys/arch/news68k/news68k/pmap_bootstrap.c Wed Dec 02 15:54:19 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap_bootstrap.c,v 1.23 2009/11/26 00:19:19 matt Exp $ */
+/*     $NetBSD: pmap_bootstrap.c,v 1.24 2009/12/02 15:54:19 tsutsui Exp $      */
 
 /* 
  * Copyright (c) 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.23 2009/11/26 00:19:19 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.24 2009/12/02 15:54:19 tsutsui Exp $");
 
 #include <sys/param.h>
 
@@ -89,7 +89,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;
        st_entry_t protoste, *ste;
        pt_entry_t protopte, *pte, *epte;
@@ -110,7 +110,7 @@
         *
         *      kptmpa          kernel PT map           1 page
         *
-        *      l0upa           lwp 0 u-area            UPAGES pages
+        *      lwp0upa         lwp 0 u-area            UPAGES pages
         *
         * The KVA corresponding to any of these PAs is:
         *      (PA - firstpa + KERNBASE).
@@ -136,7 +136,7 @@
        nextpa += kstsize * PAGE_SIZE;
        kptmpa = nextpa;
        nextpa += PAGE_SIZE;
-       l0upa = nextpa;
+       lwp0upa = nextpa;
        nextpa += USPACE;
        kptpa = nextpa;
        nptpages = RELOC(Sysptsize, int) +
@@ -306,7 +306,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 = &((u_int *)kptpa)[m68k_btop(nextpa - firstpa)];
@@ -361,21 +361,21 @@
            (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 = (u_int *)l0upa;
-       epte = (u_int *)(l0upa + USPACE);
+       pte = (u_int *)lwp0upa;
+       epte = (u_int *)(lwp0upa + USPACE);
        while (pte < epte)
                *pte++ = 0;
        /*
-        * Remember the u-area address so it can be loaded in the
-        * proc struct p_addr field later.
+        * Remember the u-area address so it can be loaded in the lwp0
+        * via uvm_lwp_setuarea() later in pmap_bootstrap_finalize().
         */
-       RELOC(lwp0.l_addr, struct user *) = (struct user *)(l0upa - firstpa);
+       RELOC(lwp0uarea, vaddr_t) = lwp0upa - firstpa;
 
        /*
         * VM data structures are now initialized, set up data for



Home | Main Index | Thread Index | Old Index