version 1.13, 2001/05/15 15:07:37 |
version 1.13.2.2, 2002/10/10 18:33:16 |
|
|
* Machine-specific functions for EISA autoconfiguration. |
* Machine-specific functions for EISA autoconfiguration. |
*/ |
*/ |
|
|
|
#include <sys/cdefs.h> |
|
__KERNEL_RCSID(0, "$NetBSD$"); |
|
|
|
#include "ioapic.h" |
|
|
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/param.h> |
#include <sys/param.h> |
#include <sys/time.h> |
#include <sys/time.h> |
|
|
#include <dev/isa/isavar.h> |
#include <dev/isa/isavar.h> |
#include <dev/eisa/eisavar.h> |
#include <dev/eisa/eisavar.h> |
|
|
|
#if NIOAPIC > 0 |
|
#include <machine/i82093var.h> |
|
#include <machine/mpbiosvar.h> |
|
#endif |
|
|
/* |
/* |
* EISA doesn't have any special needs; just use the generic versions |
* EISA doesn't have any special needs; just use the generic versions |
* of these funcions. |
* of these funcions. |
Line 141 eisa_intr_map(ec, irq, ihp) |
|
Line 151 eisa_intr_map(ec, irq, ihp) |
|
u_int irq; |
u_int irq; |
eisa_intr_handle_t *ihp; |
eisa_intr_handle_t *ihp; |
{ |
{ |
|
#if NIOAPIC > 0 |
|
struct mp_intr_map *mip; |
|
#endif |
|
|
if (irq >= ICU_LEN) { |
if (irq >= ICU_LEN) { |
printf("eisa_intr_map: bad IRQ %d\n", irq); |
printf("eisa_intr_map: bad IRQ %d\n", irq); |
Line 152 eisa_intr_map(ec, irq, ihp) |
|
Line 165 eisa_intr_map(ec, irq, ihp) |
|
irq = 9; |
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; |
*ihp = irq; |
return 0; |
return 0; |
} |
} |
Line 163 eisa_intr_string(ec, ih) |
|
Line 207 eisa_intr_string(ec, ih) |
|
{ |
{ |
static char irqstr[8]; /* 4 + 2 + NULL + sanity */ |
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); |
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); |
sprintf(irqstr, "irq %d", ih); |
|
#endif |
return (irqstr); |
return (irqstr); |
|
|
} |
} |
Line 186 eisa_intr_establish(ec, ih, type, level, |
|
Line 240 eisa_intr_establish(ec, ih, type, level, |
|
int type, level, (*func) __P((void *)); |
int type, level, (*func) __P((void *)); |
void *arg; |
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) |
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); |
return isa_intr_establish(NULL, ih, type, level, func, arg); |
} |
} |