Module Name: src Committed By: tsutsui Date: Wed Dec 2 15:54:19 UTC 2009
Modified Files: src/sys/arch/news68k/news68k: locore.s pmap_bootstrap.c Log Message: Use common pmap_bootstrap_finalize() to initialize lwp0 uarea etc. Tested on NWS-1750. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/sys/arch/news68k/news68k/locore.s cvs rdiff -u -r1.23 -r1.24 src/sys/arch/news68k/news68k/pmap_bootstrap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/news68k/news68k/locore.s diff -u src/sys/arch/news68k/news68k/locore.s:1.48 src/sys/arch/news68k/news68k/locore.s:1.49 --- src/sys/arch/news68k/news68k/locore.s:1.48 Thu Nov 26 00:19:19 2009 +++ src/sys/arch/news68k/news68k/locore.s Wed Dec 2 15:54:19 2009 @@ -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. Index: src/sys/arch/news68k/news68k/pmap_bootstrap.c diff -u src/sys/arch/news68k/news68k/pmap_bootstrap.c:1.23 src/sys/arch/news68k/news68k/pmap_bootstrap.c:1.24 --- src/sys/arch/news68k/news68k/pmap_bootstrap.c:1.23 Thu Nov 26 00:19:19 2009 +++ src/sys/arch/news68k/news68k/pmap_bootstrap.c Wed Dec 2 15:54:19 2009 @@ -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