Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/hp300/hp300 Use common pmap_bootstrap_finalize() to...
details: https://anonhg.NetBSD.org/src/rev/28df5d706c9c
branches: trunk
changeset: 749568:28df5d706c9c
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Wed Dec 02 15:51:12 2009 +0000
description:
Use common pmap_bootstrap_finalize() to initialize lwp0 uarea etc.
Tested on HP9000/382.
diffstat:
sys/arch/hp300/hp300/locore.s | 13 ++++++-------
sys/arch/hp300/hp300/pmap_bootstrap.c | 25 ++++++++++++-------------
2 files changed, 18 insertions(+), 20 deletions(-)
diffs (114 lines):
diff -r 73c1e1ddc4e5 -r 28df5d706c9c sys/arch/hp300/hp300/locore.s
--- a/sys/arch/hp300/hp300/locore.s Wed Dec 02 15:50:13 2009 +0000
+++ b/sys/arch/hp300/hp300/locore.s Wed Dec 02 15:51:12 2009 +0000
@@ -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.
diff -r 73c1e1ddc4e5 -r 28df5d706c9c sys/arch/hp300/hp300/pmap_bootstrap.c
--- a/sys/arch/hp300/hp300/pmap_bootstrap.c Wed Dec 02 15:50:13 2009 +0000
+++ b/sys/arch/hp300/hp300/pmap_bootstrap.c Wed Dec 02 15:51:12 2009 +0000
@@ -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
Home |
Main Index |
Thread Index |
Old Index