FreeBSD/sys/i386/pci/pci_pir.c
/*
 * Try to pick an interrupt for the specified link from the interrupts
 * set in the mask.
 */
Try to pick an interrupt for the specified link from the interrupts
set in the mask.
Try to pick an interrupt for the specified link from the interrupts set in the mask .
static int
pci_pir_choose_irq(struct pci_link *pci_link, int irqmask)
{
	int i, irq, realmask;
	realmask = pci_link->pl_irqmask & irqmask;
	if (realmask == 0)
		return (PCI_INVALID_IRQ);
	irq = PCI_INVALID_IRQ;
	for (i = 0; i < NUM_ISA_INTERRUPTS; i++) {
		if (!(realmask & 1 << i))
			continue;
		if (irq == PCI_INVALID_IRQ ||
		    pir_interrupt_weight[i] < pir_interrupt_weight[irq])
			irq = i;
	}
	if (bootverbose && PCI_INTERRUPT_VALID(irq)) {
		printf("$PIR: Found IRQ %d for link %#x from ", irq,
		    pci_link->pl_id);
		pci_print_irqmask(realmask);
		printf("\n");
	}
	return (irq);
}
static int pci_pir_choose_irq ( struct pci_link * pci_link , int irqmask ) { int i , irq , realmask ; realmask = pci_link -> pl_irqmask & irqmask ; if ( realmask == 0 ) return ( PCI_INVALID_IRQ ) ; irq = PCI_INVALID_IRQ ; for ( i = 0 ; i < NUM_ISA_INTERRUPTS ; i ++ ) { if ( ! ( realmask & 1 << i ) ) continue ; if ( irq == PCI_INVALID_IRQ || pir_interrupt_weight [ i ] < pir_interrupt_weight [ irq ] ) irq = i ; } if ( bootverbose && PCI_INTERRUPT_VALID ( irq ) ) { printf ( " " , irq , pci_link -> pl_id ) ; pci_print_irqmask ( realmask ) ; printf ( " \n " ) ; } return ( irq ) ; }
Try to pick an interrupt for the specified link from the interrupts
 set in the mask.
Try to pick an interrupt for the specified link from the interrupts set in the mask .
/* XXX: Need to have a #define of known bad IRQs to also mask out? */ /* Find IRQ with lowest weight. */