2 * Copyright (c) 1991 The Regents of the University of California.
5 * This code is derived from software contributed to Berkeley by
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by the University of
19 * California, Berkeley and its contributors.
20 * 4. Neither the name of the University nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * from: @(#)isa.c 7.2 (Berkeley) 5/13/91
37 * $FreeBSD: src/sys/i386/isa/intr_machdep.c,v 1.29.2.5 2001/10/14 06:54:27 luigi Exp $
40 * This file contains an aggregated module marked:
41 * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
42 * All rights reserved.
43 * See the notice for details.
46 #include "opt_auto_eoi.h"
50 #include <sys/param.h>
52 #include <machine/lock.h>
54 #include <sys/systm.h>
55 #include <sys/syslog.h>
56 #include <sys/malloc.h>
57 #include <sys/errno.h>
58 #include <sys/interrupt.h>
59 #include <machine/ipl.h>
60 #include <machine/md_var.h>
61 #include <machine/segments.h>
65 #include <machine/smp.h>
66 #include <machine/smptests.h> /** FAST_HI */
69 #include <pc98/pc98/pc98.h>
70 #include <pc98/pc98/pc98_machdep.h>
71 #include <pc98/pc98/epsonio.h>
73 #include <i386/isa/isa.h>
75 #include <i386/isa/icu.h>
78 #include <isa/isavar.h>
80 #include <i386/isa/intr_machdep.h>
81 #include <sys/interrupt.h>
83 #include <machine/clock.h>
88 #include <i386/isa/mca_machdep.h>
91 /* XXX should be in suitable include files */
93 #define ICU_IMR_OFFSET 2 /* IO_ICU{1,2} + 2 */
96 #define ICU_IMR_OFFSET 1 /* IO_ICU{1,2} + 1 */
102 * This is to accommodate "mixed-mode" programming for
103 * motherboards that don't connect the 8254 to the IO APIC.
108 #define NR_INTRNAMES (1 + ICU_LEN + 2 * ICU_LEN)
110 u_long *intr_countp[ICU_LEN];
111 inthand2_t *intr_handler[ICU_LEN];
112 u_int intr_mask[ICU_LEN];
113 static u_int* intr_mptr[ICU_LEN];
114 void *intr_unit[ICU_LEN];
116 static inthand_t *fastintr[ICU_LEN] = {
117 &IDTVEC(fastintr0), &IDTVEC(fastintr1),
118 &IDTVEC(fastintr2), &IDTVEC(fastintr3),
119 &IDTVEC(fastintr4), &IDTVEC(fastintr5),
120 &IDTVEC(fastintr6), &IDTVEC(fastintr7),
121 &IDTVEC(fastintr8), &IDTVEC(fastintr9),
122 &IDTVEC(fastintr10), &IDTVEC(fastintr11),
123 &IDTVEC(fastintr12), &IDTVEC(fastintr13),
124 &IDTVEC(fastintr14), &IDTVEC(fastintr15),
126 &IDTVEC(fastintr16), &IDTVEC(fastintr17),
127 &IDTVEC(fastintr18), &IDTVEC(fastintr19),
128 &IDTVEC(fastintr20), &IDTVEC(fastintr21),
129 &IDTVEC(fastintr22), &IDTVEC(fastintr23),
133 static inthand_t *slowintr[ICU_LEN] = {
134 &IDTVEC(intr0), &IDTVEC(intr1), &IDTVEC(intr2), &IDTVEC(intr3),
135 &IDTVEC(intr4), &IDTVEC(intr5), &IDTVEC(intr6), &IDTVEC(intr7),
136 &IDTVEC(intr8), &IDTVEC(intr9), &IDTVEC(intr10), &IDTVEC(intr11),
137 &IDTVEC(intr12), &IDTVEC(intr13), &IDTVEC(intr14), &IDTVEC(intr15),
139 &IDTVEC(intr16), &IDTVEC(intr17), &IDTVEC(intr18), &IDTVEC(intr19),
140 &IDTVEC(intr20), &IDTVEC(intr21), &IDTVEC(intr22), &IDTVEC(intr23),
144 static inthand2_t isa_strayintr;
147 #define NMI_PARITY 0x04
148 #define NMI_EPARITY 0x02
150 #define NMI_PARITY (1 << 7)
151 #define NMI_IOCHAN (1 << 6)
152 #define ENMI_WATCHDOG (1 << 7)
153 #define ENMI_BUSTIMER (1 << 6)
154 #define ENMI_IOSTATUS (1 << 5)
158 * Handle a NMI, possibly a machine check.
159 * return true to panic system, false to ignore.
167 int port = inb(0x33);
169 log(LOG_CRIT, "NMI PC98 port = %x\n", port);
170 if (epson_machine_id == 0x20)
171 epson_outb(0xc16, epson_inb(0xc16) | 0x1);
172 if (port & NMI_PARITY) {
173 log(LOG_CRIT, "BASE RAM parity error, likely hardware failure.");
175 } else if (port & NMI_EPARITY) {
176 log(LOG_CRIT, "EXTENDED RAM parity error, likely hardware failure.");
179 log(LOG_CRIT, "\nNMI Resume ??\n");
182 int isa_port = inb(0x61);
183 int eisa_port = inb(0x461);
185 log(LOG_CRIT, "NMI ISA %x, EISA %x\n", isa_port, eisa_port);
187 if (MCA_system && mca_bus_nmi())
191 if (isa_port & NMI_PARITY) {
192 log(LOG_CRIT, "RAM parity error, likely hardware failure.");
196 if (isa_port & NMI_IOCHAN) {
197 log(LOG_CRIT, "I/O channel check, likely hardware failure.");
202 * On a real EISA machine, this will never happen. However it can
203 * happen on ISA machines which implement XT style floating point
204 * error handling (very rare). Save them from a meaningless panic.
206 if (eisa_port == 0xff)
209 if (eisa_port & ENMI_WATCHDOG) {
210 log(LOG_CRIT, "EISA watchdog timer expired, likely hardware failure.");
214 if (eisa_port & ENMI_BUSTIMER) {
215 log(LOG_CRIT, "EISA bus timeout, likely hardware failure.");
219 if (eisa_port & ENMI_IOSTATUS) {
220 log(LOG_CRIT, "EISA I/O port status error.");
228 * Fill in default interrupt table (in case of spuruious interrupt
229 * during configuration of kernel, setup interrupt control unit
237 for (i = 0; i < ICU_LEN; i++)
238 icu_unset(i, (inthand2_t *)NULL);
240 /* initialize 8259's */
243 outb(IO_ICU1, 0x19); /* reset; program device, four bytes */
246 outb(IO_ICU1, 0x11); /* reset; program device, four bytes */
248 outb(IO_ICU1+ICU_IMR_OFFSET, NRSVIDT); /* starting at this vector index */
249 outb(IO_ICU1+ICU_IMR_OFFSET, IRQ_SLAVE); /* slave on line 7 */
252 outb(IO_ICU1+ICU_IMR_OFFSET, 0x1f); /* (master) auto EOI, 8086 mode */
254 outb(IO_ICU1+ICU_IMR_OFFSET, 0x1d); /* (master) 8086 mode */
258 outb(IO_ICU1+ICU_IMR_OFFSET, 2 | 1); /* auto EOI, 8086 mode */
260 outb(IO_ICU1+ICU_IMR_OFFSET, 1); /* 8086 mode */
263 outb(IO_ICU1+ICU_IMR_OFFSET, 0xff); /* leave interrupts masked */
264 outb(IO_ICU1, 0x0a); /* default to IRR on read */
266 outb(IO_ICU1, 0xc0 | (3 - 1)); /* pri order 3-7, 0-2 (com2 first) */
271 outb(IO_ICU2, 0x19); /* reset; program device, four bytes */
274 outb(IO_ICU2, 0x11); /* reset; program device, four bytes */
276 outb(IO_ICU2+ICU_IMR_OFFSET, NRSVIDT+8); /* staring at this vector index */
277 outb(IO_ICU2+ICU_IMR_OFFSET, ICU_SLAVEID); /* my slave id is 7 */
279 outb(IO_ICU2+ICU_IMR_OFFSET,9); /* 8086 mode */
282 outb(IO_ICU2+ICU_IMR_OFFSET, 2 | 1); /* auto EOI, 8086 mode */
284 outb(IO_ICU2+ICU_IMR_OFFSET,1); /* 8086 mode */
287 outb(IO_ICU2+ICU_IMR_OFFSET, 0xff); /* leave interrupts masked */
288 outb(IO_ICU2, 0x0a); /* default to IRR on read */
292 * Caught a stray interrupt, notify
295 isa_strayintr(vcookiep)
298 int intr = (void **)vcookiep - &intr_unit[0];
300 /* DON'T BOTHER FOR NOW! */
301 /* for some reason, we get bursts of intr #7, even if not enabled! */
303 * Well the reason you got bursts of intr #7 is because someone
304 * raised an interrupt line and dropped it before the 8259 could
305 * prioritize it. This is documented in the intel data book. This
306 * means you have BAD hardware! I have changed this so that only
307 * the first 5 get logged, then it quits logging them, and puts
308 * out a special message. rgrimes 3/25/1993
311 * XXX TODO print a different message for #7 if it is for a
312 * glitch. Glitches can be distinguished from real #7's by
313 * testing that the in-service bit is _not_ set. The test
314 * must be done before sending an EOI so it can't be done if
315 * we are using AUTO_EOI_1.
317 if (intrcnt[1 + intr] <= 5)
318 log(LOG_ERR, "stray irq %d\n", intr);
319 if (intrcnt[1 + intr] == 5)
321 "too many stray irq %d's; not logging any more\n", intr);
326 * Return a bitmap of the current interrupt requests. This is 8259-specific
327 * and is only suitable for use at probe time.
337 return ((irr2 << 8) | irr1);
342 update_intr_masks(void)
347 for (intr=0; intr < ICU_LEN; intr ++) {
349 /* no 8259 SLAVE to ignore */
351 if (intr==ICU_SLAVEID) continue; /* ignore 8259 SLAVE output */
353 maskptr = intr_mptr[intr];
356 *maskptr |= SWI_CLOCK_MASK | (1 << intr);
358 if (mask != intr_mask[intr]) {
360 printf ("intr_mask[%2d] old=%08x new=%08x ptr=%p.\n",
361 intr, intr_mask[intr], mask, maskptr);
363 intr_mask[intr]=mask;
372 update_intrname(int intr, char *name)
376 int name_index, off, strayintr;
379 * Initialise strings for bitbucket and stray interrupt counters.
380 * These have statically allocated indices 0 and 1 through ICU_LEN.
382 if (intrnames[0] == '\0') {
383 off = sprintf(intrnames, "???") + 1;
384 for (strayintr = 0; strayintr < ICU_LEN; strayintr++)
385 off += sprintf(intrnames + off, "stray irq%d",
391 if (snprintf(buf, sizeof(buf), "%s irq%d", name, intr) >= sizeof(buf))
395 * Search for `buf' in `intrnames'. In the usual case when it is
396 * not found, append it to the end if there is enough space (the \0
397 * terminator for the previous string, if any, becomes a separator).
399 for (cp = intrnames, name_index = 0;
400 cp != eintrnames && name_index < NR_INTRNAMES;
401 cp += strlen(cp) + 1, name_index++) {
403 if (strlen(buf) >= eintrnames - cp)
408 if (strcmp(cp, buf) == 0)
413 printf("update_intrname: counting %s irq%d as %s\n", name, intr,
417 intr_countp[intr] = &intrcnt[name_index];
421 icu_setup(int intr, inthand2_t *handler, void *arg, u_int *maskptr, int flags)
424 int select; /* the select register is 8 bits */
426 u_int32_t value; /* the window register is 32 bits */
429 u_int mask = (maskptr ? *maskptr : 0);
432 if ((u_int)intr >= ICU_LEN) /* no 8259 SLAVE to ignore */
434 if ((u_int)intr >= ICU_LEN || intr == ICU_SLAVEID)
436 if (intr_handler[intr] != isa_strayintr)
441 intr_handler[intr] = handler;
442 intr_mptr[intr] = maskptr;
443 intr_mask[intr] = mask | SWI_CLOCK_MASK | (1 << intr);
444 intr_unit[intr] = arg;
446 if (flags & INTR_FAST) {
447 vector = TPR_FAST_INTS + intr;
448 setidt(vector, fastintr[intr],
449 SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
452 vector = TPR_SLOW_INTS + intr;
453 #ifdef APIC_INTR_REORDER
454 #ifdef APIC_INTR_HIGHPRI_CLOCK
455 /* XXX: Hack (kludge?) for more accurate clock. */
456 if (intr == apic_8254_intr || intr == 8) {
457 vector = TPR_FAST_INTS + intr;
461 setidt(vector, slowintr[intr],
462 SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
464 #ifdef APIC_INTR_REORDER
465 set_lapic_isrloc(intr, vector);
468 * Reprogram the vector in the IO APIC.
470 if (int_to_apicintpin[intr].ioapic >= 0) {
471 select = int_to_apicintpin[intr].redirindex;
472 value = io_apic_read(int_to_apicintpin[intr].ioapic,
473 select) & ~IOART_INTVEC;
474 io_apic_write(int_to_apicintpin[intr].ioapic,
475 select, value | vector);
478 setidt(ICU_OFFSET + intr,
479 flags & INTR_FAST ? fastintr[intr] : slowintr[intr],
480 SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
489 icu_unset(intr, handler)
495 if ((u_int)intr >= ICU_LEN || handler != intr_handler[intr])
501 intr_countp[intr] = &intrcnt[1 + intr];
502 intr_handler[intr] = isa_strayintr;
503 intr_mptr[intr] = NULL;
504 intr_mask[intr] = HWI_MASK | SWI_MASK;
505 intr_unit[intr] = &intr_unit[intr];
507 /* XXX how do I re-create dvp here? */
508 setidt(flags & INTR_FAST ? TPR_FAST_INTS + intr : TPR_SLOW_INTS + intr,
509 slowintr[intr], SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
511 #ifdef APIC_INTR_REORDER
512 set_lapic_isrloc(intr, ICU_OFFSET + intr);
514 setidt(ICU_OFFSET + intr, slowintr[intr], SDT_SYS386IGT, SEL_KPL,
515 GSEL(GCODE_SEL, SEL_KPL));
522 /* The following notice applies beyond this point in the file */
525 * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
526 * All rights reserved.
528 * Redistribution and use in source and binary forms, with or without
529 * modification, are permitted provided that the following conditions
531 * 1. Redistributions of source code must retain the above copyright
532 * notice unmodified, this list of conditions, and the following
534 * 2. Redistributions in binary form must reproduce the above copyright
535 * notice, this list of conditions and the following disclaimer in the
536 * documentation and/or other materials provided with the distribution.
538 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
539 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
540 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
541 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
542 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
543 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
544 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
545 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
546 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
547 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
549 * $FreeBSD: src/sys/i386/isa/intr_machdep.c,v 1.29.2.5 2001/10/14 06:54:27 luigi Exp $
553 typedef struct intrec {
564 static intrec *intreclist_head[ICU_LEN];
567 * The interrupt multiplexer calls each of the handlers in turn. The
568 * ipl is initially quite low. It is raised as necessary for each call
569 * and lowered after the call. Thus out of order handling is possible
570 * even for interrupts of the same type. This is probably no more
571 * harmful than out of order handling in general (not harmful except
572 * for real time response which we don't support anyway).
580 for (p = arg; p != NULL; p = p->next) {
581 oldspl = splq(p->mask);
582 p->handler(p->argument);
588 find_idesc(unsigned *maskptr, int irq)
590 intrec *p = intreclist_head[irq];
592 while (p && p->maskptr != maskptr)
599 find_pred(intrec *idesc, int irq)
601 intrec **pp = &intreclist_head[irq];
614 * Both the low level handler and the shared interrupt multiplexer
615 * block out further interrupts as set in the handlers "mask", while
616 * the handler is running. In fact *maskptr should be used for this
617 * purpose, but since this requires one more pointer dereference on
618 * each interrupt, we rather bother update "mask" whenever *maskptr
619 * changes. The function "update_masks" should be called **after**
620 * all manipulation of the linked list of interrupt handlers hung
621 * off of intrdec_head[irq] is complete, since the chain of handlers
622 * will both determine the *maskptr values and the instances of mask
623 * that are fixed. This function should be called with the irq for
624 * which a new handler has been add blocked, since the masks may not
625 * yet know about the use of this irq for a device of a certain class.
629 update_mux_masks(void)
632 for (irq = 0; irq < ICU_LEN; irq++) {
633 intrec *idesc = intreclist_head[irq];
634 while (idesc != NULL) {
635 if (idesc->maskptr != NULL) {
636 /* our copy of *maskptr may be stale, refresh */
637 idesc->mask = *idesc->maskptr;
645 update_masks(intrmask_t *maskptr, int irq)
647 intrmask_t mask = 1 << irq;
652 if (find_idesc(maskptr, irq) == NULL) {
653 /* no reference to this maskptr was found in this irq's chain */
656 /* a reference to this maskptr was found in this irq's chain */
659 /* we need to update all values in the intr_mask[irq] array */
661 /* update mask in chains of the interrupt multiplex handler as well */
666 * Add interrupt handler to linked list hung off of intreclist_head[irq]
667 * and install shared interrupt multiplex handler, if necessary
671 add_intrdesc(intrec *idesc)
673 int irq = idesc->intr;
675 intrec *head = intreclist_head[irq];
678 /* first handler for this irq, just install it */
679 if (icu_setup(irq, idesc->handler, idesc->argument,
680 idesc->maskptr, idesc->flags) != 0)
683 update_intrname(irq, idesc->name);
685 intreclist_head[irq] = idesc;
687 if ((idesc->flags & INTR_EXCL) != 0
688 || (head->flags & INTR_EXCL) != 0) {
690 * can't append new handler, if either list head or
691 * new handler do not allow interrupts to be shared
694 printf("\tdevice combination doesn't support "
695 "shared irq%d\n", irq);
698 if (head->next == NULL) {
700 * second handler for this irq, replace device driver's
701 * handler by shared interrupt multiplexer function
703 icu_unset(irq, head->handler);
704 if (icu_setup(irq, intr_mux, head, 0, 0) != 0)
707 printf("\tusing shared irq%d.\n", irq);
708 update_intrname(irq, "mux");
710 /* just append to the end of the chain */
711 while (head->next != NULL)
715 update_masks(idesc->maskptr, irq);
720 * Create and activate an interrupt handler descriptor data structure.
722 * The dev_instance pointer is required for resource management, and will
723 * only be passed through to resource_claim().
725 * There will be functions that derive a driver and unit name from a
726 * dev_instance variable, and those functions will be used to maintain the
727 * interrupt counter label array referenced by systat and vmstat to report
728 * device interrupt rates (->update_intrlabels).
730 * Add the interrupt handler descriptor data structure created by an
731 * earlier call of create_intr() to the linked list for its irq and
732 * adjust the interrupt masks if necessary.
734 * WARNING: This is an internal function and not to be used by device
735 * drivers. It is subject to change without notice.
739 inthand_add(const char *name, int irq, inthand2_t handler, void *arg,
740 intrmask_t *maskptr, int flags)
746 if (ICU_LEN > 8 * sizeof *maskptr) {
747 printf("create_intr: ICU_LEN of %d too high for %d bit intrmask\n",
748 ICU_LEN, 8 * sizeof *maskptr);
751 if ((unsigned)irq >= ICU_LEN) {
752 printf("create_intr: requested irq%d too high, limit is %d\n",
757 idesc = malloc(sizeof *idesc, M_DEVBUF, M_WAITOK);
760 bzero(idesc, sizeof *idesc);
764 idesc->name = malloc(strlen(name) + 1, M_DEVBUF, M_WAITOK);
765 if (idesc->name == NULL) {
766 free(idesc, M_DEVBUF);
769 strcpy(idesc->name, name);
771 idesc->handler = handler;
772 idesc->argument = arg;
773 idesc->maskptr = maskptr;
775 idesc->flags = flags;
778 oldspl = splq(1 << irq);
780 /* add irq to class selected by maskptr */
781 errcode = add_intrdesc(idesc);
786 printf("\tintr_connect(irq%d) failed, result=%d\n",
788 free(idesc->name, M_DEVBUF);
789 free(idesc, M_DEVBUF);
797 * Deactivate and remove the interrupt handler descriptor data connected
798 * created by an earlier call of intr_connect() from the linked list and
799 * adjust theinterrupt masks if necessary.
801 * Return the memory held by the interrupt handler descriptor data structure
802 * to the system. Make sure, the handler is not actively used anymore, before.
806 inthand_remove(intrec *idesc)
808 intrec **hook, *head;
818 /* find pointer that keeps the reference to this interrupt descriptor */
819 hook = find_pred(idesc, irq);
823 /* make copy of original list head, the line after may overwrite it */
824 head = intreclist_head[irq];
826 /* unlink: make predecessor point to idesc->next instead of to idesc */
829 /* now check whether the element we removed was the list head */
832 oldspl = splq(1 << irq);
834 /* check whether the new list head is the only element on list */
835 head = intreclist_head[irq];
837 icu_unset(irq, intr_mux);
838 if (head->next != NULL) {
839 /* install the multiplex handler with new list head as argument */
840 errcode = icu_setup(irq, intr_mux, head, 0, 0);
842 update_intrname(irq, NULL);
844 /* install the one remaining handler for this irq */
845 errcode = icu_setup(irq, head->handler,
847 head->maskptr, head->flags);
849 update_intrname(irq, head->name);
852 /* revert to old handler, eg: strayintr */
853 icu_unset(irq, idesc->handler);
857 update_masks(idesc->maskptr, irq);
858 free(idesc, M_DEVBUF);