svn commit: r256814 - head/sys/powerpc/booke

Nathan Whitehorn nwhitehorn at FreeBSD.org
Sun Oct 20 23:02:17 UTC 2013


Author: nwhitehorn
Date: Sun Oct 20 23:02:16 2013
New Revision: 256814
URL: http://svnweb.freebsd.org/changeset/base/256814

Log:
  Avoid sign overflow if there are more than 2 GB of RAM.

Modified:
  head/sys/powerpc/booke/machdep.c

Modified: head/sys/powerpc/booke/machdep.c
==============================================================================
--- head/sys/powerpc/booke/machdep.c	Sun Oct 20 22:50:57 2013	(r256813)
+++ head/sys/powerpc/booke/machdep.c	Sun Oct 20 23:02:16 2013	(r256814)
@@ -192,7 +192,8 @@ extern int elf32_nxstack;
 static void
 cpu_booke_startup(void *dummy)
 {
-	int indx, size;
+	int indx;
+	unsigned long size;
 
 	/* Initialise the decrementer-based clock. */
 	decr_init();
@@ -200,7 +201,7 @@ cpu_booke_startup(void *dummy)
 	/* Good {morning,afternoon,evening,night}. */
 	cpu_setup(PCPU_GET(cpuid));
 
-	printf("real memory  = %ld (%ld MB)\n", ptoa(physmem),
+	printf("real memory  = %lu (%ld MB)\n", ptoa(physmem),
 	    ptoa(physmem) / 1048576);
 	realmem = physmem;
 
@@ -210,7 +211,7 @@ cpu_booke_startup(void *dummy)
 		for (indx = 0; phys_avail[indx + 1] != 0; indx += 2) {
 			size = phys_avail[indx + 1] - phys_avail[indx];
 
-			printf("0x%08x - 0x%08x, %d bytes (%ld pages)\n",
+			printf("0x%08x - 0x%08x, %lu bytes (%lu pages)\n",
 			    phys_avail[indx], phys_avail[indx + 1] - 1,
 			    size, size / PAGE_SIZE);
 		}
@@ -218,7 +219,7 @@ cpu_booke_startup(void *dummy)
 
 	vm_ksubmap_init(&kmi);
 
-	printf("avail memory = %ld (%ld MB)\n", ptoa(cnt.v_free_count),
+	printf("avail memory = %lu (%ld MB)\n", ptoa(cnt.v_free_count),
 	    ptoa(cnt.v_free_count) / 1048576);
 
 	/* Set up buffers, so they can be used to read disk labels. */


More information about the svn-src-all mailing list