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 $
38 * $DragonFly: src/sys/i386/isa/Attic/intr_machdep.c,v 1.2 2003/06/17 04:28:37 dillon Exp $
41 * This file contains an aggregated module marked:
42 * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
43 * All rights reserved.
44 * See the notice for details.
47 #include "opt_auto_eoi.h"
51 #include <sys/param.h>
53 #include <machine/lock.h>
55 #include <sys/systm.h>
56 #include <sys/syslog.h>
57 #include <sys/malloc.h>
58 #include <sys/errno.h>
59 #include <sys/interrupt.h>
60 #include <machine/ipl.h>
61 #include <machine/md_var.h>
62 #include <machine/segments.h>
66 #include <machine/smp.h>
67 #include <machine/smptests.h> /** FAST_HI */
70 #include <pc98/pc98/pc98.h>
71 #include <pc98/pc98/pc98_machdep.h>
72 #include <pc98/pc98/epsonio.h>
74 #include <i386/isa/isa.h>
76 #include <i386/isa/icu.h>
79 #include <isa/isavar.h>
81 #include <i386/isa/intr_machdep.h>
82 #include <sys/interrupt.h>
84 #include <machine/clock.h>
89 #include <i386/isa/mca_machdep.h>
92 /* XXX should be in suitable include files */
94 #define ICU_IMR_OFFSET 2 /* IO_ICU{1,2} + 2 */
97 #define ICU_IMR_OFFSET 1 /* IO_ICU{1,2} + 1 */
103 * This is to accommodate "mixed-mode" programming for
104 * motherboards that don't connect the 8254 to the IO APIC.
109 #define NR_INTRNAMES (1 + ICU_LEN + 2 * ICU_LEN)
111 u_long *intr_countp[ICU_LEN];
112 inthand2_t *intr_handler[ICU_LEN];
113 u_int intr_mask[ICU_LEN];
114 static u_int* intr_mptr[ICU_LEN];
115 void *intr_unit[ICU_LEN];
117 static inthand_t *fastintr[ICU_LEN] = {
118 &IDTVEC(fastintr0), &IDTVEC(fastintr1),
119 &IDTVEC(fastintr2), &IDTVEC(fastintr3),
120 &IDTVEC(fastintr4), &IDTVEC(fastintr5),
121 &IDTVEC(fastintr6), &IDTVEC(fastintr7),
122 &IDTVEC(fastintr8), &IDTVEC(fastintr9),
123 &IDTVEC(fastintr10), &IDTVEC(fastintr11),
124 &IDTVEC(fastintr12), &IDTVEC(fastintr13),
125 &IDTVEC(fastintr14), &IDTVEC(fastintr15),
127 &IDTVEC(fastintr16), &IDTVEC(fastintr17),
128 &IDTVEC(fastintr18), &IDTVEC(fastintr19),
129 &IDTVEC(fastintr20), &IDTVEC(fastintr21),
130 &IDTVEC(fastintr22), &IDTVEC(fastintr23),
134 static inthand_t *slowintr[ICU_LEN] = {
135 &IDTVEC(intr0), &IDTVEC(intr1), &IDTVEC(intr2), &IDTVEC(intr3),
136 &IDTVEC(intr4), &IDTVEC(intr5), &IDTVEC(intr6), &IDTVEC(intr7),
137 &IDTVEC(intr8), &IDTVEC(intr9), &IDTVEC(intr10), &IDTVEC(intr11),
138 &IDTVEC(intr12), &IDTVEC(intr13), &IDTVEC(intr14), &IDTVEC(intr15),
140 &IDTVEC(intr16), &IDTVEC(intr17), &IDTVEC(intr18), &IDTVEC(intr19),
141 &IDTVEC(intr20), &IDTVEC(intr21), &IDTVEC(intr22), &IDTVEC(intr23),
145 static inthand2_t isa_strayintr;
148 #define NMI_PARITY 0x04
149 #define NMI_EPARITY 0x02
151 #define NMI_PARITY (1 << 7)
152 #define NMI_IOCHAN (1 << 6)
153 #define ENMI_WATCHDOG (1 << 7)
154 #define ENMI_BUSTIMER (1 << 6)
155 #define ENMI_IOSTATUS (1 << 5)
159 * Handle a NMI, possibly a machine check.
160 * return true to panic system, false to ignore.
168 int port = inb(0x33);
170 log(LOG_CRIT, "NMI PC98 port = %x\n", port);
171 if (epson_machine_id == 0x20)
172 epson_outb(0xc16, epson_inb(0xc16) | 0x1);
173 if (port & NMI_PARITY) {
174 log(LOG_CRIT, "BASE RAM parity error, likely hardware failure.");
176 } else if (port & NMI_EPARITY) {
177 log(LOG_CRIT, "EXTENDED RAM parity error, likely hardware failure.");
180 log(LOG_CRIT, "\nNMI Resume ??\n");
183 int isa_port = inb(0x61);
184 int eisa_port = inb(0x461);
186 log(LOG_CRIT, "NMI ISA %x, EISA %x\n", isa_port, eisa_port);
188 if (MCA_system && mca_bus_nmi())
192 if (isa_port & NMI_PARITY) {
193 log(LOG_CRIT, "RAM parity error, likely hardware failure.");
197 if (isa_port & NMI_IOCHAN) {
198 log(LOG_CRIT, "I/O channel check, likely hardware failure.");
203 * On a real EISA machine, this will never happen. However it can
204 * happen on ISA machines which implement XT style floating point
205 * error handling (very rare). Save them from a meaningless panic.
207 if (eisa_port == 0xff)
210 if (eisa_port & ENMI_WATCHDOG) {
211 log(LOG_CRIT, "EISA watchdog timer expired, likely hardware failure.");
215 if (eisa_port & ENMI_BUSTIMER) {
216 log(LOG_CRIT, "EISA bus timeout, likely hardware failure.");
220 if (eisa_port & ENMI_IOSTATUS) {
221 log(LOG_CRIT, "EISA I/O port status error.");
229 * Fill in default interrupt table (in case of spuruious interrupt
230 * during configuration of kernel, setup interrupt control unit
238 for (i = 0; i < ICU_LEN; i++)
239 icu_unset(i, (inthand2_t *)NULL);
241 /* initialize 8259's */
244 outb(IO_ICU1, 0x19); /* reset; program device, four bytes */
247 outb(IO_ICU1, 0x11); /* reset; program device, four bytes */
249 outb(IO_ICU1+ICU_IMR_OFFSET, NRSVIDT); /* starting at this vector index */
250 outb(IO_ICU1+ICU_IMR_OFFSET, IRQ_SLAVE); /* slave on line 7 */
253 outb(IO_ICU1+ICU_IMR_OFFSET, 0x1f); /* (master) auto EOI, 8086 mode */
255 outb(IO_ICU1+ICU_IMR_OFFSET, 0x1d); /* (master) 8086 mode */
259 outb(IO_ICU1+ICU_IMR_OFFSET, 2 | 1); /* auto EOI, 8086 mode */
261 outb(IO_ICU1+ICU_IMR_OFFSET, 1); /* 8086 mode */
264 outb(IO_ICU1+ICU_IMR_OFFSET, 0xff); /* leave interrupts masked */
265 outb(IO_ICU1, 0x0a); /* default to IRR on read */
267 outb(IO_ICU1, 0xc0 | (3 - 1)); /* pri order 3-7, 0-2 (com2 first) */
272 outb(IO_ICU2, 0x19); /* reset; program device, four bytes */
275 outb(IO_ICU2, 0x11); /* reset; program device, four bytes */
277 outb(IO_ICU2+ICU_IMR_OFFSET, NRSVIDT+8); /* staring at this vector index */
278 outb(IO_ICU2+ICU_IMR_OFFSET, ICU_SLAVEID); /* my slave id is 7 */
280 outb(IO_ICU2+ICU_IMR_OFFSET,9); /* 8086 mode */
283 outb(IO_ICU2+ICU_IMR_OFFSET, 2 | 1); /* auto EOI, 8086 mode */
285 outb(IO_ICU2+ICU_IMR_OFFSET,1); /* 8086 mode */
288 outb(IO_ICU2+ICU_IMR_OFFSET, 0xff); /* leave interrupts masked */
289 outb(IO_ICU2, 0x0a); /* default to IRR on read */
293 * Caught a stray interrupt, notify
296 isa_strayintr(vcookiep)
299 int intr = (void **)vcookiep - &intr_unit[0];
301 /* DON'T BOTHER FOR NOW! */
302 /* for some reason, we get bursts of intr #7, even if not enabled! */
304 * Well the reason you got bursts of intr #7 is because someone
305 * raised an interrupt line and dropped it before the 8259 could
306 * prioritize it. This is documented in the intel data book. This
307 * means you have BAD hardware! I have changed this so that only
308 * the first 5 get logged, then it quits logging them, and puts
309 * out a special message. rgrimes 3/25/1993
312 * XXX TODO print a different message for #7 if it is for a
313 * glitch. Glitches can be distinguished from real #7's by
314 * testing that the in-service bit is _not_ set. The test
315 * must be done before sending an EOI so it can't be done if
316 * we are using AUTO_EOI_1.
318 if (intrcnt[1 + intr] <= 5)
319 log(LOG_ERR, "stray irq %d\n", intr);
320 if (intrcnt[1 + intr] == 5)
322 "too many stray irq %d's; not logging any more\n", intr);
327 * Return a bitmap of the current interrupt requests. This is 8259-specific
328 * and is only suitable for use at probe time.
338 return ((irr2 << 8) | irr1);
343 update_intr_masks(void)
348 for (intr=0; intr < ICU_LEN; intr ++) {
350 /* no 8259 SLAVE to ignore */
352 if (intr==ICU_SLAVEID) continue; /* ignore 8259 SLAVE output */
354 maskptr = intr_mptr[intr];
357 *maskptr |= SWI_CLOCK_MASK | (1 << intr);
359 if (mask != intr_mask[intr]) {
361 printf ("intr_mask[%2d] old=%08x new=%08x ptr=%p.\n",
362 intr, intr_mask[intr], mask, maskptr);
364 intr_mask[intr]=mask;
373 update_intrname(int intr, char *name)
377 int name_index, off, strayintr;
380 * Initialise strings for bitbucket and stray interrupt counters.
381 * These have statically allocated indices 0 and 1 through ICU_LEN.
383 if (intrnames[0] == '\0') {
384 off = sprintf(intrnames, "???") + 1;
385 for (strayintr = 0; strayintr < ICU_LEN; strayintr++)
386 off += sprintf(intrnames + off, "stray irq%d",
392 if (snprintf(buf, sizeof(buf), "%s irq%d", name, intr) >= sizeof(buf))
396 * Search for `buf' in `intrnames'. In the usual case when it is
397 * not found, append it to the end if there is enough space (the \0
398 * terminator for the previous string, if any, becomes a separator).
400 for (cp = intrnames, name_index = 0;
401 cp != eintrnames && name_index < NR_INTRNAMES;
402 cp += strlen(cp) + 1, name_index++) {
404 if (strlen(buf) >= eintrnames - cp)
409 if (strcmp(cp, buf) == 0)
414 printf("update_intrname: counting %s irq%d as %s\n", name, intr,
418 intr_countp[intr] = &intrcnt[name_index];
422 icu_setup(int intr, inthand2_t *handler, void *arg, u_int *maskptr, int flags)
425 int select; /* the select register is 8 bits */
427 u_int32_t value; /* the window register is 32 bits */
430 u_int mask = (maskptr ? *maskptr : 0);
433 if ((u_int)intr >= ICU_LEN) /* no 8259 SLAVE to ignore */
435 if ((u_int)intr >= ICU_LEN || intr == ICU_SLAVEID)
437 if (intr_handler[intr] != isa_strayintr)
442 intr_handler[intr] = handler;
443 intr_mptr[intr] = maskptr;
444 intr_mask[intr] = mask | SWI_CLOCK_MASK | (1 << intr);
445 intr_unit[intr] = arg;
447 if (flags & INTR_FAST) {
448 vector = TPR_FAST_INTS + intr;
449 setidt(vector, fastintr[intr],
450 SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
453 vector = TPR_SLOW_INTS + intr;
454 #ifdef APIC_INTR_REORDER
455 #ifdef APIC_INTR_HIGHPRI_CLOCK
456 /* XXX: Hack (kludge?) for more accurate clock. */
457 if (intr == apic_8254_intr || intr == 8) {
458 vector = TPR_FAST_INTS + intr;
462 setidt(vector, slowintr[intr],
463 SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
465 #ifdef APIC_INTR_REORDER
466 set_lapic_isrloc(intr, vector);
469 * Reprogram the vector in the IO APIC.
471 if (int_to_apicintpin[intr].ioapic >= 0) {
472 select = int_to_apicintpin[intr].redirindex;
473 value = io_apic_read(int_to_apicintpin[intr].ioapic,
474 select) & ~IOART_INTVEC;
475 io_apic_write(int_to_apicintpin[intr].ioapic,
476 select, value | vector);
479 setidt(ICU_OFFSET + intr,
480 flags & INTR_FAST ? fastintr[intr] : slowintr[intr],
481 SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
490 icu_unset(intr, handler)
496 if ((u_int)intr >= ICU_LEN || handler != intr_handler[intr])
502 intr_countp[intr] = &intrcnt[1 + intr];
503 intr_handler[intr] = isa_strayintr;
504 intr_mptr[intr] = NULL;
505 intr_mask[intr] = HWI_MASK | SWI_MASK;
506 intr_unit[intr] = &intr_unit[intr];
508 /* XXX how do I re-create dvp here? */
509 setidt(flags & INTR_FAST ? TPR_FAST_INTS + intr : TPR_SLOW_INTS + intr,
510 slowintr[intr], SDT_SYS386IGT, SEL_KPL, GSEL(GCODE_SEL, SEL_KPL));
512 #ifdef APIC_INTR_REORDER
513 set_lapic_isrloc(intr, ICU_OFFSET + intr);
515 setidt(ICU_OFFSET + intr, slowintr[intr], SDT_SYS386IGT, SEL_KPL,
516 GSEL(GCODE_SEL, SEL_KPL));
523 /* The following notice applies beyond this point in the file */
526 * Copyright (c) 1997, Stefan Esser <se@freebsd.org>
527 * All rights reserved.
529 * Redistribution and use in source and binary forms, with or without
530 * modification, are permitted provided that the following conditions
532 * 1. Redistributions of source code must retain the above copyright
533 * notice unmodified, this list of conditions, and the following
535 * 2. Redistributions in binary form must reproduce the above copyright
536 * notice, this list of conditions and the following disclaimer in the
537 * documentation and/or other materials provided with the distribution.
539 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
540 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
541 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
542 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
543 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
544 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
545 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
546 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
547 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
548 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
550 * $FreeBSD: src/sys/i386/isa/intr_machdep.c,v 1.29.2.5 2001/10/14 06:54:27 luigi Exp $
554 typedef struct intrec {
565 static intrec *intreclist_head[ICU_LEN];
568 * The interrupt multiplexer calls each of the handlers in turn. The
569 * ipl is initially quite low. It is raised as necessary for each call
570 * and lowered after the call. Thus out of order handling is possible
571 * even for interrupts of the same type. This is probably no more
572 * harmful than out of order handling in general (not harmful except
573 * for real time response which we don't support anyway).
581 for (p = arg; p != NULL; p = p->next) {
582 oldspl = splq(p->mask);
583 p->handler(p->argument);
589 find_idesc(unsigned *maskptr, int irq)
591 intrec *p = intreclist_head[irq];
593 while (p && p->maskptr != maskptr)
600 find_pred(intrec *idesc, int irq)
602 intrec **pp = &intreclist_head[irq];
615 * Both the low level handler and the shared interrupt multiplexer
616 * block out further interrupts as set in the handlers "mask", while
617 * the handler is running. In fact *maskptr should be used for this
618 * purpose, but since this requires one more pointer dereference on
619 * each interrupt, we rather bother update "mask" whenever *maskptr
620 * changes. The function "update_masks" should be called **after**
621 * all manipulation of the linked list of interrupt handlers hung
622 * off of intrdec_head[irq] is complete, since the chain of handlers
623 * will both determine the *maskptr values and the instances of mask
624 * that are fixed. This function should be called with the irq for
625 * which a new handler has been add blocked, since the masks may not
626 * yet know about the use of this irq for a device of a certain class.
630 update_mux_masks(void)
633 for (irq = 0; irq < ICU_LEN; irq++) {
634 intrec *idesc = intreclist_head[irq];
635 while (idesc != NULL) {
636 if (idesc->maskptr != NULL) {
637 /* our copy of *maskptr may be stale, refresh */
638 idesc->mask = *idesc->maskptr;
646 update_masks(intrmask_t *maskptr, int irq)
648 intrmask_t mask = 1 << irq;
653 if (find_idesc(maskptr, irq) == NULL) {
654 /* no reference to this maskptr was found in this irq's chain */
657 /* a reference to this maskptr was found in this irq's chain */
660 /* we need to update all values in the intr_mask[irq] array */
662 /* update mask in chains of the interrupt multiplex handler as well */
667 * Add interrupt handler to linked list hung off of intreclist_head[irq]
668 * and install shared interrupt multiplex handler, if necessary
672 add_intrdesc(intrec *idesc)
674 int irq = idesc->intr;
676 intrec *head = intreclist_head[irq];
679 /* first handler for this irq, just install it */
680 if (icu_setup(irq, idesc->handler, idesc->argument,
681 idesc->maskptr, idesc->flags) != 0)
684 update_intrname(irq, idesc->name);
686 intreclist_head[irq] = idesc;
688 if ((idesc->flags & INTR_EXCL) != 0
689 || (head->flags & INTR_EXCL) != 0) {
691 * can't append new handler, if either list head or
692 * new handler do not allow interrupts to be shared
695 printf("\tdevice combination doesn't support "
696 "shared irq%d\n", irq);
699 if (head->next == NULL) {
701 * second handler for this irq, replace device driver's
702 * handler by shared interrupt multiplexer function
704 icu_unset(irq, head->handler);
705 if (icu_setup(irq, intr_mux, head, 0, 0) != 0)
708 printf("\tusing shared irq%d.\n", irq);
709 update_intrname(irq, "mux");
711 /* just append to the end of the chain */
712 while (head->next != NULL)
716 update_masks(idesc->maskptr, irq);
721 * Create and activate an interrupt handler descriptor data structure.
723 * The dev_instance pointer is required for resource management, and will
724 * only be passed through to resource_claim().
726 * There will be functions that derive a driver and unit name from a
727 * dev_instance variable, and those functions will be used to maintain the
728 * interrupt counter label array referenced by systat and vmstat to report
729 * device interrupt rates (->update_intrlabels).
731 * Add the interrupt handler descriptor data structure created by an
732 * earlier call of create_intr() to the linked list for its irq and
733 * adjust the interrupt masks if necessary.
735 * WARNING: This is an internal function and not to be used by device
736 * drivers. It is subject to change without notice.
740 inthand_add(const char *name, int irq, inthand2_t handler, void *arg,
741 intrmask_t *maskptr, int flags)
747 if (ICU_LEN > 8 * sizeof *maskptr) {
748 printf("create_intr: ICU_LEN of %d too high for %d bit intrmask\n",
749 ICU_LEN, 8 * sizeof *maskptr);
752 if ((unsigned)irq >= ICU_LEN) {
753 printf("create_intr: requested irq%d too high, limit is %d\n",
758 idesc = malloc(sizeof *idesc, M_DEVBUF, M_WAITOK);
761 bzero(idesc, sizeof *idesc);
765 idesc->name = malloc(strlen(name) + 1, M_DEVBUF, M_WAITOK);
766 if (idesc->name == NULL) {
767 free(idesc, M_DEVBUF);
770 strcpy(idesc->name, name);
772 idesc->handler = handler;
773 idesc->argument = arg;
774 idesc->maskptr = maskptr;
776 idesc->flags = flags;
779 oldspl = splq(1 << irq);
781 /* add irq to class selected by maskptr */
782 errcode = add_intrdesc(idesc);
787 printf("\tintr_connect(irq%d) failed, result=%d\n",
789 free(idesc->name, M_DEVBUF);
790 free(idesc, M_DEVBUF);
798 * Deactivate and remove the interrupt handler descriptor data connected
799 * created by an earlier call of intr_connect() from the linked list and
800 * adjust theinterrupt masks if necessary.
802 * Return the memory held by the interrupt handler descriptor data structure
803 * to the system. Make sure, the handler is not actively used anymore, before.
807 inthand_remove(intrec *idesc)
809 intrec **hook, *head;
819 /* find pointer that keeps the reference to this interrupt descriptor */
820 hook = find_pred(idesc, irq);
824 /* make copy of original list head, the line after may overwrite it */
825 head = intreclist_head[irq];
827 /* unlink: make predecessor point to idesc->next instead of to idesc */
830 /* now check whether the element we removed was the list head */
833 oldspl = splq(1 << irq);
835 /* check whether the new list head is the only element on list */
836 head = intreclist_head[irq];
838 icu_unset(irq, intr_mux);
839 if (head->next != NULL) {
840 /* install the multiplex handler with new list head as argument */
841 errcode = icu_setup(irq, intr_mux, head, 0, 0);
843 update_intrname(irq, NULL);
845 /* install the one remaining handler for this irq */
846 errcode = icu_setup(irq, head->handler,
848 head->maskptr, head->flags);
850 update_intrname(irq, head->name);
853 /* revert to old handler, eg: strayintr */
854 icu_unset(irq, idesc->handler);
858 update_masks(idesc->maskptr, irq);
859 free(idesc, M_DEVBUF);