Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/arch/i386/eisa/eisa_machdep.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/arch/i386/eisa/eisa_machdep.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.12.2.2 retrieving revision 1.12.2.3 diff -u -p -r1.12.2.2 -r1.12.2.3 --- src/sys/arch/i386/eisa/eisa_machdep.c 2002/01/08 00:25:16 1.12.2.2 +++ src/sys/arch/i386/eisa/eisa_machdep.c 2002/10/18 02:37:35 1.12.2.3 @@ -1,4 +1,4 @@ -/* $NetBSD: eisa_machdep.c,v 1.12.2.2 2002/01/08 00:25:16 nathanw Exp $ */ +/* $NetBSD: eisa_machdep.c,v 1.12.2.3 2002/10/18 02:37:35 nathanw Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -72,7 +72,9 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: eisa_machdep.c,v 1.12.2.2 2002/01/08 00:25:16 nathanw Exp $"); +__KERNEL_RCSID(0, "$NetBSD: eisa_machdep.c,v 1.12.2.3 2002/10/18 02:37:35 nathanw Exp $"); + +#include "ioapic.h" #include #include @@ -90,6 +92,11 @@ __KERNEL_RCSID(0, "$NetBSD: eisa_machdep #include #include +#if NIOAPIC > 0 +#include +#include +#endif + /* * EISA doesn't have any special needs; just use the generic versions * of these funcions. @@ -144,6 +151,9 @@ eisa_intr_map(ec, irq, ihp) u_int irq; eisa_intr_handle_t *ihp; { +#if NIOAPIC > 0 + struct mp_intr_map *mip; +#endif if (irq >= ICU_LEN) { printf("eisa_intr_map: bad IRQ %d\n", irq); @@ -155,6 +165,37 @@ eisa_intr_map(ec, irq, ihp) irq = 9; } +#if NIOAPIC > 0 + if (mp_busses != NULL) { + int bus = mp_eisa_bus; + + if (bus != -1) { + for (mip = mp_busses[bus].mb_intrs; mip != NULL; + mip=mip->next) { + if (mip->bus_pin == irq) { + *ihp = mip->ioapic_ih | irq; + return 0; + } + } + } + + bus = mp_isa_bus; + + if (bus != -1) { + for (mip = mp_busses[bus].mb_intrs; mip != NULL; + mip=mip->next) { + if (mip->bus_pin == irq) { + *ihp = mip->ioapic_ih | irq; + return 0; + } + } + } + + printf("eisa_intr_map: no MP mapping found\n"); + } +#endif + + *ihp = irq; return 0; } @@ -166,10 +207,20 @@ eisa_intr_string(ec, ih) { static char irqstr[8]; /* 4 + 2 + NULL + sanity */ - if (ih == 0 || ih >= ICU_LEN || ih == 2) - panic("eisa_intr_string: bogus handle 0x%x\n", ih); + if (ih == 0 || (ih & 0xff) >= ICU_LEN || ih == 2) + panic("eisa_intr_string: bogus handle 0x%x", ih); +#if NIOAPIC > 0 + if (ih & APIC_INT_VIA_APIC) + sprintf(irqstr, "apic %d int %d (irq %d)", + APIC_IRQ_APIC(ih), + APIC_IRQ_PIN(ih), + ih&0xff); + else + sprintf(irqstr, "irq %d", ih&0xff); +#else sprintf(irqstr, "irq %d", ih); +#endif return (irqstr); } @@ -189,9 +240,17 @@ eisa_intr_establish(ec, ih, type, level, int type, level, (*func) __P((void *)); void *arg; { + if (ih != -1) { +#if NIOAPIC > 0 + if (ih & APIC_INT_VIA_APIC) { + return apic_intr_establish(ih, type, level, + func, arg); + } +#endif + } if (ih == 0 || ih >= ICU_LEN || ih == 2) - panic("eisa_intr_establish: bogus handle 0x%x\n", ih); + panic("eisa_intr_establish: bogus handle 0x%x", ih); return isa_intr_establish(NULL, ih, type, level, func, arg); }