From b57ad1c2ce03467db9fbe6d331e24eed8090867e Mon Sep 17 00:00:00 2001 From: tsutsui Date: Fri, 4 Dec 2009 17:11:10 +0000 Subject: [PATCH] Use common pmap_bootstrap_finalize() to initialize lwp0 uarea etc. Compile test only. --- sys/arch/amiga/amiga/amiga_init.c | 9 ++++----- sys/arch/amiga/amiga/locore.s | 7 ++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/sys/arch/amiga/amiga/amiga_init.c b/sys/arch/amiga/amiga/amiga_init.c index 2569a2edee72..e7c2573603b0 100644 --- a/sys/arch/amiga/amiga/amiga_init.c +++ b/sys/arch/amiga/amiga/amiga_init.c @@ -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 -__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 #include -#include #include #include #include @@ -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 diff --git a/sys/arch/amiga/amiga/locore.s b/sys/arch/amiga/amiga/locore.s index 84ad4f62bd15..40156894b2ad 100644 --- a/sys/arch/amiga/amiga/locore.s +++ b/sys/arch/amiga/amiga/locore.s @@ -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