From 5552365a11572fc0c1854c95312373cb3368ad9e Mon Sep 17 00:00:00 2001 From: mrg Date: Tue, 3 Oct 2006 22:36:21 +0000 Subject: [PATCH] in pmap_mp_init(), tag & data are 64 bit int's, print them as such. also, fix up some comments and function names. --- sys/arch/sparc64/sparc64/pmap.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/sys/arch/sparc64/sparc64/pmap.c b/sys/arch/sparc64/sparc64/pmap.c index 273fe0bd9776..d5736bcd5ee2 100644 --- a/sys/arch/sparc64/sparc64/pmap.c +++ b/sys/arch/sparc64/sparc64/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.174 2006/09/18 23:56:54 mrg Exp $ */ +/* $NetBSD: pmap.c,v 1.175 2006/10/03 22:36:21 mrg Exp $ */ /* * * Copyright (C) 1996-1999 Eduardo Horvath. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.174 2006/09/18 23:56:54 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.175 2006/10/03 22:36:21 mrg Exp $"); #undef NO_VCACHE /* Don't forget the locked TLB in dostart */ #define HWREF @@ -443,8 +443,9 @@ pmap_mp_init(void) 1, /* valid */ 0 /* ie */); tp[i].data |= TLB_L | TLB_CV; - printf("xtlb[%d]: Tag: %p Data: %p\n", - i, (void*)tp[i].tag, (void*)tp[i].data); + printf("xtlb[%d]: Tag: %llx Data: %llx\n", + i, tp[i].tag, + tp[i].data); } for (i = 0; i < PAGE_SIZE; i += sizeof(long)) @@ -725,10 +726,11 @@ pmap_bootstrap(u_long kernelstart, u_long kernelend) * Here's a quick in-lined reverse bubble sort. It gets rid of * any translations inside the kernel data VA range. */ - for(i = 0; i < prom_map_size; i++) { - for(j = i; j < prom_map_size; j++) { + for (i = 0; i < prom_map_size; i++) { + for (j = i; j < prom_map_size; j++) { if (prom_map[j].vstart > prom_map[i].vstart) { struct prom_map tmp; + tmp = prom_map[i]; prom_map[i] = prom_map[j]; prom_map[j] = tmp; @@ -750,10 +752,11 @@ pmap_bootstrap(u_long kernelstart, u_long kernelend) #endif /* - * Allocate a 64MB page for the cpu_info structure now. + * Allocate a ncpu*64MB page for the cpu_info structure now. */ - if ((cpu0paddr = prom_alloc_phys(8 * PAGE_SIZE * sparc_ncpus, 8 * PAGE_SIZE)) == 0 ) { - prom_printf("Cannot allocate new cpu_info\n"); + cpu0paddr = prom_alloc_phys(8 * PAGE_SIZE * sparc_ncpus, 8 * PAGE_SIZE); + if (cpu0paddr == 0) { + prom_printf("Cannot allocate cpu_infos\n"); prom_halt(); } @@ -1053,7 +1056,7 @@ pmap_bootstrap(u_long kernelstart, u_long kernelend) BDPRINTF(PDB_BOOT1, ("Inserting cpu_info into pmap_kernel() at %p\n", cpus)); - /* Now map in all 8 pages of cpu_info */ + /* Now map in all 8 pages of interrupt stack/cpu_info */ pa = cpu0paddr; prom_map_phys(pa, 64*KB, vmmap, -1); @@ -1235,7 +1238,7 @@ pmap_growkernel(maxkvaddr) ("pmap_growkernel: extending %lx\n", kbreak)); pa = 0; if (!pmap_get_page(&pa)) - panic("pmap_grow_kernel: no pages"); + panic("pmap_growkernel: no pages"); ENTER_STAT(ptpneeded); } }