diff options
author | John Baldwin <jhb@FreeBSD.org> | 2006-02-14 14:50:11 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2006-02-14 14:50:11 +0000 |
commit | 414c4ab4c519ccc2192985b3a364be1d251ac70c (patch) | |
tree | b7d13386c1898952da0190630b755f8cf299d8ed | |
parent | 8d40843ab4306e168250711bbb1b5fafe96a8244 (diff) | |
download | src-414c4ab4c519ccc2192985b3a364be1d251ac70c.tar.gz src-414c4ab4c519ccc2192985b3a364be1d251ac70c.zip |
Fix the hw.realmem sysctl. The global realmem variable is a count of
pages, not a count of bytes. The sysctl handler for hw.realmem already
uses ctob() to convert realmem from pages to bytes. Thus, on archs that
were storing a byte count in the realmem variable, hw.realmem was inflated.
Reported by: Valerio daelli valerio dot daelli at gmail dot com (alpha)
MFC after: 3 days
Notes
Notes:
svn path=/head/; revision=155680
-rw-r--r-- | sys/alpha/alpha/machdep.c | 2 | ||||
-rw-r--r-- | sys/ia64/ia64/machdep.c | 2 | ||||
-rw-r--r-- | sys/sparc64/sparc64/machdep.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/sys/alpha/alpha/machdep.c b/sys/alpha/alpha/machdep.c index b12e0398ff49..0a279bbb9a83 100644 --- a/sys/alpha/alpha/machdep.c +++ b/sys/alpha/alpha/machdep.c @@ -250,7 +250,7 @@ cpu_startup(dummy) #endif printf("real memory = %ld (%ld MB)\n", alpha_ptob(Maxmem), alpha_ptob(Maxmem) / 1048576); - realmem = alpha_ptob(Maxmem); + realmem = 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 cb25a012ce2f..e9521bed82e4 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -256,7 +256,7 @@ cpu_startup(dummy) #endif printf("real memory = %ld (%ld MB)\n", ia64_ptob(Maxmem), ia64_ptob(Maxmem) / 1048576); - realmem = ia64_ptob(Maxmem); + realmem = 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 9d7e6cfe71ac..762472514353 100644 --- a/sys/sparc64/sparc64/machdep.c +++ b/sys/sparc64/sparc64/machdep.c @@ -201,7 +201,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; + realmem = (long)physsz / PAGE_SIZE; vm_ksubmap_init(&kmi); |