Module Name:    src
Committed By:   tsutsui
Date:           Fri Dec  4 18:55:14 UTC 2009

Modified Files:
        src/sys/arch/cesfic/cesfic: pmap_bootstrap.c
        src/sys/arch/hp300/hp300: pmap_bootstrap.c
        src/sys/arch/luna68k/luna68k: pmap_bootstrap.c
        src/sys/arch/mac68k/mac68k: pmap_bootstrap.c
        src/sys/arch/mvme68k/mvme68k: pmap_bootstrap.c
        src/sys/arch/news68k/news68k: pmap_bootstrap.c
        src/sys/arch/next68k/next68k: pmap_bootstrap.c
        src/sys/arch/x68k/x68k: pmap_bootstrap.c

Log Message:
Allocate lwp0upa (PA of lwp0 uarea) right after kernel rather than
between other page tables to use different mappings for ste/pte pages
as well as amiga and atari.  Should resolve XXX comments in next68k and x68k.

Tested on hp300 and mac68k.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/cesfic/cesfic/pmap_bootstrap.c
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/hp300/hp300/pmap_bootstrap.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/luna68k/luna68k/pmap_bootstrap.c
cvs rdiff -u -r1.82 -r1.83 src/sys/arch/mac68k/mac68k/pmap_bootstrap.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/news68k/news68k/pmap_bootstrap.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/next68k/next68k/pmap_bootstrap.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/x68k/x68k/pmap_bootstrap.c

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/cesfic/cesfic/pmap_bootstrap.c
diff -u src/sys/arch/cesfic/cesfic/pmap_bootstrap.c:1.20 src/sys/arch/cesfic/cesfic/pmap_bootstrap.c:1.21
--- src/sys/arch/cesfic/cesfic/pmap_bootstrap.c:1.20	Fri Dec  4 18:32:31 2009
+++ src/sys/arch/cesfic/cesfic/pmap_bootstrap.c	Fri Dec  4 18:55:13 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_bootstrap.c,v 1.20 2009/12/04 18:32:31 tsutsui Exp $	*/
+/*	$NetBSD: pmap_bootstrap.c,v 1.21 2009/12/04 18:55:13 tsutsui Exp $	*/
 
 /* 
  * Copyright (c) 1991, 1993
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.20 2009/12/04 18:32:31 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.21 2009/12/04 18:55:13 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -91,9 +91,15 @@
 	/*
 	 * Calculate important physical addresses:
 	 *
+	 *	lwp0upa		lwp 0 u-area		UPAGES pages
+	 *
 	 *	kstpa		kernel segment table	1 page (!040)
 	 *						N pages (040)
 	 *
+	 *	kptmpa		kernel PT map		1 page
+	 *
+	 *	lkptpa		last kernel PT page	1 page
+	 *
 	 *	kptpa		statically allocated
 	 *			kernel PT pages		Sysptsize+ pages
 	 *
@@ -101,15 +107,11 @@
 	 *   EIOMAPSIZE are the number of PTEs, hence we need to round
 	 *   the total to a page boundary with IO maps at the end. ]
 	 *
-	 *	kptmpa		kernel PT map		1 page
-	 *
-	 *	lkptpa		last kernel PT page	1 page
-	 *
-	 *	lwp0upa		lwp 0 u-area		UPAGES pages
-	 *
 	 * The KVA corresponding to any of these PAs is:
 	 *	(PA - firstpa + KERNBASE).
 	 */
+	lwp0upa = nextpa;
+	nextpa += USPACE;
 	if (RELOC(mmutype, int) == MMU_68040)
 		kstsize = MAXKL2SIZE / (NPTEPG/SG4_LEV2SIZE);
 	else
@@ -120,8 +122,6 @@
 	nextpa += PAGE_SIZE;
 	lkptpa = nextpa;
 	nextpa += PAGE_SIZE;
-	lwp0upa = nextpa;
-	nextpa += USPACE;
 	kptpa = nextpa;
 	nptpages = RELOC(Sysptsize, int);
 	nextpa += nptpages * PAGE_SIZE;

Index: src/sys/arch/hp300/hp300/pmap_bootstrap.c
diff -u src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.41 src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.42
--- src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.41	Fri Dec  4 18:32:31 2009
+++ src/sys/arch/hp300/hp300/pmap_bootstrap.c	Fri Dec  4 18:55:14 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_bootstrap.c,v 1.41 2009/12/04 18:32:31 tsutsui Exp $	*/
+/*	$NetBSD: pmap_bootstrap.c,v 1.42 2009/12/04 18:55:14 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1991, 1993
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.41 2009/12/04 18:32:31 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.42 2009/12/04 18:55:14 tsutsui Exp $");
 
 #include <sys/param.h>
 
@@ -101,9 +101,15 @@
 	/*
 	 * Calculate important physical addresses:
 	 *
+	 *	lwp0upa		lwp 0 u-area		UPAGES pages
+	 *
 	 *	kstpa		kernel segment table	1 page (!040)
 	 *						N pages (040)
 	 *
+	 *	kptmpa		kernel PT map		1 page
+	 *
+	 *	lkptpa		last kernel PT page	1 page
+	 *
 	 *	kptpa		statically allocated
 	 *			kernel PT pages		Sysptsize+ pages
 	 *
@@ -111,15 +117,11 @@
 	 *   EIOMAPSIZE are the number of PTEs, hence we need to round
 	 *   the total to a page boundary with IO maps at the end. ]
 	 *
-	 *	kptmpa		kernel PT map		1 page
-	 *
-	 *	lkptpa		last kernel PT page	1 page
-	 *
-	 *	lwp0upa		lwp 0 u-area		UPAGES pages
-	 *
 	 * The KVA corresponding to any of these PAs is:
 	 *	(PA - firstpa + KERNBASE).
 	 */
+	lwp0upa = nextpa;
+	nextpa += USPACE;
 	if (RELOC(mmutype, int) == MMU_68040)
 		kstsize = MAXKL2SIZE / (NPTEPG/SG4_LEV2SIZE);
 	else
@@ -130,8 +132,6 @@
 	nextpa += PAGE_SIZE;
 	lkptpa = nextpa;
 	nextpa += PAGE_SIZE;
-	lwp0upa = nextpa;
-	nextpa += USPACE;
 	kptpa = nextpa;
 	nptpages = RELOC(Sysptsize, int) +
 		(IIOMAPSIZE + EIOMAPSIZE + NPTEPG - 1) / NPTEPG;

Index: src/sys/arch/luna68k/luna68k/pmap_bootstrap.c
diff -u src/sys/arch/luna68k/luna68k/pmap_bootstrap.c:1.21 src/sys/arch/luna68k/luna68k/pmap_bootstrap.c:1.22
--- src/sys/arch/luna68k/luna68k/pmap_bootstrap.c:1.21	Fri Dec  4 18:32:31 2009
+++ src/sys/arch/luna68k/luna68k/pmap_bootstrap.c	Fri Dec  4 18:55:14 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_bootstrap.c,v 1.21 2009/12/04 18:32:31 tsutsui Exp $	*/
+/*	$NetBSD: pmap_bootstrap.c,v 1.22 2009/12/04 18:55:14 tsutsui Exp $	*/
 
 /* 
  * Copyright (c) 1991, 1993
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.21 2009/12/04 18:32:31 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.22 2009/12/04 18:55:14 tsutsui Exp $");
 
 #include <sys/param.h>
 
@@ -92,9 +92,13 @@
 	/*
 	 * Calculate important physical addresses:
 	 *
+	 *	lwp0upa		lwp 0 u-area		UPAGES pages
+	 *
 	 *	kstpa		kernel segment table	1 page (!040)
 	 *						N pages (040)
 	 *
+	 *	kptmpa		kernel PT map		1 page
+	 *
 	 *	kptpa		statically allocated
 	 *			kernel PT pages		Sysptsize+ pages
 	 *
@@ -102,16 +106,14 @@
 	 *   is the number of PTEs, hence we need to round
 	 *   the total to a page boundary with IO maps at the end. ]
 	 *
-	 *	kptmpa		kernel PT map		1 page
-	 *
-	 *	lwp0upa		lwp 0 u-area		UPAGES pages
-	 *
 	 * The KVA corresponding to any of these PAs is:
 	 *	(PA - firstpa + KERNBASE).
 	 */
 	iiomapsize = m68k_btop(RELOC(intiotop_phys, u_int) -
 			       RELOC(intiobase_phys, u_int));
 
+	lwp0upa = nextpa;
+	nextpa += USPACE;
 	if (RELOC(mmutype, int) == MMU_68040)
 		kstsize = MAXKL2SIZE / (NPTEPG/SG4_LEV2SIZE);
 	else
@@ -120,8 +122,6 @@
 	nextpa += kstsize * PAGE_SIZE;
 	kptmpa = nextpa;
 	nextpa += PAGE_SIZE;
-	lwp0upa = nextpa;
-	nextpa += USPACE;
 	kptpa = nextpa;
 	nptpages = RELOC(Sysptsize, int) +
 		(iiomapsize + NPTEPG - 1) / NPTEPG;

Index: src/sys/arch/mac68k/mac68k/pmap_bootstrap.c
diff -u src/sys/arch/mac68k/mac68k/pmap_bootstrap.c:1.82 src/sys/arch/mac68k/mac68k/pmap_bootstrap.c:1.83
--- src/sys/arch/mac68k/mac68k/pmap_bootstrap.c:1.82	Fri Dec  4 18:32:31 2009
+++ src/sys/arch/mac68k/mac68k/pmap_bootstrap.c	Fri Dec  4 18:55:14 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_bootstrap.c,v 1.82 2009/12/04 18:32:31 tsutsui Exp $	*/
+/*	$NetBSD: pmap_bootstrap.c,v 1.83 2009/12/04 18:55:14 tsutsui Exp $	*/
 
 /* 
  * Copyright (c) 1991, 1993
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.82 2009/12/04 18:32:31 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.83 2009/12/04 18:55:14 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -126,9 +126,13 @@
 	/*
 	 * Calculate important physical addresses:
 	 *
+	 *	lwp0upa		lwp 0 u-area		UPAGES pages
+	 *
 	 *	kstpa		kernel segment table	1 page (!040)
 	 *						N pages (040)
 	 *
+	 *	kptmpa		kernel PT map		1 page
+	 *
 	 *	kptpa		statically allocated
 	 *			kernel PT pages		Sysptsize+ pages
 	 *
@@ -136,11 +140,9 @@
 	 *   NBMAPSIZE are the number of PTEs, hence we need to round
 	 *   the total to a page boundary with IO maps at the end. ]
 	 *
-	 *	kptmpa		kernel PT map		1 page
-	 *
-	 *	lwp0upa		lwp 0 u-area		UPAGES pages
-	 *
 	 */
+	lwp0upa = nextpa;
+	nextpa += USPACE;
 	if (mmutype == MMU_68040)
 		kstsize = MAXKL2SIZE / (NPTEPG/SG4_LEV2SIZE);
 	else
@@ -149,8 +151,6 @@
 	nextpa += kstsize * PAGE_SIZE;
 	kptmpa = nextpa;
 	nextpa += PAGE_SIZE;
-	lwp0upa = nextpa;
-	nextpa += USPACE;
 	kptpa = nextpa;
 	nptpages = Sysptsize +
 		(IIOMAPSIZE + ROMMAPSIZE + VIDMAPSIZE + NPTEPG - 1) / NPTEPG;

Index: src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c
diff -u src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c:1.35 src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c:1.36
--- src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c:1.35	Fri Dec  4 18:32:31 2009
+++ src/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c	Fri Dec  4 18:55:14 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_bootstrap.c,v 1.35 2009/12/04 18:32:31 tsutsui Exp $	*/
+/*	$NetBSD: pmap_bootstrap.c,v 1.36 2009/12/04 18:55:14 tsutsui Exp $	*/
 
 /* 
  * Copyright (c) 1991, 1993
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.35 2009/12/04 18:32:31 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.36 2009/12/04 18:55:14 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/kcore.h>
@@ -99,9 +99,15 @@
 	/*
 	 * Calculate important physical addresses:
 	 *
+	 *	lwp0upa		lwp0 0 u-area		UPAGES pages
+	 *
 	 *	kstpa		kernel segment table	1 page (!040)
 	 *						N pages (040)
 	 *
+	 *	kptmpa		kernel PT map		1 page
+	 *
+	 *	lkptpa		last kernel PT page	1 page
+	 *
 	 *	kptpa		statically allocated
 	 *			kernel PT pages		Sysptsize+ pages
 	 *
@@ -109,12 +115,6 @@
 	 *   number of PTEs, hence we need to round the total to a page
 	 *   boundary with IO maps at the end. ]
 	 *
-	 *	kptmpa		kernel PT map		1 page
-	 *
-	 *	lkptpa		last kernel PT page	1 page
-	 *
-	 *	lwp0upa		lwp0 0 u-area		UPAGES pages
-	 *
 	 * The KVA corresponding to any of these PAs is:
 	 *	(PA - firstpa + KERNBASE).
 	 */

Index: src/sys/arch/news68k/news68k/pmap_bootstrap.c
diff -u src/sys/arch/news68k/news68k/pmap_bootstrap.c:1.25 src/sys/arch/news68k/news68k/pmap_bootstrap.c:1.26
--- src/sys/arch/news68k/news68k/pmap_bootstrap.c:1.25	Fri Dec  4 18:32:31 2009
+++ src/sys/arch/news68k/news68k/pmap_bootstrap.c	Fri Dec  4 18:55:14 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_bootstrap.c,v 1.25 2009/12/04 18:32:31 tsutsui Exp $	*/
+/*	$NetBSD: pmap_bootstrap.c,v 1.26 2009/12/04 18:55:14 tsutsui Exp $	*/
 
 /* 
  * Copyright (c) 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.25 2009/12/04 18:32:31 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.26 2009/12/04 18:55:14 tsutsui Exp $");
 
 #include <sys/param.h>
 
@@ -98,9 +98,13 @@
 	/*
 	 * Calculate important physical addresses:
 	 *
+	 *	lwp0upa		lwp 0 u-area		UPAGES pages
+	 *
 	 *	kstpa		kernel segment table	1 page (!040)
 	 *						N pages (040)
 	 *
+	 *	kptmpa		kernel PT map		1 page
+	 *
 	 *	kptpa		statically allocated
 	 *			kernel PT pages		Sysptsize+ pages
 	 *
@@ -108,10 +112,6 @@
 	 *   EIOMAPSIZE are the number of PTEs, hence we need to round
 	 *   the total to a page boundary with IO maps at the end. ]
 	 *
-	 *	kptmpa		kernel PT map		1 page
-	 *
-	 *	lwp0upa		lwp 0 u-area		UPAGES pages
-	 *
 	 * The KVA corresponding to any of these PAs is:
 	 *	(PA - firstpa + KERNBASE).
 	 */
@@ -124,6 +124,8 @@
 	eiomapsize = m68k_btop(RELOC(extiotop_phys, u_int) -
 			       RELOC(extiobase_phys, u_int));
 
+	lwp0upa = nextpa;
+	nextpa += USPACE;
 #ifdef M68040
 	if (RELOC(mmutype, int) == MMU_68040)
 		kstsize = MAXKL2SIZE / (NPTEPG/SG4_LEV2SIZE);
@@ -136,8 +138,6 @@
 	nextpa += kstsize * PAGE_SIZE;
 	kptmpa = nextpa;
 	nextpa += PAGE_SIZE;
-	lwp0upa = nextpa;
-	nextpa += USPACE;
 	kptpa = nextpa;
 	nptpages = RELOC(Sysptsize, int) +
 		(iiomapsize + eiomapsize + NPTEPG - 1) / NPTEPG;

Index: src/sys/arch/next68k/next68k/pmap_bootstrap.c
diff -u src/sys/arch/next68k/next68k/pmap_bootstrap.c:1.30 src/sys/arch/next68k/next68k/pmap_bootstrap.c:1.31
--- src/sys/arch/next68k/next68k/pmap_bootstrap.c:1.30	Fri Dec  4 18:32:31 2009
+++ src/sys/arch/next68k/next68k/pmap_bootstrap.c	Fri Dec  4 18:55:14 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_bootstrap.c,v 1.30 2009/12/04 18:32:31 tsutsui Exp $	*/
+/*	$NetBSD: pmap_bootstrap.c,v 1.31 2009/12/04 18:55:14 tsutsui Exp $	*/
 
 /*
  * This file was taken from mvme68k/mvme68k/pmap_bootstrap.c
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.30 2009/12/04 18:32:31 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.31 2009/12/04 18:55:14 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/kcore.h>
@@ -111,9 +111,15 @@
 	/*
 	 * Calculate important physical addresses:
 	 *
+	 *	lwp0upa		lwp 0 u-area		UPAGES pages
+	 *
 	 *	kstpa		kernel segment table	1 page (!040)
 	 *						N pages (040)
 	 *
+	 *	kptmpa		kernel PT map		1 page
+	 *
+	 *	lkptpa		last kernel PT page	1 page
+	 *
 	 *	kptpa		statically allocated
 	 *			kernel PT pages		Sysptsize+ pages
 	 *
@@ -121,15 +127,11 @@
 	 *   is the number of PTEs, hence we need to round
 	 *   the total to a page boundary with IO maps at the end. ]
 	 *
-	 *	kptmpa		kernel PT map		1 page
-	 *
-	 *	lkptpa		last kernel PT page	1 page
-	 *
-	 *	lwp0upa		lwp 0 u-area		UPAGES pages
-	 *
 	 * The KVA corresponding to any of these PAs is:
 	 *	(PA - firstpa + KERNBASE).
 	 */
+	lwp0upa = nextpa;
+	nextpa += USPACE;
 #if defined(M68040) || defined(M68060)
 	if (RELOC(mmutype, int) == MMU_68040)
 		kstsize = MAXKL2SIZE / (NPTEPG/SG4_LEV2SIZE);
@@ -142,8 +144,6 @@
 	nextpa += PAGE_SIZE;
 	lkptpa = nextpa;
 	nextpa += PAGE_SIZE;
-	lwp0upa = nextpa;
-	nextpa += USPACE;
 	kptpa = nextpa;
 	nptpages = RELOC(Sysptsize, int) +
 		(IIOMAPSIZE + MONOMAPSIZE + COLORMAPSIZE + NPTEPG - 1) / NPTEPG;
@@ -364,7 +364,6 @@
 	 * map the kernel segment table cache invalidated for 
 	 * these machines (for the 68040 not strictly necessary, but
 	 * recommended by Motorola; for the 68060 mandatory)
-	 * XXX this includes lwp0upa.  why?
 	 */
 	epte = &((u_int *)kptpa)[m68k_btop(nextpa - firstpa)];
 	protopte = (protopte & ~PG_PROT) | PG_RW;

Index: src/sys/arch/x68k/x68k/pmap_bootstrap.c
diff -u src/sys/arch/x68k/x68k/pmap_bootstrap.c:1.44 src/sys/arch/x68k/x68k/pmap_bootstrap.c:1.45
--- src/sys/arch/x68k/x68k/pmap_bootstrap.c:1.44	Fri Dec  4 18:32:31 2009
+++ src/sys/arch/x68k/x68k/pmap_bootstrap.c	Fri Dec  4 18:55:14 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_bootstrap.c,v 1.44 2009/12/04 18:32:31 tsutsui Exp $	*/
+/*	$NetBSD: pmap_bootstrap.c,v 1.45 2009/12/04 18:55:14 tsutsui Exp $	*/
 
 /* 
  * Copyright (c) 1991, 1993
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.44 2009/12/04 18:32:31 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.45 2009/12/04 18:55:14 tsutsui Exp $");
 
 #include "opt_m680x0.h"
 
@@ -92,9 +92,13 @@
 	/*
 	 * Calculate important physical addresses:
 	 *
+	 *	lwp0upa		lwp 0 u-area		UPAGES pages
+	 *
 	 *	kstpa		kernel segment table	1 page (!040)
 	 *						N pages (040)
 	 *
+	 *	kptmpa		kernel PT map		1 page
+	 *
 	 *	kptpa		statically allocated
 	 *			kernel PT pages		Sysptsize+ pages
 	 *
@@ -102,13 +106,11 @@
 	 *   is the number of PTEs, hence we need to round
 	 *   the total to a page boundary with IO maps at the end. ]
 	 *
-	 *	kptmpa		kernel PT map		1 page
-	 *
-	 *	lwp0upa		lwp 0 u-area		UPAGES pages
-	 *
 	 * The KVA corresponding to any of these PAs is:
 	 *	(PA - firstpa + KERNBASE).
 	 */
+	lwp0upa = nextpa;
+	nextpa += USPACE;
 	if (RELOC(mmutype, int) == MMU_68040)
 		kstsize = MAXKL2SIZE / (NPTEPG/SG4_LEV2SIZE);
 	else
@@ -117,8 +119,6 @@
 	nextpa += kstsize * PAGE_SIZE;
 	kptmpa = nextpa;
 	nextpa += PAGE_SIZE;
-	lwp0upa = nextpa;
-	nextpa += USPACE;
 	kptpa = nextpa;
 	nptpages = RELOC(Sysptsize, int) +
 		(IIOMAPSIZE + NPTEPG - 1) / NPTEPG;
@@ -300,7 +300,6 @@
 	 * map the kernel segment table cache invalidated for
 	 * these machines (for the 68040 not strictly necessary, but
 	 * recommended by Motorola; for the 68060 mandatory)
-	 * XXX this includes lwp0upa.  why?
 	 */
 	epte = &((u_int *)kptpa)[m68k_btop(nextpa - firstpa)];
 	protopte = (protopte & ~PG_PROT) | PG_RW;

Reply via email to