Module Name:    src
Committed By:   msaitoh
Date:           Mon Sep  8 20:44:21 UTC 2014

Modified Files:
        src/sys/arch/next68k/next68k [netbsd-6-0]: pmap_bootstrap.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1008):
        sys/arch/next68k/next68k/pmap_bootstrap.c: revision 1.43
Move physmem calculations before nptpage initialization.
Should fix next68k specific part of PR port-m68k/45915
(panic: pmap_enter_ptpage: can't get KPT page), and
this is the last possible m68k MD part of this PR.
Note this change is not tested on the actual machine (yet),
but as noted in comment next68k/pmap_bootstrap.c is based on
the mvme68k one which has been fixed by the similar diff.
Should be pulled up to all netbsd-6 branches.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.42.8.1 src/sys/arch/next68k/next68k/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/next68k/next68k/pmap_bootstrap.c
diff -u src/sys/arch/next68k/next68k/pmap_bootstrap.c:1.42 src/sys/arch/next68k/next68k/pmap_bootstrap.c:1.42.8.1
--- src/sys/arch/next68k/next68k/pmap_bootstrap.c:1.42	Fri Feb 10 06:28:39 2012
+++ src/sys/arch/next68k/next68k/pmap_bootstrap.c	Mon Sep  8 20:44:21 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_bootstrap.c,v 1.42 2012/02/10 06:28:39 mhitch Exp $	*/
+/*	$NetBSD: pmap_bootstrap.c,v 1.42.8.1 2014/09/08 20:44:21 msaitoh 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.42 2012/02/10 06:28:39 mhitch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.42.8.1 2014/09/08 20:44:21 msaitoh Exp $");
 
 #include "opt_m68k_arch.h"
 
@@ -111,6 +111,42 @@ pmap_bootstrap(paddr_t nextpa, paddr_t f
 #endif
 
 	/*
+	 * Initialize the mem_clusters[] array for the crash dump
+	 * code.  While we're at it, compute the total amount of
+	 * physical memory in the system.
+	 */
+	for (i = 0; i < VM_PHYSSEG_MAX; i++) {
+		if (RELOC(phys_seg_list[i].ps_start, paddr_t) ==
+		    RELOC(phys_seg_list[i].ps_end, paddr_t)) {
+			/*
+			 * No more memory.
+			 */
+			break;
+		}
+
+		/*
+		 * Make sure these are properly rounded.
+		 */
+		RELOC(phys_seg_list[i].ps_start, paddr_t) =
+		    m68k_round_page(RELOC(phys_seg_list[i].ps_start,
+					  paddr_t));
+		RELOC(phys_seg_list[i].ps_end, paddr_t) =
+		    m68k_trunc_page(RELOC(phys_seg_list[i].ps_end,
+					  paddr_t));
+
+		size = RELOC(phys_seg_list[i].ps_end, paddr_t) -
+		    RELOC(phys_seg_list[i].ps_start, paddr_t);
+
+		RELOC(mem_clusters[i].start, u_quad_t) =
+		    RELOC(phys_seg_list[i].ps_start, paddr_t);
+		RELOC(mem_clusters[i].size, u_quad_t) = size;
+
+		RELOC(physmem, int) += size >> PGSHIFT;
+
+		RELOC(mem_cluster_cnt, int) += 1;
+	}
+
+	/*
 	 * Calculate important physical addresses:
 	 *
 	 *	lwp0upa		lwp0 u-area		UPAGES pages
@@ -484,42 +520,6 @@ pmap_bootstrap(paddr_t nextpa, paddr_t f
 	RELOC(lwp0uarea, vaddr_t) = lwp0upa - firstpa;
 
 	/*
-	 * Initialize the mem_clusters[] array for the crash dump
-	 * code.  While we're at it, compute the total amount of
-	 * physical memory in the system.
-	 */
-	for (i = 0; i < VM_PHYSSEG_MAX; i++) {
-		if (RELOC(phys_seg_list[i].ps_start, paddr_t) ==
-		    RELOC(phys_seg_list[i].ps_end, paddr_t)) {
-			/*
-			 * No more memory.
-			 */
-			break;
-		}
-
-		/*
-		 * Make sure these are properly rounded.
-		 */
-		RELOC(phys_seg_list[i].ps_start, paddr_t) =
-		    m68k_round_page(RELOC(phys_seg_list[i].ps_start,
-					  paddr_t));
-		RELOC(phys_seg_list[i].ps_end, paddr_t) =
-		    m68k_trunc_page(RELOC(phys_seg_list[i].ps_end,
-					  paddr_t));
-
-		size = RELOC(phys_seg_list[i].ps_end, paddr_t) -
-		    RELOC(phys_seg_list[i].ps_start, paddr_t);
-
-		RELOC(mem_clusters[i].start, u_quad_t) =
-		    RELOC(phys_seg_list[i].ps_start, paddr_t);
-		RELOC(mem_clusters[i].size, u_quad_t) = size;
-
-		RELOC(physmem, int) += size >> PGSHIFT;
-
-		RELOC(mem_cluster_cnt, int) += 1;
-	}
-
-	/*
 	 * Scoot the start of available on-board RAM forward to
 	 * account for:
 	 *

Reply via email to