version 1.37, 2011/09/01 15:10:31 |
version 1.37.12.3, 2017/12/03 11:36:17 |
|
|
eisa_attach_hook(device_t parent, device_t self, |
eisa_attach_hook(device_t parent, device_t self, |
struct eisabus_attach_args *eba) |
struct eisabus_attach_args *eba) |
{ |
{ |
extern int eisa_has_been_seen; |
extern int eisa_has_been_seen; |
|
|
/* |
/* |
* Notify others that might need to know that the EISA bus |
* Notify others that might need to know that the EISA bus |
Line 157 eisa_intr_map(eisa_chipset_tag_t ec, u_i |
|
Line 157 eisa_intr_map(eisa_chipset_tag_t ec, u_i |
|
} |
} |
|
|
const char * |
const char * |
eisa_intr_string(eisa_chipset_tag_t ec, eisa_intr_handle_t ih) |
eisa_intr_string(eisa_chipset_tag_t ec, eisa_intr_handle_t ih, char *buf, |
|
size_t len) |
{ |
{ |
static char irqstr[8]; /* 4 + 2 + NULL + sanity */ |
if (ih == 0 || APIC_IRQ_LEGACY_IRQ(ih) >= NUM_LEGACY_IRQS || ih == 2) |
|
panic("eisa_intr_string: bogus handle 0x%" PRIx64, ih); |
if (ih == 0 || (ih & 0xff) >= NUM_LEGACY_IRQS || ih == 2) |
|
panic("eisa_intr_string: bogus handle 0x%x", ih); |
|
|
|
#if NIOAPIC > 0 |
#if NIOAPIC > 0 |
if (ih & APIC_INT_VIA_APIC) |
if (ih & APIC_INT_VIA_APIC) |
snprintf(irqstr, sizeof(irqstr), "apic %d int %d (irq %d)", |
snprintf(buf, len, "apic %d int %d (irq %d)", |
APIC_IRQ_APIC(ih), |
APIC_IRQ_APIC(ih), |
APIC_IRQ_PIN(ih), |
APIC_IRQ_PIN(ih), |
ih&0xff); |
APIC_IRQ_LEGACY_IRQ(ih)); |
else |
else |
snprintf(irqstr, sizeof(irqstr), "irq %d", ih&0xff); |
snprintf(buf, len, "irq %d", APIC_IRQ_LEGACY_IRQ(ih)); |
#else |
#else |
snprintf(irqstr, sizeof(irqstr), "irq %d", ih); |
snprintf(buf, len, "irq %d", APIC_IRQ_LEGACY_IRQ(ih)); |
#endif |
#endif |
return (irqstr); |
return buf; |
|
|
} |
} |
|
|
const struct evcnt * |
const struct evcnt * |
Line 199 eisa_intr_establish(eisa_chipset_tag_t e |
|
Line 197 eisa_intr_establish(eisa_chipset_tag_t e |
|
|
|
#if NIOAPIC > 0 |
#if NIOAPIC > 0 |
if (ih & APIC_INT_VIA_APIC) { |
if (ih & APIC_INT_VIA_APIC) { |
pic = (struct pic *)ioapic_find(APIC_IRQ_APIC(ih)); |
struct ioapic_softc * const ioapic = ioapic_find(APIC_IRQ_APIC(ih)); |
if (pic == NULL) { |
if (ioapic == NULL) { |
aprint_error("eisa_intr_establish: bad ioapic %d\n", |
aprint_normal("eisa_intr_establish: bad ioapic %d\n", |
APIC_IRQ_APIC(ih)); |
APIC_IRQ_APIC(ih)); |
return NULL; |
return NULL; |
} |
} |
|
pic = &ioapic->sc_pic; |
pin = APIC_IRQ_PIN(ih); |
pin = APIC_IRQ_PIN(ih); |
irq = APIC_IRQ_LEGACY_IRQ(ih); |
irq = APIC_IRQ_LEGACY_IRQ(ih); |
if (irq < 0 || irq >= NUM_LEGACY_IRQS) |
if (irq < 0 || irq >= NUM_LEGACY_IRQS) |