svn commit: r208115 - projects/ppc64/sys/powerpc/aim

Nathan Whitehorn nwhitehorn at FreeBSD.org
Sat May 15 17:02:35 UTC 2010


Author: nwhitehorn
Date: Sat May 15 17:02:33 2010
New Revision: 208115
URL: http://svn.freebsd.org/changeset/base/208115

Log:
  Fix memory map detection in the > 4 GB case by not rounding down to an int.
  This (a) truncated the amount of available RAM, and (b) produced a screwy
  memory map that broke all kinds of things. USB and Firewire work now on my
  desktop.

Modified:
  projects/ppc64/sys/powerpc/aim/ofw_machdep.c

Modified: projects/ppc64/sys/powerpc/aim/ofw_machdep.c
==============================================================================
--- projects/ppc64/sys/powerpc/aim/ofw_machdep.c	Sat May 15 15:03:18 2010	(r208114)
+++ projects/ppc64/sys/powerpc/aim/ofw_machdep.c	Sat May 15 17:02:33 2010	(r208115)
@@ -128,9 +128,9 @@ memr_overlap(struct mem_region *r1, stru
 static void
 memr_merge(struct mem_region *from, struct mem_region *to)
 {
-	int end;
-	end = imax(to->mr_start + to->mr_size, from->mr_start + from->mr_size);
-	to->mr_start = imin(from->mr_start, to->mr_start);
+	vm_offset_t end;
+	end = ulmax(to->mr_start + to->mr_size, from->mr_start + from->mr_size);
+	to->mr_start = ulmin(from->mr_start, to->mr_start);
 	to->mr_size = end - to->mr_start;
 }
 
@@ -229,7 +229,6 @@ parse_ofw_memory(phandle_t node, const c
 		int hisz;
 
 		hisz = parse_ofw_memory(node, "reg", himem);
-		j = sz/sizeof(output[0]);
 		for (i = 0; i < hisz/sizeof(himem[0]); i++) {
 			if (himem[i].mr_start > BUS_SPACE_MAXADDR_32BIT) {
 				output[j].mr_start = himem[i].mr_start;


More information about the svn-src-projects mailing list