Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/ps Use HW_PHYSMEM64 to avoid problem with > 2GB memory (...



details:   https://anonhg.NetBSD.org/src/rev/1ddf62cbb7aa
branches:  trunk
changeset: 569499:1ddf62cbb7aa
user:      dsl <dsl%NetBSD.org@localhost>
date:      Sun Aug 22 18:55:44 2004 +0000

description:
Use HW_PHYSMEM64 to avoid problem with > 2GB memory (and >4GB as well)
Fixes PR/23717 and PR/24092

diffstat:

 bin/ps/nlist.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (37 lines):

diff -r 827e9afed627 -r 1ddf62cbb7aa bin/ps/nlist.c
--- a/bin/ps/nlist.c    Sun Aug 22 16:46:18 2004 +0000
+++ b/bin/ps/nlist.c    Sun Aug 22 18:55:44 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nlist.c,v 1.23 2004/03/27 14:09:10 simonb Exp $        */
+/*     $NetBSD: nlist.c,v 1.24 2004/08/22 18:55:44 dsl Exp $   */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
 #if 0
 static char sccsid[] = "@(#)nlist.c    8.4 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: nlist.c,v 1.23 2004/03/27 14:09:10 simonb Exp $");
+__RCSID("$NetBSD: nlist.c,v 1.24 2004/08/22 18:55:44 dsl Exp $");
 #endif
 #endif /* not lint */
 
@@ -153,13 +153,14 @@
        int mib[2];
        size_t size;
        fixpt_t xccpu;
+       uint64_t memsize;
 
        nlistread = 1;
        mib[0] = CTL_HW;
-       mib[1] = HW_PHYSMEM;
-       size = sizeof(mempages);
-       if (sysctl(mib, 2, &mempages, &size, NULL, 0) == 0)
-               mempages /= getpagesize();
+       mib[1] = HW_PHYSMEM64;
+       size = sizeof(memsize);
+       if (sysctl(mib, 2, &memsize, &size, NULL, 0) == 0)
+               mempages = memsize / getpagesize();
        else
                mempages = 0;
 



Home | Main Index | Thread Index | Old Index