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.10 retrieving revision 1.10.22.6 diff -u -p -r1.10 -r1.10.22.6 --- src/sys/arch/i386/eisa/eisa_machdep.c 1998/06/03 06:35:49 1.10 +++ src/sys/arch/i386/eisa/eisa_machdep.c 2001/12/29 21:09:05 1.10.22.6 @@ -1,4 +1,4 @@ -/* $NetBSD: eisa_machdep.c,v 1.10 1998/06/03 06:35:49 thorpej Exp $ */ +/* $NetBSD: eisa_machdep.c,v 1.10.22.6 2001/12/29 21:09:05 sommerfeld Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -71,6 +71,11 @@ * Machine-specific functions for EISA autoconfiguration. */ +#include +__KERNEL_RCSID(0, "$NetBSD: eisa_machdep.c,v 1.10.22.6 2001/12/29 21:09:05 sommerfeld Exp $"); + +#include "ioapic.h" + #include #include #include @@ -87,6 +92,11 @@ #include #include +#if NIOAPIC > 0 +#include +#include +#endif + /* * EISA doesn't have any special needs; just use the generic versions * of these funcions. @@ -141,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); @@ -152,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; } @@ -163,14 +207,32 @@ eisa_intr_string(ec, ih) { static char irqstr[8]; /* 4 + 2 + NULL + sanity */ - if (ih == 0 || ih >= ICU_LEN || ih == 2) + if (ih == 0 || (ih & 0xff) >= ICU_LEN || ih == 2) panic("eisa_intr_string: bogus handle 0x%x\n", 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); } +const struct evcnt * +eisa_intr_evcnt(eisa_chipset_tag_t ec, eisa_intr_handle_t ih) +{ + + /* XXX for now, no evcnt parent reported */ + return NULL; +} + void * eisa_intr_establish(ec, ih, type, level, func, arg) eisa_chipset_tag_t ec; @@ -178,6 +240,14 @@ 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); @@ -191,7 +261,7 @@ eisa_intr_disestablish(ec, cookie) void *cookie; { - return isa_intr_disestablish(NULL, cookie); + isa_intr_disestablish(NULL, cookie); } int @@ -221,3 +291,47 @@ eisa_mem_free(t, bah, size) bus_space_free(t, bah, size); } + +int +eisa_conf_read_mem(ec, slot, func, entry, ecm) + eisa_chipset_tag_t ec; + int slot, func, entry; + struct eisa_cfg_mem *ecm; +{ + + /* XXX XXX XXX */ + return (ENOENT); +} + +int +eisa_conf_read_irq(ec, slot, func, entry, eci) + eisa_chipset_tag_t ec; + int slot, func, entry; + struct eisa_cfg_irq *eci; +{ + + /* XXX XXX XXX */ + return (ENOENT); +} + +int +eisa_conf_read_dma(ec, slot, func, entry, ecd) + eisa_chipset_tag_t ec; + int slot, func, entry; + struct eisa_cfg_dma *ecd; +{ + + /* XXX XXX XXX */ + return (ENOENT); +} + +int +eisa_conf_read_io(ec, slot, func, entry, ecio) + eisa_chipset_tag_t ec; + int slot, func, entry; + struct eisa_cfg_io *ecio; +{ + + /* XXX XXX XXX */ + return (ENOENT); +}