diff options
author | jake <jake@FreeBSD.org> | 2003-06-07 18:29:29 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2003-06-07 18:29:29 +0000 |
commit | e39ac46db446387ffd7fb6aa1ef18b9de846fe15 (patch) | |
tree | e312afe8e9d0e5fb9f66756fc6fa3e5794ccbe32 /sys/sparc64 | |
parent | 2a43cda9e836aac4ba376fa604546eb8e5e78025 (diff) | |
download | FreeBSD-src-e39ac46db446387ffd7fb6aa1ef18b9de846fe15.zip FreeBSD-src-e39ac46db446387ffd7fb6aa1ef18b9de846fe15.tar.gz |
- 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.
Diffstat (limited to 'sys/sparc64')
-rw-r--r-- | sys/sparc64/include/ofw_mem.h | 3 | ||||
-rw-r--r-- | sys/sparc64/sparc64/dump_machdep.c | 3 | ||||
-rw-r--r-- | sys/sparc64/sparc64/machdep.c | 10 | ||||
-rw-r--r-- | 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 ea81e63..af9089e 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 d766b1e..5090caf 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 669f4c7..2135b6d 100644 --- a/sys/sparc64/sparc64/machdep.c +++ b/sys/sparc64/sparc64/machdep.c @@ -97,6 +97,7 @@ #include <machine/md_var.h> #include <machine/metadata.h> #include <machine/ofw_machdep.h> +#include <machine/ofw_mem.h> #include <machine/smp.h> #include <machine/pmap.h> #include <machine/pstate.h> @@ -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 22f1af0..e96875c 100644 --- a/sys/sparc64/sparc64/vm_machdep.c +++ b/sys/sparc64/sparc64/vm_machdep.c @@ -80,9 +80,6 @@ #include <machine/tlb.h> #include <machine/tstate.h> -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); |