Module Name: src Committed By: tsutsui Date: Wed Dec 2 15:51:13 UTC 2009
Modified Files: src/sys/arch/hp300/hp300: locore.s pmap_bootstrap.c Log Message: Use common pmap_bootstrap_finalize() to initialize lwp0 uarea etc. Tested on HP9000/382. To generate a diff of this commit: cvs rdiff -u -r1.147 -r1.148 src/sys/arch/hp300/hp300/locore.s cvs rdiff -u -r1.39 -r1.40 src/sys/arch/hp300/hp300/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/hp300/hp300/locore.s diff -u src/sys/arch/hp300/hp300/locore.s:1.147 src/sys/arch/hp300/hp300/locore.s:1.148 --- src/sys/arch/hp300/hp300/locore.s:1.147 Thu Nov 26 00:19:17 2009 +++ src/sys/arch/hp300/hp300/locore.s Wed Dec 2 15:51:12 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.147 2009/11/26 00:19:17 matt Exp $ */ +/* $NetBSD: locore.s,v 1.148 2009/12/02 15:51:12 tsutsui Exp $ */ /* * Copyright (c) 1980, 1990, 1993 @@ -552,14 +552,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 | grab 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 | + 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/hp300/hp300/pmap_bootstrap.c diff -u src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.39 src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.40 --- src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.39 Fri Nov 27 03:23:09 2009 +++ src/sys/arch/hp300/hp300/pmap_bootstrap.c Wed Dec 2 15:51:12 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap_bootstrap.c,v 1.39 2009/11/27 03:23:09 rmind Exp $ */ +/* $NetBSD: pmap_bootstrap.c,v 1.40 2009/12/02 15:51:12 tsutsui Exp $ */ /* * Copyright (c) 1991, 1993 @@ -36,10 +36,9 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.39 2009/11/27 03:23:09 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.40 2009/12/02 15:51:12 tsutsui Exp $"); #include <sys/param.h> -#include <sys/proc.h> #include <machine/frame.h> #include <machine/cpu.h> @@ -94,7 +93,7 @@ void pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) { - paddr_t kstpa, kptpa, kptmpa, lkptpa, p0upa; + paddr_t kstpa, kptpa, kptmpa, lkptpa, lwp0upa; u_int nptpages, kstsize; st_entry_t protoste, *ste; pt_entry_t protopte, *pte, *epte; @@ -116,7 +115,7 @@ * * lkptpa last kernel PT page 1 page * - * p0upa proc 0 u-area UPAGES pages + * lwp0upa lwp 0 u-area UPAGES pages * * The KVA corresponding to any of these PAs is: * (PA - firstpa + KERNBASE). @@ -131,7 +130,7 @@ nextpa += PAGE_SIZE; lkptpa = nextpa; nextpa += PAGE_SIZE; - p0upa = nextpa; + lwp0upa = nextpa; nextpa += USPACE; kptpa = nextpa; nptpages = RELOC(Sysptsize, int) + @@ -330,7 +329,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)]; @@ -395,21 +394,21 @@ (vaddr_t)RELOC(intiobase, char *) + MMUBASE; /* - * 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 *)p0upa; - epte = (u_int *)(p0upa + 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 *)(p0upa - firstpa); + RELOC(lwp0uarea, vaddr_t) = lwp0upa - firstpa; /* * VM data structures are now initialized, set up data for