summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwes <wes@FreeBSD.org>2005-03-01 21:55:27 +0000
committerwes <wes@FreeBSD.org>2005-03-01 21:55:27 +0000
commit92310fbdd7e1345d153293b1f14f6941b1ddc9ef (patch)
tree0ec9dab36f40f315b19c728d553fe99853c6bdea
parent42a8b3a5679e4bc34e942b115953f21edef85b88 (diff)
downloadFreeBSD-src-92310fbdd7e1345d153293b1f14f6941b1ddc9ef.zip
FreeBSD-src-92310fbdd7e1345d153293b1f14f6941b1ddc9ef.tar.gz
Attempt to doff the pointy hat: implement 'hw.realmem' on remaining
architectures. Pointed out by O'Brien, ScottL via email. Reviewed by: obrien (various)
-rw-r--r--sys/alpha/alpha/machdep.c2
-rw-r--r--sys/ia64/ia64/machdep.c2
-rw-r--r--sys/pc98/i386/machdep.c4
-rw-r--r--sys/pc98/pc98/machdep.c4
-rw-r--r--sys/sparc64/sparc64/machdep.c2
5 files changed, 14 insertions, 0 deletions
diff --git a/sys/alpha/alpha/machdep.c b/sys/alpha/alpha/machdep.c
index b965af9..cd18df2 100644
--- a/sys/alpha/alpha/machdep.c
+++ b/sys/alpha/alpha/machdep.c
@@ -194,6 +194,7 @@ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL)
struct msgbuf *msgbufp=0;
long Maxmem = 0;
+long realmem = 0;
long totalphysmem; /* total amount of physical memory in system */
long resvmem; /* amount of memory reserved for PROM */
@@ -250,6 +251,7 @@ cpu_startup(dummy)
#endif
printf("real memory = %ld (%ld MB)\n", alpha_ptob(Maxmem),
alpha_ptob(Maxmem) / 1048576);
+ realmem = alpha_ptob(Maxmem);
/*
* Display any holes after the first chunk of extended memory.
diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c
index 7492c4e..5c281b0 100644
--- a/sys/ia64/ia64/machdep.c
+++ b/sys/ia64/ia64/machdep.c
@@ -143,6 +143,7 @@ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL)
struct msgbuf *msgbufp=0;
long Maxmem = 0;
+long realmem = 0;
vm_offset_t phys_avail[100];
@@ -246,6 +247,7 @@ cpu_startup(dummy)
#endif
printf("real memory = %ld (%ld MB)\n", ia64_ptob(Maxmem),
ia64_ptob(Maxmem) / 1048576);
+ realmem = ia64_ptob(Maxmem);
/*
* Display any holes after the first chunk of extended memory.
diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c
index 3a0e7ab..7779104 100644
--- a/sys/pc98/i386/machdep.c
+++ b/sys/pc98/i386/machdep.c
@@ -196,6 +196,7 @@ static void freebsd4_sendsig(sig_t catcher, int sig, sigset_t *mask,
#endif
long Maxmem = 0;
+long realmem = 0;
vm_paddr_t phys_avail[10];
@@ -228,6 +229,9 @@ cpu_startup(dummy)
#endif
printf("real memory = %ju (%ju MB)\n", ptoa((uintmax_t)Maxmem),
ptoa((uintmax_t)Maxmem) / 1048576);
+ /* This truncates if memory > 4GB, is this possible on PC98? */
+ realmem = (long)ptoa((uintmax_t)Maxmem);
+
/*
* Display any holes after the first chunk of extended memory.
*/
diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c
index 3a0e7ab..7779104 100644
--- a/sys/pc98/pc98/machdep.c
+++ b/sys/pc98/pc98/machdep.c
@@ -196,6 +196,7 @@ static void freebsd4_sendsig(sig_t catcher, int sig, sigset_t *mask,
#endif
long Maxmem = 0;
+long realmem = 0;
vm_paddr_t phys_avail[10];
@@ -228,6 +229,9 @@ cpu_startup(dummy)
#endif
printf("real memory = %ju (%ju MB)\n", ptoa((uintmax_t)Maxmem),
ptoa((uintmax_t)Maxmem) / 1048576);
+ /* This truncates if memory > 4GB, is this possible on PC98? */
+ realmem = (long)ptoa((uintmax_t)Maxmem);
+
/*
* Display any holes after the first chunk of extended memory.
*/
diff --git a/sys/sparc64/sparc64/machdep.c b/sys/sparc64/sparc64/machdep.c
index bc17295..1147a8e 100644
--- a/sys/sparc64/sparc64/machdep.c
+++ b/sys/sparc64/sparc64/machdep.c
@@ -118,6 +118,7 @@ int kernel_tlb_slots;
int cold = 1;
long Maxmem;
+long realmem;
char pcpu0[PCPU_PAGES * PAGE_SIZE];
struct trapframe frame0;
@@ -198,6 +199,7 @@ cpu_startup(void *arg)
physsz += sparc64_memreg[i].mr_size;
printf("real memory = %lu (%lu MB)\n", physsz,
physsz / (1024 * 1024));
+ realmem = (long)physsz;
vm_ksubmap_init(&kmi);
OpenPOWER on IntegriCloud