summaryrefslogtreecommitdiffstats
path: root/sys/alpha
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>1999-02-27 18:41:40 +0000
committerdfr <dfr@FreeBSD.org>1999-02-27 18:41:40 +0000
commitf5db03383315cdcf83ce94219ebfed415967d651 (patch)
treeb70289f1e86dc6a81ba0e7dac133eeb51ec5625f /sys/alpha
parent6df3a4da61c19f60c3a5011b1e9d3206bf2ca36b (diff)
downloadFreeBSD-src-f5db03383315cdcf83ce94219ebfed415967d651.zip
FreeBSD-src-f5db03383315cdcf83ce94219ebfed415967d651.tar.gz
* Add support for hw.physmem and hw.usermem sysctls (this allows sysinstall
to calculate a reasonable size for the swap partition). * Fix a typo in remrq() where a process with idle priority would not be correctly removed from the relavent queue. Note that realtime and idle priorities are still not supported since the assembler code in cpu_switch() does not check the realtime and idle queues.
Diffstat (limited to 'sys/alpha')
-rw-r--r--sys/alpha/alpha/machdep.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/sys/alpha/alpha/machdep.c b/sys/alpha/alpha/machdep.c
index 6d5492b..b027e98 100644
--- a/sys/alpha/alpha/machdep.c
+++ b/sys/alpha/alpha/machdep.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: machdep.c,v 1.31 1999/01/26 02:49:51 julian Exp $
+ * $Id: machdep.c,v 1.32 1999/02/22 15:13:33 bde Exp $
*/
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -200,6 +200,27 @@ int ncpus; /* number of cpus */
vm_offset_t phys_avail[10];
+static int
+sysctl_hw_physmem SYSCTL_HANDLER_ARGS
+{
+ int error = sysctl_handle_int(oidp, 0, alpha_ptob(physmem), req);
+ return (error);
+}
+
+SYSCTL_PROC(_hw, HW_PHYSMEM, physmem, CTLTYPE_INT|CTLFLAG_RD,
+ 0, 0, sysctl_hw_physmem, "I", "");
+
+static int
+sysctl_hw_usermem SYSCTL_HANDLER_ARGS
+{
+ int error = sysctl_handle_int(oidp, 0,
+ alpha_ptob(physmem - cnt.v_wire_count), req);
+ return (error);
+}
+
+SYSCTL_PROC(_hw, HW_USERMEM, usermem, CTLTYPE_INT|CTLFLAG_RD,
+ 0, 0, sysctl_hw_usermem, "I", "");
+
SYSCTL_INT(_hw, OID_AUTO, availpages, CTLFLAG_RD, &physmem, 0, "");
/* must be 2 less so 0 0 can signal end of chunks */
@@ -1227,7 +1248,7 @@ remrq(p)
REMRQ(rtqs, whichrtqs, pri, p);
} else {
/* idle priority */
- REMRQ(rtqs, whichrtqs, pri, p);
+ REMRQ(idqs, whichidqs, pri, p);
}
}
}
OpenPOWER on IntegriCloud