aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Moestl <tmm@FreeBSD.org>2001-03-23 03:45:17 +0000
committerThomas Moestl <tmm@FreeBSD.org>2001-03-23 03:45:17 +0000
commit368d2edce494627eafb8adb7652405eff5e4e6ae (patch)
tree6669d9e595dbb21ffd56ca8903f5a3ee8e571add
parentea846c773d9b3f5656c3a2d4929278711bc88053 (diff)
Notes
-rw-r--r--sys/alpha/include/intrcnt.h2
-rw-r--r--sys/amd64/amd64/machdep.c1
-rw-r--r--sys/amd64/isa/intr_machdep.c1
-rw-r--r--sys/amd64/isa/intr_machdep.h3
-rw-r--r--sys/amd64/isa/nmi.c1
-rw-r--r--sys/amd64/isa/vector.S7
-rw-r--r--sys/amd64/isa/vector.s7
-rw-r--r--sys/i386/i386/machdep.c1
-rw-r--r--sys/i386/include/intrcnt.h13
-rw-r--r--sys/i386/isa/intr_machdep.c1
-rw-r--r--sys/i386/isa/intr_machdep.h3
-rw-r--r--sys/i386/isa/nmi.c1
-rw-r--r--sys/i386/isa/vector.s7
-rw-r--r--sys/ia64/include/intrcnt.h2
-rw-r--r--sys/vm/vm_meter.c30
15 files changed, 65 insertions, 15 deletions
diff --git a/sys/alpha/include/intrcnt.h b/sys/alpha/include/intrcnt.h
index 440f819410e6c..5d2ce0b97c31e 100644
--- a/sys/alpha/include/intrcnt.h
+++ b/sys/alpha/include/intrcnt.h
@@ -75,5 +75,7 @@
#ifdef _KERNEL
#ifndef _LOCORE
extern volatile long intrcnt[];
+extern char intrnames[];
+extern char eintrnames[];
#endif
#endif
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 5d9f8bd12833a..6ca7c7e1b2c81 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -102,6 +102,7 @@
#include <machine/pcb_ext.h> /* pcb.h included via sys/user.h */
#include <machine/globaldata.h>
#include <machine/globals.h>
+#include <machine/intrcnt.h>
#ifdef SMP
#include <machine/smp.h>
#endif
diff --git a/sys/amd64/isa/intr_machdep.c b/sys/amd64/isa/intr_machdep.c
index 9fcab8553934a..99f9761536fd0 100644
--- a/sys/amd64/isa/intr_machdep.c
+++ b/sys/amd64/isa/intr_machdep.c
@@ -57,6 +57,7 @@
#include <sys/interrupt.h>
#include <machine/md_var.h>
#include <machine/segments.h>
+#include <machine/intrcnt.h>
#include <sys/bus.h>
#if defined(APIC_IO)
diff --git a/sys/amd64/isa/intr_machdep.h b/sys/amd64/isa/intr_machdep.h
index b42c34817f092..9f328e92467f5 100644
--- a/sys/amd64/isa/intr_machdep.h
+++ b/sys/amd64/isa/intr_machdep.h
@@ -136,9 +136,6 @@ typedef void inthand_t __P((u_int cs, u_int ef, u_int esp, u_int ss));
#define IDTVEC(name) __CONCAT(X,name)
-extern char eintrnames[]; /* end of intrnames[] */
-extern u_long intrcnt[]; /* counts for for each device and stray */
-extern char intrnames[]; /* string table containing device names */
extern u_long *intr_countp[]; /* pointers into intrcnt[] */
extern driver_intr_t *intr_handler[]; /* C entry points of intr handlers */
extern struct ithd *ithds[];
diff --git a/sys/amd64/isa/nmi.c b/sys/amd64/isa/nmi.c
index 9fcab8553934a..99f9761536fd0 100644
--- a/sys/amd64/isa/nmi.c
+++ b/sys/amd64/isa/nmi.c
@@ -57,6 +57,7 @@
#include <sys/interrupt.h>
#include <machine/md_var.h>
#include <machine/segments.h>
+#include <machine/intrcnt.h>
#include <sys/bus.h>
#if defined(APIC_IO)
diff --git a/sys/amd64/isa/vector.S b/sys/amd64/isa/vector.S
index 68b09b03c17de..981b858d64ec0 100644
--- a/sys/amd64/isa/vector.S
+++ b/sys/amd64/isa/vector.S
@@ -16,6 +16,8 @@
#include <i386/isa/isa.h>
#endif
+#include <machine/intrcnt.h>
+
#define FAST_INTR_HANDLER_USES_ES 1
#ifdef FAST_INTR_HANDLER_USES_ES
#define ACTUALLY_PUSHED 1
@@ -43,16 +45,15 @@
* XXX this doesn't really belong here; everything except the labels
* for the endpointers is almost machine-independent.
*/
-#define NR_INTRNAMES (1 + ICU_LEN + 2 * ICU_LEN)
.globl intrcnt, eintrcnt
intrcnt:
- .space NR_INTRNAMES * 4
+ .space INTRCNT_COUNT * 4
eintrcnt:
.globl intrnames, eintrnames
intrnames:
- .space NR_INTRNAMES * 16
+ .space INTRCNT_COUNT * 16
eintrnames:
.text
diff --git a/sys/amd64/isa/vector.s b/sys/amd64/isa/vector.s
index 68b09b03c17de..981b858d64ec0 100644
--- a/sys/amd64/isa/vector.s
+++ b/sys/amd64/isa/vector.s
@@ -16,6 +16,8 @@
#include <i386/isa/isa.h>
#endif
+#include <machine/intrcnt.h>
+
#define FAST_INTR_HANDLER_USES_ES 1
#ifdef FAST_INTR_HANDLER_USES_ES
#define ACTUALLY_PUSHED 1
@@ -43,16 +45,15 @@
* XXX this doesn't really belong here; everything except the labels
* for the endpointers is almost machine-independent.
*/
-#define NR_INTRNAMES (1 + ICU_LEN + 2 * ICU_LEN)
.globl intrcnt, eintrcnt
intrcnt:
- .space NR_INTRNAMES * 4
+ .space INTRCNT_COUNT * 4
eintrcnt:
.globl intrnames, eintrnames
intrnames:
- .space NR_INTRNAMES * 16
+ .space INTRCNT_COUNT * 16
eintrnames:
.text
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 5d9f8bd12833a..6ca7c7e1b2c81 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -102,6 +102,7 @@
#include <machine/pcb_ext.h> /* pcb.h included via sys/user.h */
#include <machine/globaldata.h>
#include <machine/globals.h>
+#include <machine/intrcnt.h>
#ifdef SMP
#include <machine/smp.h>
#endif
diff --git a/sys/i386/include/intrcnt.h b/sys/i386/include/intrcnt.h
new file mode 100644
index 0000000000000..aa624e3344868
--- /dev/null
+++ b/sys/i386/include/intrcnt.h
@@ -0,0 +1,13 @@
+/* $FreeBSD$ */
+
+#include <i386/isa/icu.h>
+
+#define INTRCNT_COUNT (1 + ICU_LEN + 2 * ICU_LEN)
+
+#ifdef _KERNEL
+#ifndef LOCORE
+extern u_long intrcnt[]; /* counts for for each device and stray */
+extern char intrnames[]; /* string table containing device names */
+extern char eintrnames[]; /* end of intrnames[] */
+#endif
+#endif
diff --git a/sys/i386/isa/intr_machdep.c b/sys/i386/isa/intr_machdep.c
index 9fcab8553934a..99f9761536fd0 100644
--- a/sys/i386/isa/intr_machdep.c
+++ b/sys/i386/isa/intr_machdep.c
@@ -57,6 +57,7 @@
#include <sys/interrupt.h>
#include <machine/md_var.h>
#include <machine/segments.h>
+#include <machine/intrcnt.h>
#include <sys/bus.h>
#if defined(APIC_IO)
diff --git a/sys/i386/isa/intr_machdep.h b/sys/i386/isa/intr_machdep.h
index b42c34817f092..9f328e92467f5 100644
--- a/sys/i386/isa/intr_machdep.h
+++ b/sys/i386/isa/intr_machdep.h
@@ -136,9 +136,6 @@ typedef void inthand_t __P((u_int cs, u_int ef, u_int esp, u_int ss));
#define IDTVEC(name) __CONCAT(X,name)
-extern char eintrnames[]; /* end of intrnames[] */
-extern u_long intrcnt[]; /* counts for for each device and stray */
-extern char intrnames[]; /* string table containing device names */
extern u_long *intr_countp[]; /* pointers into intrcnt[] */
extern driver_intr_t *intr_handler[]; /* C entry points of intr handlers */
extern struct ithd *ithds[];
diff --git a/sys/i386/isa/nmi.c b/sys/i386/isa/nmi.c
index 9fcab8553934a..99f9761536fd0 100644
--- a/sys/i386/isa/nmi.c
+++ b/sys/i386/isa/nmi.c
@@ -57,6 +57,7 @@
#include <sys/interrupt.h>
#include <machine/md_var.h>
#include <machine/segments.h>
+#include <machine/intrcnt.h>
#include <sys/bus.h>
#if defined(APIC_IO)
diff --git a/sys/i386/isa/vector.s b/sys/i386/isa/vector.s
index 68b09b03c17de..981b858d64ec0 100644
--- a/sys/i386/isa/vector.s
+++ b/sys/i386/isa/vector.s
@@ -16,6 +16,8 @@
#include <i386/isa/isa.h>
#endif
+#include <machine/intrcnt.h>
+
#define FAST_INTR_HANDLER_USES_ES 1
#ifdef FAST_INTR_HANDLER_USES_ES
#define ACTUALLY_PUSHED 1
@@ -43,16 +45,15 @@
* XXX this doesn't really belong here; everything except the labels
* for the endpointers is almost machine-independent.
*/
-#define NR_INTRNAMES (1 + ICU_LEN + 2 * ICU_LEN)
.globl intrcnt, eintrcnt
intrcnt:
- .space NR_INTRNAMES * 4
+ .space INTRCNT_COUNT * 4
eintrcnt:
.globl intrnames, eintrnames
intrnames:
- .space NR_INTRNAMES * 16
+ .space INTRCNT_COUNT * 16
eintrnames:
.text
diff --git a/sys/ia64/include/intrcnt.h b/sys/ia64/include/intrcnt.h
index 440f819410e6c..5d2ce0b97c31e 100644
--- a/sys/ia64/include/intrcnt.h
+++ b/sys/ia64/include/intrcnt.h
@@ -75,5 +75,7 @@
#ifdef _KERNEL
#ifndef _LOCORE
extern volatile long intrcnt[];
+extern char intrnames[];
+extern char eintrnames[];
#endif
#endif
diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c
index 6a80411ac0e99..8d3b8116b0c18 100644
--- a/sys/vm/vm_meter.c
+++ b/sys/vm/vm_meter.c
@@ -359,3 +359,33 @@ SYSCTL_INT(_vm_stats_misc, OID_AUTO,
SYSCTL_INT(_vm_stats_misc, OID_AUTO,
vm_page_hash_mask, CTLFLAG_RD, &vm_page_hash_mask, 0, "");
#endif
+
+/*
+ * Further sysctls used by systat: hw.nintr, hw.intrnames, hw.intrcnt.
+ * This does probably not really fit in here, but it is somehow connected.
+ * The definitions for this are machdep, but are currently defined for
+ * any architecture.
+ */
+
+/* include the machdep stuff */
+#include <machine/intrcnt.h>
+
+int nintr = INTRCNT_COUNT;
+SYSCTL_INT(_hw, OID_AUTO, nintr, CTLFLAG_RD, &nintr, 0, "Number of Interrupts");
+
+SYSCTL_OPAQUE(_hw, OID_AUTO, intrcnt, CTLFLAG_RD, &intrcnt,
+ sizeof(long) * INTRCNT_COUNT, "", "Interrupt Counts");
+
+/*
+ * We do not know the length in advance (in an MI fashion), 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");