Use common pmap_bootstrap_finalize() to initialize lwp0 uarea etc.

Compile test only.
This commit is contained in:
tsutsui 2009-12-04 17:11:10 +00:00
parent 45c5695430
commit b57ad1c2ce
2 changed files with 6 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: amiga_init.c,v 1.113 2009/11/26 18:23:48 phx Exp $ */
/* $NetBSD: amiga_init.c,v 1.114 2009/12/04 17:11:10 tsutsui Exp $ */
/*
* Copyright (c) 1994 Michael L. Hitch
@ -36,11 +36,10 @@
#include "opt_devreload.h"
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: amiga_init.c,v 1.113 2009/11/26 18:23:48 phx Exp $");
__KERNEL_RCSID(0, "$NetBSD: amiga_init.c,v 1.114 2009/12/04 17:11:10 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <uvm/uvm_extern.h>
#include <sys/ioctl.h>
#include <sys/select.h>
@ -353,7 +352,7 @@ start_c(id, fphystart, fphysize, cphysize, esym_addr, flags, inh_sync,
/*
* save KVA of lwp0 u-area and allocate it.
*/
RELOC(lwp0.l_addr, struct user *) = (struct user *)vstart;
RELOC(lwp0uarea, vaddr_t) = vstart;
pstart += USPACE;
vstart += USPACE;
avail -= USPACE;
@ -788,8 +787,8 @@ start_c_finish(void)
((volatile struct Custom *)CUSTOMADDR)->color[0] = 0x0a0; /* GREEN */
#endif
memset(lwp0.l_addr, 0, USPACE);
pmap_bootstrap(start_c_pstart, start_c_fphystart);
pmap_bootstrap_finalize();
/*
* to make life easier in locore.s, set these addresses explicitly

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.146 2009/11/26 00:19:12 matt Exp $ */
/* $NetBSD: locore.s,v 1.147 2009/12/04 17:11:11 tsutsui Exp $ */
/*
* Copyright (c) 1980, 1990 The Regents of the University of California.
@ -1024,14 +1024,11 @@ LMMUenable_end:
jbsr _C_LABEL(start_c_finish)
/* set kernel stack, user SP, and initial pcb */
lea _C_LABEL(lwp0),%a2 | grab lwp0 and initialize
movl %a2,_C_LABEL(curlwp) | curlwp so that
movl %a2@(L_ADDR),%a1 | we don't dref NULL in trap()
movl _C_LABEL(lwp0uarea),%a1 | grab lwp0 uarea
lea %a1@(USPACE),%sp | set kernel stack to end of area
movl #USRSTACK-4,%a2
movl %a2,%usp | init user SP
movl %a2,%a1@(PCB_USP) | and save it
movl %a1,_C_LABEL(curpcb) | lwp0 is running
clrw %a1@(PCB_FLAGS) | clear flags
#ifdef FPCOPROC
clrl %a1@(PCB_FPCTX) | ensure null FP context