void * pci_intr_establish(pci_chipset_tag_t pc, pci_intr_handle_t ih, int level, int (*func)(void *), void *arg, const char *what) { void *ret; int bus, dev; int l = ih.line & APIC_INT_LINE_MASK; pci_decompose_tag(pc, ih.tag, &bus, &dev, NULL); #if NACPIPRT > 0 acpiprt_route_interrupt(bus, dev, ih.pin); #endif #if NIOAPIC > 0 if (l != -1 && ih.line & APIC_INT_VIA_APIC) return (apic_intr_establish(ih.line, IST_LEVEL, level, func, arg, what)); #endif if (l == 0 || l >= ICU_LEN || l == 2) panic("pci_intr_establish: bogus handle 0x%x", l); ret = isa_intr_establish(NULL, l, IST_LEVEL, level, func, arg, what); #if NPCIBIOS > 0 if (ret) pci_intr_route_link(pc, &ih); #endif return (ret); }
void * eisa_intr_establish(eisa_chipset_tag_t ec, eisa_intr_handle_t ih, int type, int level, int (*func)(void *), void *arg, char *what) { #if NIOAPIC > 0 if (ih != -1) { if (ih != -1 && (ih & APIC_INT_VIA_APIC)) { return (apic_intr_establish(ih, type, level, func, arg, what)); } } #endif if (ih == 0 || ih >= ICU_LEN || ih == 2) panic("eisa_intr_establish: bogus handle 0x%x", ih); return (isa_intr_establish(NULL, ih, type, level, func, arg, what)); }
void * pci_intr_establish(pci_chipset_tag_t pc, pci_intr_handle_t ih, int level, int (*func)(void *), void *arg, char *what) { void *ret; int l = ih.line & APIC_INT_LINE_MASK; #if NIOAPIC > 0 if (l != -1 && ih.line & APIC_INT_VIA_APIC) return (apic_intr_establish(ih.line, IST_LEVEL, level, func, arg, what)); #endif if (l == 0 || l >= ICU_LEN || l == 2) panic("pci_intr_establish: bogus handle 0x%x", l); ret = isa_intr_establish(NULL, l, IST_LEVEL, level, func, arg, what); #if NPCIBIOS > 0 if (ret) pci_intr_route_link(pc, &ih); #endif return (ret); }