From 44afc5dc3b7fdbfffdffe23dce47d0e46e4472f0 Mon Sep 17 00:00:00 2001 From: Simon Schubert Date: Sat, 3 Feb 2007 09:25:10 +0000 Subject: [PATCH] Fix ps %CPU output in vkernel by exporting hw.availpages. Ps tries to read hw.availpages as part of its kernel variable setup and aborts calculations for any value depending on any kernel variable. --- sys/platform/vkernel/i386/cpu_regs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/platform/vkernel/i386/cpu_regs.c b/sys/platform/vkernel/i386/cpu_regs.c index 0a5c6fed7c..357db9f697 100644 --- a/sys/platform/vkernel/i386/cpu_regs.c +++ b/sys/platform/vkernel/i386/cpu_regs.c @@ -37,7 +37,7 @@ * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 * $FreeBSD: src/sys/i386/i386/machdep.c,v 1.385.2.30 2003/05/31 08:48:05 alc Exp $ - * $DragonFly: src/sys/platform/vkernel/i386/cpu_regs.c,v 1.11 2007/01/14 20:07:14 dillon Exp $ + * $DragonFly: src/sys/platform/vkernel/i386/cpu_regs.c,v 1.12 2007/02/03 09:25:10 corecode Exp $ */ #include "use_ether.h" @@ -153,6 +153,8 @@ sysctl_hw_usermem(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_hw, HW_USERMEM, usermem, CTLTYPE_INT|CTLFLAG_RD, 0, 0, sysctl_hw_usermem, "IU", ""); +SYSCTL_ULONG(_hw, OID_AUTO, availpages, CTLFLAG_RD, &Maxmem, NULL, ""); + #if 0 static int -- 2.41.0