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 * 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); }