From 7d0fcadf39154d0db10517be5ab6233623223964 Mon Sep 17 00:00:00 2001 From: tsutsui Date: Mon, 21 May 2007 15:19:17 +0000 Subject: [PATCH] Initialize curlwp as well as lwp0.l_addr right after MMU is enabled. --- sys/arch/luna68k/luna68k/locore.s | 5 +++-- sys/arch/mac68k/mac68k/locore.s | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/arch/luna68k/luna68k/locore.s b/sys/arch/luna68k/luna68k/locore.s index d3bedb76a5fd..5f06bfc78c1d 100644 --- a/sys/arch/luna68k/luna68k/locore.s +++ b/sys/arch/luna68k/luna68k/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.25 2007/05/20 16:37:54 he Exp $ */ +/* $NetBSD: locore.s,v 1.26 2007/05/21 15:19:17 tsutsui Exp $ */ /* * Copyright (c) 1980, 1990, 1993 @@ -316,7 +316,8 @@ Lenab1: /* set kernel stack, user SP, lwp0, and initial pcb */ movl _C_LABEL(proc0paddr),%a1 | get lwp0 pcb addr lea %a1@(USPACE-4),%sp | set kernel stack to end of area - lea _C_LABEL(lwp0),%a2 | initialize lwp0.l_addr so that + lea _C_LABEL(lwp0),%a2 | initialize lwp0.l_addr + movl %a2,_C_LABEL(curlwp) | and curlwp so that movl %a1,%a2@(L_ADDR) | we don't deref NULL in trap() movl #USRSTACK-4,%a2 movl %a2,%usp | init user SP diff --git a/sys/arch/mac68k/mac68k/locore.s b/sys/arch/mac68k/mac68k/locore.s index 6e1ca562bbad..fa7f49c65466 100644 --- a/sys/arch/mac68k/mac68k/locore.s +++ b/sys/arch/mac68k/mac68k/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.149 2007/05/20 15:06:40 he Exp $ */ +/* $NetBSD: locore.s,v 1.150 2007/05/21 15:19:17 tsutsui Exp $ */ /* * Copyright (c) 1982, 1990 The Regents of the University of California. @@ -340,7 +340,8 @@ Lloaddone: /* set kernel stack, user SP, lwp0, and initial pcb */ movl _C_LABEL(proc0paddr),%a1 | get proc0 pcb addr lea %a1@(USPACE-4),%sp | set kernel stack to end of area - lea _C_LABEL(lwp0),%a2 | initialize lwp0.l_addr so that + lea _C_LABEL(lwp0),%a2 | initialize lwp0.l_addr + movl %a2,_C_LABEL(curlwp) | and curlwp so that movl %a1,%a2@(L_ADDR) | we don't deref NULL in trap() movl #USRSTACK-4,%a2 movl %a2,%usp | init %USP