Module Name:    src
Committed By:   tsutsui
Date:           Wed Dec  2 15:53:34 UTC 2009

Modified Files:
        src/sys/arch/atari/atari: atari_init.c locore.s

Log Message:
Use common pmap_bootstrap_finalize() to initialize lwp0 uarea etc.
Tested on TT030.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/atari/atari/atari_init.c
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/atari/atari/locore.s

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/atari/atari/atari_init.c
diff -u src/sys/arch/atari/atari/atari_init.c:1.88 src/sys/arch/atari/atari/atari_init.c:1.89
--- src/sys/arch/atari/atari/atari_init.c:1.88	Fri Nov 27 03:23:05 2009
+++ src/sys/arch/atari/atari/atari_init.c	Wed Dec  2 15:53:34 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: atari_init.c,v 1.88 2009/11/27 03:23:05 rmind Exp $	*/
+/*	$NetBSD: atari_init.c,v 1.89 2009/12/02 15:53:34 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1995 Leo Weppelman
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: atari_init.c,v 1.88 2009/11/27 03:23:05 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atari_init.c,v 1.89 2009/12/02 15:53:34 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mbtype.h"
@@ -41,7 +41,6 @@
 
 #include <sys/param.h>
 #include <sys/systm.h>
-#include <sys/proc.h>
 #include <sys/ioctl.h>
 #include <sys/select.h>
 #include <sys/tty.h>
@@ -275,7 +274,7 @@
 	/*
 	 * Save KVA of lwp0 uarea and allocate it.
 	 */
-	uvm_lwp_setuarea(&lwp0, vstart);
+	lwp0uarea  = vstart;
 	pstart    += USPACE;
 	vstart    += USPACE;
 	avail     -= USPACE;
@@ -567,14 +566,9 @@
 	}
 
 	/*
-	 * Initialize the "u-area" pages.
-	 *
-	 * Must initialize uarea before autoconfig or the fault handler
-	 * will get a NULL reference.
+	 * Initialize the "u-area" pages etc.
 	 */
-	memset((void*)uvm_lwp_getuarea(&lwp0), 0, USPACE);
-	curlwp = &lwp0;
-	curpcb = lwp_getpcb(&lwp0);
+	pmap_bootstrap_finalize();
 
 	/*
 	 * Get the hardware into a defined state

Index: src/sys/arch/atari/atari/locore.s
diff -u src/sys/arch/atari/atari/locore.s:1.103 src/sys/arch/atari/atari/locore.s:1.104
--- src/sys/arch/atari/atari/locore.s:1.103	Thu Nov 26 00:19:13 2009
+++ src/sys/arch/atari/atari/locore.s	Wed Dec  2 15:53:34 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.103 2009/11/26 00:19:13 matt Exp $	*/
+/*	$NetBSD: locore.s,v 1.104 2009/12/02 15:53:34 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990 The Regents of the University of California.
@@ -1024,15 +1024,13 @@
 	jsr	_C_LABEL(start_c)
 
 	/*
-	 * set kernel stack, user SP, and initial pcb
+	 * set kernel stack, user SP
 	 */
-	lea	_C_LABEL(lwp0),%a0	| grab lwp0.p_addr
-	movl	%a0@(L_ADDR),%a1
+	movl	_C_LABEL(lwp0uarea),%a1	| grab lwp0 uarea
 	lea	%a1@(USPACE-4),%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
 
 	/* flush TLB and turn on caches */
@@ -1077,7 +1075,7 @@
   	movw	#PSL_USER,%...@-		|  in user mode
 	clrl	%...@-			|  stack adjust count
 	lea	%sp@(-64),%sp		|  construct space for D0-D7/A0-A7
-	#lea	_C_LABEL(lwp0),%a0	| lwp0 in a0
+	lea	_C_LABEL(lwp0),%a0	| lwp0 in a0
 	movl	%sp,%a0@(L_MD_REGS)     | save frame for lwp0
 	movl	%usp,%a1
 	movl	%a1,%sp@(FR_SP)		| save user stack pointer in frame

Reply via email to