svn commit: r219106 - head/sys/mips/mips

Jayachandran C. jchandra at FreeBSD.org
Mon Feb 28 21:33:27 UTC 2011


Author: jchandra
Date: Mon Feb 28 21:33:26 2011
New Revision: 219106
URL: http://svn.freebsd.org/changeset/base/219106

Log:
  Use correct types and fromats for physical address
  
  - Use vm_paddr_t for pa in pmap_steal_memory()
  - Use uintmax_t and %jx to ensure that physical address are printed
    correctly in cpu_startup() and pmap_bootstrap()

Modified:
  head/sys/mips/mips/machdep.c
  head/sys/mips/mips/pmap.c

Modified: head/sys/mips/mips/machdep.c
==============================================================================
--- head/sys/mips/mips/machdep.c	Mon Feb 28 21:25:35 2011	(r219105)
+++ head/sys/mips/mips/machdep.c	Mon Feb 28 21:33:26 2011	(r219106)
@@ -184,8 +184,8 @@ cpu_startup(void *dummy)
 	if (boothowto & RB_VERBOSE)
 		bootverbose++;
 
-	printf("real memory  = %lu (%luK bytes)\n", ptoa(realmem),
-	    ptoa(realmem) / 1024);
+	printf("real memory  = %ju (%juK bytes)\n", ptoa((uintmax_t)realmem),
+	    ptoa((uintmax_t)realmem) / 1024);
 
 	/*
 	 * Display any holes after the first chunk of extended memory.
@@ -195,13 +195,13 @@ cpu_startup(void *dummy)
 
 		printf("Physical memory chunk(s):\n");
 		for (indx = 0; phys_avail[indx + 1] != 0; indx += 2) {
-			uintptr_t size1 = phys_avail[indx + 1] - phys_avail[indx];
+			vm_paddr_t size1 = phys_avail[indx + 1] - phys_avail[indx];
 
-			printf("0x%08llx - 0x%08llx, %llu bytes (%llu pages)\n",
-			    (unsigned long long)phys_avail[indx],
-			    (unsigned long long)phys_avail[indx + 1] - 1,
-			    (unsigned long long)size1,
-			    (unsigned long long)size1 / PAGE_SIZE);
+			printf("0x%08jx - 0x%08jx, %ju bytes (%ju pages)\n",
+			    (uintmax_t)phys_avail[indx],
+			    (uintmax_t)phys_avail[indx + 1] - 1,
+			    (uintmax_t)size1,
+			    (uintmax_t)size1 / PAGE_SIZE);
 		}
 	}
 

Modified: head/sys/mips/mips/pmap.c
==============================================================================
--- head/sys/mips/mips/pmap.c	Mon Feb 28 21:25:35 2011	(r219105)
+++ head/sys/mips/mips/pmap.c	Mon Feb 28 21:33:26 2011	(r219106)
@@ -387,11 +387,10 @@ pmap_pte(pmap_t pmap, vm_offset_t va)
 vm_offset_t
 pmap_steal_memory(vm_size_t size)
 {
-	vm_size_t bank_size;
-	vm_offset_t pa, va;
+	vm_paddr_t bank_size, pa;
+	vm_offset_t va;
 
 	size = round_page(size);
-
 	bank_size = phys_avail[1] - phys_avail[0];
 	while (size > bank_size) {
 		int i;
@@ -540,7 +539,7 @@ again:
 			    (uintmax_t) phys_avail[i + 1] - 1,
 			    (uintmax_t) size, (uintmax_t) size / PAGE_SIZE);
 		}
-		printf("Maxmem is 0x%0lx\n", ptoa(Maxmem));
+		printf("Maxmem is 0x%0jx\n", ptoa((uintmax_t)Maxmem));
 	}
 	/*
 	 * Steal the message buffer from the beginning of memory.


More information about the svn-src-head mailing list