diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-02-20 04:36:20 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-02-20 04:36:20 +0000 |
commit | e1db5c4a473d067a236a9deb6aaf0d4b49037ab0 (patch) | |
tree | d99a015cd4bf0a19ed04cd028e4c95a554f20949 /sys/arch/i386 | |
parent | 5de6545ee7bb75bb0895f89e1e1086f2d570db11 (diff) |
Pass device name to interrupt establish routines so it can be recorded in
the device interrupt chain structures (isa, pci)
Move interrupt chain structure definition to <machine/psl.h> so vmstat can
get at it (i386)
Remove hack to count interrupts the old way (i386)
Diffstat (limited to 'sys/arch/i386')
-rw-r--r-- | sys/arch/i386/include/psl.h | 15 | ||||
-rw-r--r-- | sys/arch/i386/isa/clock.c | 2 | ||||
-rw-r--r-- | sys/arch/i386/isa/fd.c | 2 | ||||
-rw-r--r-- | sys/arch/i386/isa/isa_machdep.c | 12 | ||||
-rw-r--r-- | sys/arch/i386/isa/isa_machdep.h | 15 | ||||
-rw-r--r-- | sys/arch/i386/isa/lms.c | 2 | ||||
-rw-r--r-- | sys/arch/i386/isa/mms.c | 2 | ||||
-rw-r--r-- | sys/arch/i386/isa/npx.c | 2 | ||||
-rw-r--r-- | sys/arch/i386/isa/pccons.c | 2 | ||||
-rw-r--r-- | sys/arch/i386/isa/pcvt/pcvt_drv.c | 2 | ||||
-rw-r--r-- | sys/arch/i386/isa/pms.c | 2 | ||||
-rw-r--r-- | sys/arch/i386/isa/vector.s | 21 | ||||
-rw-r--r-- | sys/arch/i386/pci/pci_machdep.c | 5 |
13 files changed, 35 insertions, 49 deletions
diff --git a/sys/arch/i386/include/psl.h b/sys/arch/i386/include/psl.h index 3d527e12be5..504708dfe52 100644 --- a/sys/arch/i386/include/psl.h +++ b/sys/arch/i386/include/psl.h @@ -99,6 +99,21 @@ #ifndef LOCORE +/* + * Interrupt handler chains. isa_intr_establish() inserts a handler into + * the list. The handler is called with its (single) argument. + */ + +struct intrhand { + int (*ih_fun)(); + void *ih_arg; + u_long ih_count; + struct intrhand *ih_next; + int ih_level; + int ih_irq; + char *ih_what; +}; + volatile int cpl, ipending, astpending; int imask[5]; diff --git a/sys/arch/i386/isa/clock.c b/sys/arch/i386/isa/clock.c index 9f5fdea7dcb..5cacb8cc9fc 100644 --- a/sys/arch/i386/isa/clock.c +++ b/sys/arch/i386/isa/clock.c @@ -311,7 +311,7 @@ cpu_initclocks() * XXX If you're doing strange things with multiple clocks, you might * want to keep track of clock handlers. */ - (void)isa_intr_establish(0, IST_PULSE, IPL_CLOCK, clockintr, 0); + (void)isa_intr_establish(0, IST_PULSE, IPL_CLOCK, clockintr, 0, "clock"); } void diff --git a/sys/arch/i386/isa/fd.c b/sys/arch/i386/isa/fd.c index 2f8e7ae732e..90ac3987c1d 100644 --- a/sys/arch/i386/isa/fd.c +++ b/sys/arch/i386/isa/fd.c @@ -308,7 +308,7 @@ fdcattach(parent, self, aux) isa_establish(&fdc->sc_id, &fdc->sc_dev); #endif fdc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_BIO, fdcintr, - fdc); + fdc, fdc->sc_dev.dv_xname); /* * The NVRAM info only tells us about the first two disks on the diff --git a/sys/arch/i386/isa/isa_machdep.c b/sys/arch/i386/isa/isa_machdep.c index 79877647a6c..0660042436d 100644 --- a/sys/arch/i386/isa/isa_machdep.c +++ b/sys/arch/i386/isa/isa_machdep.c @@ -145,6 +145,8 @@ isa_nmi() return(0); } +int intrstray[ICU_LEN]; + /* * Caught a stray interrupt, notify */ @@ -152,17 +154,15 @@ void isa_strayintr(irq) int irq; { - static u_long strays; - /* * Stray interrupts on irq 7 occur when an interrupt line is raised * and then lowered before the CPU acknowledges it. This generally * means either the device is screwed or something is cli'ing too * long and it's timing out. */ - if (++strays <= 5) + if (intrstray[irq]++ <= 5) log(LOG_ERR, "stray interrupt %d%s\n", irq, - strays >= 5 ? "; stopped logging" : ""); + intrstray[irq] >= 5 ? "; stopped logging" : ""); } int fastvec; @@ -249,12 +249,13 @@ fakeintr(arg) * XXX PRONE TO RACE CONDITIONS, UGLY, 'INTERESTING' INSERTION ALGORITHM. */ void * -isa_intr_establish(irq, type, level, ih_fun, ih_arg) +isa_intr_establish(irq, type, level, ih_fun, ih_arg, ih_what) int irq; int type; int level; int (*ih_fun) __P((void *)); void *ih_arg; + char *ih_what; { struct intrhand **p, *q, *ih; static struct intrhand fakehand = {fakeintr}; @@ -308,6 +309,7 @@ isa_intr_establish(irq, type, level, ih_fun, ih_arg) ih->ih_next = NULL; ih->ih_level = level; ih->ih_irq = irq; + ih->ih_what = ih_what; *p = ih; return (ih); diff --git a/sys/arch/i386/isa/isa_machdep.h b/sys/arch/i386/isa/isa_machdep.h index 495653d9b65..56f956f8c2f 100644 --- a/sys/arch/i386/isa/isa_machdep.h +++ b/sys/arch/i386/isa/isa_machdep.h @@ -78,21 +78,6 @@ /* - * Interrupt handler chains. isa_intr_establish() inserts a handler into - * the list. The handler is called with its (single) argument. - */ - -struct intrhand { - int (*ih_fun)(); - void *ih_arg; - u_long ih_count; - struct intrhand *ih_next; - int ih_level; - int ih_irq; -}; - - -/* * ISA DMA bounce buffers. * XXX should be made partially machine- and bus-mapping-independent. * diff --git a/sys/arch/i386/isa/lms.c b/sys/arch/i386/isa/lms.c index 4cacafaa2b9..151fc590264 100644 --- a/sys/arch/i386/isa/lms.c +++ b/sys/arch/i386/isa/lms.c @@ -120,7 +120,7 @@ lmsattach(parent, self, aux) sc->sc_state = 0; sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_PULSE, IPL_TTY, lmsintr, - sc); + sc, sc->sc_dev.dv_xname); } int diff --git a/sys/arch/i386/isa/mms.c b/sys/arch/i386/isa/mms.c index 7fe4586036d..ef2fa5e1d69 100644 --- a/sys/arch/i386/isa/mms.c +++ b/sys/arch/i386/isa/mms.c @@ -110,7 +110,7 @@ mmsattach(parent, self, aux) sc->sc_state = 0; sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_PULSE, IPL_TTY, mmsintr, - sc); + sc, sc->sc_dev.dv_xname); } int diff --git a/sys/arch/i386/isa/npx.c b/sys/arch/i386/isa/npx.c index 3ec32a58889..9b58f0e8313 100644 --- a/sys/arch/i386/isa/npx.c +++ b/sys/arch/i386/isa/npx.c @@ -326,7 +326,7 @@ npxattach(parent, self, aux) printf("\n"); lcr0(rcr0() & ~CR0_NE); sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_NONE, - npxintr, 0); + npxintr, 0, "npx"); break; case NPX_EXCEPTION: printf(": using exception 16\n"); diff --git a/sys/arch/i386/isa/pccons.c b/sys/arch/i386/isa/pccons.c index 37c5bad0994..73277988ed5 100644 --- a/sys/arch/i386/isa/pccons.c +++ b/sys/arch/i386/isa/pccons.c @@ -471,7 +471,7 @@ pcattach(parent, self, aux) do_async_update(1); sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_TTY, pcintr, - sc); + sc, sc->sc_dev.dv_xname); } int diff --git a/sys/arch/i386/isa/pcvt/pcvt_drv.c b/sys/arch/i386/isa/pcvt/pcvt_drv.c index 220b4465b3a..0f71a01d6fd 100644 --- a/sys/arch/i386/isa/pcvt/pcvt_drv.c +++ b/sys/arch/i386/isa/pcvt/pcvt_drv.c @@ -336,7 +336,7 @@ pcattach(struct isa_device *dev) #if PCVT_NETBSD > 101 sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_TTY, pcintr, - (void *)0); + (void *)0, sc->sc_dev.dv_xname); #else /* PCVT_NETBSD > 100 */ vthand.ih_fun = pcrint; vthand.ih_arg = 0; diff --git a/sys/arch/i386/isa/pms.c b/sys/arch/i386/isa/pms.c index b9d38c02ca8..9cc0a6407ce 100644 --- a/sys/arch/i386/isa/pms.c +++ b/sys/arch/i386/isa/pms.c @@ -193,7 +193,7 @@ pmsattach(parent, self, aux) sc->sc_state = 0; sc->sc_ih = isa_intr_establish(ia->ia_irq, IST_EDGE, IPL_TTY, pmsintr, - sc); + sc, sc->sc_dev.dv_xname); } int diff --git a/sys/arch/i386/isa/vector.s b/sys/arch/i386/isa/vector.s index c6ec741a736..ef282214161 100644 --- a/sys/arch/i386/isa/vector.s +++ b/sys/arch/i386/isa/vector.s @@ -161,7 +161,6 @@ IDTVEC(fast/**/irq_num) ;\ ack(irq_num) ;\ addl $4,%esp ;\ incl _cnt+V_INTR /* statistical info */ ;\ - incl _intrcnt + (irq_num) * 4 ;\ popl %es ;\ popl %ds ;\ popl %edx ;\ @@ -219,7 +218,6 @@ _Xintr/**/irq_num/**/: ;\ testb $IRQ_BIT(irq_num),_cpl + IRQ_BYTE(irq_num) ;\ jnz _Xhold/**/irq_num /* currently masked; hold it */ ;\ _Xresume/**/irq_num/**/: ;\ - incl _intrcnt + (irq_num) * 4 ;\ movl _cpl,%eax /* cpl to restore on exit */ ;\ pushl %eax ;\ orl _intrmask + (irq_num) * 4,%eax ;\ @@ -332,27 +330,12 @@ IDTVEC(recurse) /* Some bogus data, to keep vmstat happy, for now. */ .globl _intrcnt, _eintrcnt _intrcnt: - .space ICU_LEN * 4 + .long 0 _eintrcnt: .globl _intrnames, _eintrnames _intrnames: - .asciz "irq 0" - .asciz "irq 1" - .asciz "irq 2" - .asciz "irq 3" - .asciz "irq 4" - .asciz "irq 5" - .asciz "irq 6" - .asciz "irq 7" - .asciz "irq 8" - .asciz "irq 9" - .asciz "irq 10" - .asciz "irq 11" - .asciz "irq 12" - .asciz "irq 13" - .asciz "irq 14" - .asciz "irq 15" + .long 0 _eintrnames: .text diff --git a/sys/arch/i386/pci/pci_machdep.c b/sys/arch/i386/pci/pci_machdep.c index 404fe2e1c54..b84cf3c2083 100644 --- a/sys/arch/i386/pci/pci_machdep.c +++ b/sys/arch/i386/pci/pci_machdep.c @@ -373,11 +373,12 @@ pci_map_mem(tag, reg, vap, pap) } void * -pci_map_int(tag, level, func, arg) +pci_map_int(tag, level, func, arg, what) pcitag_t tag; int level; int (*func) __P((void *)); void *arg; + char *what; { pcireg_t data; int pin, line; @@ -429,5 +430,5 @@ pci_map_int(tag, level, func, arg) printf("pci_map_int: pin %c mapped to line %d\n", '@' + pin, line); #endif - return isa_intr_establish(line, IST_LEVEL, level, func, arg); + return isa_intr_establish(line, IST_LEVEL, level, func, arg, what); } |