svn commit: r326212 - head/sys/powerpc/aim

Nathan Whitehorn nwhitehorn at FreeBSD.org
Sat Nov 25 22:13:21 UTC 2017


Author: nwhitehorn
Date: Sat Nov 25 22:13:19 2017
New Revision: 326212
URL: https://svnweb.freebsd.org/changeset/base/326212

Log:
  Allow platform modules to set the size of large pizes, as potentially
  discovered from firmware, and better handle highly-discontiguous memory
  and CPU maps.
  
  MFC after:	3 weeks

Modified:
  head/sys/powerpc/aim/mmu_oea64.c

Modified: head/sys/powerpc/aim/mmu_oea64.c
==============================================================================
--- head/sys/powerpc/aim/mmu_oea64.c	Sat Nov 25 22:10:10 2017	(r326211)
+++ head/sys/powerpc/aim/mmu_oea64.c	Sat Nov 25 22:13:19 2017	(r326212)
@@ -572,8 +572,10 @@ moea64_probe_large_page(void)
 		
 		/* FALLTHROUGH */
 	default:
-		moea64_large_page_size = 0x1000000; /* 16 MB */
-		moea64_large_page_shift = 24;
+		if (moea64_large_page_size == 0) {
+			moea64_large_page_size = 0x1000000; /* 16 MB */
+			moea64_large_page_shift = 24;
+		}
 	}
 
 	moea64_large_page_mask = moea64_large_page_size - 1;
@@ -873,9 +875,9 @@ moea64_late_bootstrap(mmu_t mmup, vm_offset_t kernelst
 	/*
 	 * Calculate the last available physical address.
 	 */
+	Maxmem = 0;
 	for (i = 0; phys_avail[i + 2] != 0; i += 2)
-		;
-	Maxmem = powerpc_btop(phys_avail[i + 1]);
+		Maxmem = max(Maxmem, powerpc_btop(phys_avail[i + 1]));
 
 	/*
 	 * Initialize MMU and remap early physical mappings
@@ -956,7 +958,7 @@ moea64_late_bootstrap(mmu_t mmup, vm_offset_t kernelst
 		pa += PAGE_SIZE;
 		va += PAGE_SIZE;
 	}
-	dpcpu_init(dpcpu, 0);
+	dpcpu_init(dpcpu, curcpu);
 
 	/*
 	 * Allocate some things for page zeroing. We put this directly


More information about the svn-src-head mailing list