Module Name:    src
Committed By:   tsutsui
Date:           Sat Feb 25 02:43:08 UTC 2012

Modified Files:
        src/sys/arch/x68k/x68k: pmap_bootstrap.c

Log Message:
Reserve more bootstrap kernel PT pages if options EXTENDED_MEMORY is defined
for VA allocation in the extended memory probe function and possible 128MB
memory on 060turbo, as worksaround for x68k specific part of PR/45915.
Fixes GENERIC kernel panic on X68030 even without extended memory.
XXX: we should rather have proper probe function before pmap_bootstrap()

Tested on 060turbo with 128MB SIMM by Y.Sugahara, and also
tested on XM6i with 68030 and custom 128MB memory settings by isaki@.

Should be pulled up to netbsd-6.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 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/x68k/x68k/pmap_bootstrap.c
diff -u src/sys/arch/x68k/x68k/pmap_bootstrap.c:1.58 src/sys/arch/x68k/x68k/pmap_bootstrap.c:1.59
--- src/sys/arch/x68k/x68k/pmap_bootstrap.c:1.58	Fri Feb 10 06:28:39 2012
+++ src/sys/arch/x68k/x68k/pmap_bootstrap.c	Sat Feb 25 02:43:08 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_bootstrap.c,v 1.58 2012/02/10 06:28:39 mhitch Exp $	*/
+/*	$NetBSD: pmap_bootstrap.c,v 1.59 2012/02/25 02:43:08 tsutsui Exp $	*/
 
 /* 
  * Copyright (c) 1991, 1993
@@ -36,9 +36,10 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.58 2012/02/10 06:28:39 mhitch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.59 2012/02/25 02:43:08 tsutsui Exp $");
 
 #include "opt_m68k_arch.h"
+#include "opt_extmem.h"
 
 #include <sys/param.h>
 #include <uvm/uvm_extern.h>
@@ -124,6 +125,19 @@ pmap_bootstrap(paddr_t nextpa, paddr_t f
 	kptpa = nextpa;
 	nptpages = RELOC(Sysptsize, int) + howmany(RELOC(physmem, int), NPTEPG) +
 		(IIOMAPSIZE + NPTEPG - 1) / NPTEPG;
+#ifdef EXTENDED_MEMORY
+	/*
+	 * Current supported maximum EXTENDED_MEMORY is 128MB on 060turbo.
+	 */
+#define MAX_EXTENDED_MEMORY	(128 * 1024 * 1024)
+	nptpages += howmany(btoc(MAX_EXTENDED_MEMORY), NPTEPG);
+
+	/*
+	 * mem_exist() in machdep.c needs two extra VA pages before pmap_init()
+	 * to probe >16MB memory.
+	 */
+	nptpages += 1;
+#endif
 	nextpa += nptpages * PAGE_SIZE;
 
 	/*

Reply via email to