diff options
author | tmm <tmm@FreeBSD.org> | 2001-03-23 03:45:17 +0000 |
---|---|---|
committer | tmm <tmm@FreeBSD.org> | 2001-03-23 03:45:17 +0000 |
commit | 76ba4861cd1cb43f58cdf0c32eafb5669114b1f0 (patch) | |
tree | 5ace7cdcab3528bb9062b0f26e814c2104d2eedf /sys | |
parent | e47209b0dbb141a9bd27e2b40eed1f027f320f68 (diff) | |
download | FreeBSD-src-76ba4861cd1cb43f58cdf0c32eafb5669114b1f0.zip FreeBSD-src-76ba4861cd1cb43f58cdf0c32eafb5669114b1f0.tar.gz |
Export intrnames and intrcnt as sysctls (hw.nintr, hw.intrnames and
hw.intrcnt).
Approved by: rwatson
Diffstat (limited to 'sys')
-rw-r--r-- | sys/alpha/include/intrcnt.h | 2 | ||||
-rw-r--r-- | sys/amd64/amd64/machdep.c | 1 | ||||
-rw-r--r-- | sys/amd64/isa/intr_machdep.c | 1 | ||||
-rw-r--r-- | sys/amd64/isa/intr_machdep.h | 3 | ||||
-rw-r--r-- | sys/amd64/isa/nmi.c | 1 | ||||
-rw-r--r-- | sys/amd64/isa/vector.S | 7 | ||||
-rw-r--r-- | sys/amd64/isa/vector.s | 7 | ||||
-rw-r--r-- | sys/i386/i386/machdep.c | 1 | ||||
-rw-r--r-- | sys/i386/include/intrcnt.h | 13 | ||||
-rw-r--r-- | sys/i386/isa/intr_machdep.c | 1 | ||||
-rw-r--r-- | sys/i386/isa/intr_machdep.h | 3 | ||||
-rw-r--r-- | sys/i386/isa/nmi.c | 1 | ||||
-rw-r--r-- | sys/i386/isa/vector.s | 7 | ||||
-rw-r--r-- | sys/ia64/include/intrcnt.h | 2 | ||||
-rw-r--r-- | sys/vm/vm_meter.c | 30 |
15 files changed, 65 insertions, 15 deletions
diff --git a/sys/alpha/include/intrcnt.h b/sys/alpha/include/intrcnt.h index 440f819..5d2ce0b 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 5d9f8bd..6ca7c7e 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 9fcab85..99f9761 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 b42c348..9f328e9 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 9fcab85..99f9761 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 68b09b0..981b858 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 68b09b0..981b858 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 5d9f8bd..6ca7c7e 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 0000000..aa624e3 --- /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 9fcab85..99f9761 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 b42c348..9f328e9 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 9fcab85..99f9761 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 68b09b0..981b858 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 440f819..5d2ce0b 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 6a80411..8d3b811 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"); |