From 03ec9aa3d8b849fc90ff50d5c040be24662c06b6 Mon Sep 17 00:00:00 2001 From: jake Date: Sat, 7 Jun 2003 18:29:29 +0000 Subject: [PATCH] - Declare sparc64_memreg and sparc64_nmemreg in machine/ofw_mem.h. - On startup print the total physical memory, instead of what we're told is free by the firmware, to avoid astonishing users. --- sys/sparc64/include/ofw_mem.h | 3 +++ sys/sparc64/sparc64/dump_machdep.c | 3 --- sys/sparc64/sparc64/machdep.c | 10 ++++++++-- sys/sparc64/sparc64/vm_machdep.c | 3 --- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/sys/sparc64/include/ofw_mem.h b/sys/sparc64/include/ofw_mem.h index ea81e63d0709..af9089ed034a 100644 --- a/sys/sparc64/include/ofw_mem.h +++ b/sys/sparc64/include/ofw_mem.h @@ -40,4 +40,7 @@ struct ofw_map { u_long om_tte; }; +extern struct ofw_mem_region sparc64_memreg[]; +extern int sparc64_nmemreg; + #endif diff --git a/sys/sparc64/sparc64/dump_machdep.c b/sys/sparc64/sparc64/dump_machdep.c index d766b1ebfcca..5090caf90300 100644 --- a/sys/sparc64/sparc64/dump_machdep.c +++ b/sys/sparc64/sparc64/dump_machdep.c @@ -46,9 +46,6 @@ CTASSERT(sizeof(struct kerneldumpheader) == DEV_BSIZE); -extern struct ofw_mem_region sparc64_memreg[]; -extern int sparc64_nmemreg; - static struct kerneldumpheader kdh; static off_t dumplo, dumppos; diff --git a/sys/sparc64/sparc64/machdep.c b/sys/sparc64/sparc64/machdep.c index 669f4c7b30f5..2135b6dd5ad0 100644 --- a/sys/sparc64/sparc64/machdep.c +++ b/sys/sparc64/sparc64/machdep.c @@ -97,6 +97,7 @@ #include #include #include +#include #include #include #include @@ -162,6 +163,8 @@ CTASSERT(sizeof(struct pcpu) <= ((PCPU_PAGES * PAGE_SIZE) / 2)); static void cpu_startup(void *arg) { + vm_paddr_t physsz; + int i; tick_tc.tc_get_timecount = tick_get_timecount; tick_tc.tc_poll_pps = NULL; @@ -170,8 +173,11 @@ cpu_startup(void *arg) tick_tc.tc_name = "tick"; tc_init(&tick_tc); - printf("real memory = %lu (%lu MB)\n", physmem * PAGE_SIZE, - physmem / ((1024 * 1024) / PAGE_SIZE)); + physsz = 0; + for (i = 0; i < sparc64_nmemreg; i++) + physsz += sparc64_memreg[i].mr_size; + printf("real memory = %lu (%lu MB)\n", physsz, + physsz / (1024 * 1024)); vm_ksubmap_init(&kmi); diff --git a/sys/sparc64/sparc64/vm_machdep.c b/sys/sparc64/sparc64/vm_machdep.c index 22f1af044f16..e96875c55f7c 100644 --- a/sys/sparc64/sparc64/vm_machdep.c +++ b/sys/sparc64/sparc64/vm_machdep.c @@ -80,9 +80,6 @@ #include #include -extern struct ofw_mem_region sparc64_memreg[]; -extern int sparc64_nmemreg; - PMAP_STATS_VAR(uma_nsmall_alloc); PMAP_STATS_VAR(uma_nsmall_alloc_oc); PMAP_STATS_VAR(uma_nsmall_free);