Export intrnames and intrcnt as sysctls (hw.nintr, hw.intrnames and

hw.intrcnt).

Approved by:	rwatson
This commit is contained in:
Thomas Moestl 2001-03-23 03:45:17 +00:00
parent ea846c773d
commit 368d2edce4
15 changed files with 65 additions and 15 deletions

View File

@ -75,5 +75,7 @@
#ifdef _KERNEL
#ifndef _LOCORE
extern volatile long intrcnt[];
extern char intrnames[];
extern char eintrnames[];
#endif
#endif

View File

@ -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

View File

@ -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)

View File

@ -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[];

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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[];

View File

@ -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)

View File

@ -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

View File

@ -75,5 +75,7 @@
#ifdef _KERNEL
#ifndef _LOCORE
extern volatile long intrcnt[];
extern char intrnames[];
extern char eintrnames[];
#endif
#endif

View File

@ -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");