diff options
author | jchandra <jchandra@FreeBSD.org> | 2011-02-28 21:33:26 +0000 |
---|---|---|
committer | jchandra <jchandra@FreeBSD.org> | 2011-02-28 21:33:26 +0000 |
commit | 1120f045d21b22400cfdfa794db3c37109fd5969 (patch) | |
tree | 2468e4e830eefeb71887064a011bfc39d9064c47 /sys/mips | |
parent | e89f07d0108225bdb370c9360173f79476cef0fb (diff) | |
download | FreeBSD-src-1120f045d21b22400cfdfa794db3c37109fd5969.zip FreeBSD-src-1120f045d21b22400cfdfa794db3c37109fd5969.tar.gz |
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()
Diffstat (limited to 'sys/mips')
-rw-r--r-- | sys/mips/mips/machdep.c | 16 | ||||
-rw-r--r-- | sys/mips/mips/pmap.c | 7 |
2 files changed, 11 insertions, 12 deletions
diff --git a/sys/mips/mips/machdep.c b/sys/mips/mips/machdep.c index 4be1307..4c80ea0 100644 --- a/sys/mips/mips/machdep.c +++ b/sys/mips/mips/machdep.c @@ -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); } } diff --git a/sys/mips/mips/pmap.c b/sys/mips/mips/pmap.c index f20e159..7f0f4f0 100644 --- a/sys/mips/mips/pmap.c +++ b/sys/mips/mips/pmap.c @@ -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. |