Initialize curlwp as well as lwp0.l_addr right after MMU is enabled.

This commit is contained in:
tsutsui 2007-05-21 15:19:17 +00:00
parent 79dff7e882
commit 7d0fcadf39
2 changed files with 6 additions and 4 deletions

View File

@ -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 * Copyright (c) 1980, 1990, 1993
@ -316,7 +316,8 @@ Lenab1:
/* set kernel stack, user SP, lwp0, and initial pcb */ /* set kernel stack, user SP, lwp0, and initial pcb */
movl _C_LABEL(proc0paddr),%a1 | get lwp0 pcb addr movl _C_LABEL(proc0paddr),%a1 | get lwp0 pcb addr
lea %a1@(USPACE-4),%sp | set kernel stack to end of area 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 %a1,%a2@(L_ADDR) | we don't deref NULL in trap()
movl #USRSTACK-4,%a2 movl #USRSTACK-4,%a2
movl %a2,%usp | init user SP movl %a2,%usp | init user SP

View File

@ -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. * 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 */ /* set kernel stack, user SP, lwp0, and initial pcb */
movl _C_LABEL(proc0paddr),%a1 | get proc0 pcb addr movl _C_LABEL(proc0paddr),%a1 | get proc0 pcb addr
lea %a1@(USPACE-4),%sp | set kernel stack to end of area 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 %a1,%a2@(L_ADDR) | we don't deref NULL in trap()
movl #USRSTACK-4,%a2 movl #USRSTACK-4,%a2
movl %a2,%usp | init %USP movl %a2,%usp | init %USP