summaryrefslogtreecommitdiff
path: root/sys/kern/kern_sysctl.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2008-02-09 15:10:59 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2008-02-09 15:10:59 +0000
commit1b7b828bcba3260462511a413dc672cb8a4db98e (patch)
tree93cd4b2ddec508eb6d2c400cb0f68c98ba89b32a /sys/kern/kern_sysctl.c
parent5d86d618d3c3b175f9627d4f59c408c6f1cfe9f2 (diff)
Introduce HW_PHYSMEM64 and HW_USERMEM64 sysctls, which don't overflow on
machines with more than 4GB of memory. Make sysctl(8) print values obtained using these sysctls for hw.physmem and hw.usermem. ok krw@, miod@
Diffstat (limited to 'sys/kern/kern_sysctl.c')
-rw-r--r--sys/kern/kern_sysctl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index a855b835c6a..0063a736d1e 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.159 2007/12/23 01:59:58 dlg Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.160 2008/02/09 15:10:58 kettenis Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -642,6 +642,12 @@ hw_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
return (sysctl_rdstring(oldp, oldlenp, newp, hw_uuid));
else
return (EOPNOTSUPP);
+ case HW_PHYSMEM64:
+ return (sysctl_rdquad(oldp, oldlenp, newp,
+ ptoa((psize_t)physmem)));
+ case HW_USERMEM64:
+ return (sysctl_rdquad(oldp, oldlenp, newp,
+ ptoa((psize_t)physmem - uvmexp.wired)));
default:
return (EOPNOTSUPP);
}