summaryrefslogtreecommitdiff
path: root/sys/kern/kern_intr.c
diff options
context:
space:
mode:
authorThomas Moestl <tmm@FreeBSD.org>2001-06-01 13:23:28 +0000
committerThomas Moestl <tmm@FreeBSD.org>2001-06-01 13:23:28 +0000
commitd279178df74576ab7d78b6d39c109a57e6b14596 (patch)
tree9195d3992cac62626ab1d518ecc5af211e265138 /sys/kern/kern_intr.c
parenta5c3951e7a043b86c143a2f9eaeb8dccc7415aeb (diff)
Notes
Diffstat (limited to 'sys/kern/kern_intr.c')
-rw-r--r--sys/kern/kern_intr.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c
index 5b376c17ba8a..59ef7ff75ad0 100644
--- a/sys/kern/kern_intr.c
+++ b/sys/kern/kern_intr.c
@@ -42,6 +42,7 @@
#include <sys/proc.h>
#include <sys/random.h>
#include <sys/resourcevar.h>
+#include <sys/sysctl.h>
#include <sys/unistd.h>
#include <sys/vmmeter.h>
#include <machine/atomic.h>
@@ -620,3 +621,32 @@ swi_net(void *dummy)
bits &= ~(1 << i);
}
}
+
+/*
+ * Sysctls used by systat and others: hw.intrnames and hw.intrcnt.
+ * The data for this machine dependent, and the declarations are in machine
+ * dependent code. The layout of intrnames and intrcnt however is machine
+ * independent.
+ *
+ * We do not know the length of intrcnt and intrnames at compile time, so
+ * calculate things at run time.
+ */
+static int
+sysctl_intrnames(SYSCTL_HANDLER_ARGS)
+{
+ return (sysctl_handle_opaque(oidp, intrnames, eintrnames - intrnames,
+ req));
+}
+
+SYSCTL_PROC(_hw, OID_AUTO, intrnames, CTLTYPE_OPAQUE | CTLFLAG_RD,
+ NULL, 0, sysctl_intrnames, "", "Interrupt Names");
+
+static int
+sysctl_intrcnt(SYSCTL_HANDLER_ARGS)
+{
+ return (sysctl_handle_opaque(oidp, intrcnt,
+ (char *)eintrcnt - (char *)intrcnt, req));
+}
+
+SYSCTL_PROC(_hw, OID_AUTO, intrcnt, CTLTYPE_OPAQUE | CTLFLAG_RD,
+ NULL, 0, sysctl_intrcnt, "", "Interrupt Counts");