FreeBSD/sys/x86/acpica/madt.c
/*
 * Find the IO APIC and pin on that APIC associated with a given global
 * interrupt.
 */
Find the IO APIC and pin on that APIC associated with a given global
interrupt.
Find the IO APIC and pin on that APIC associated with a given global interrupt .
static int
madt_find_interrupt(int intr, void **apic, u_int *pin)
{
	int i, best;
	best = -1;
	for (i = 0; i <= MAX_APIC_ID; i++) {
		if (ioapics[i].io_apic == NULL ||
		    ioapics[i].io_vector > intr)
			continue;
		if (best == -1 ||
		    ioapics[best].io_vector < ioapics[i].io_vector)
			best = i;
	}
	if (best == -1)
		return (ENOENT);
	*apic = ioapics[best].io_apic;
	*pin = intr - ioapics[best].io_vector;
	if (*pin > 32)
		printf("WARNING: Found intpin of %u for vector %d\n", *pin,
		    intr);
	return (0);
}
static int madt_find_interrupt ( int intr , void * * apic , u_int * pin ) { int i , best ; best = -1 ; for ( i = 0 ; i <= MAX_APIC_ID ; i ++ ) { if ( ioapics [ i ] . io_apic == NULL || ioapics [ i ] . io_vector > intr ) continue ; if ( best == -1 || ioapics [ best ] . io_vector < ioapics [ i ] . io_vector ) best = i ; } if ( best == -1 ) return ( ENOENT ) ; * apic = ioapics [ best ] . io_apic ; * pin = intr - ioapics [ best ] . io_vector ; if ( * pin > 32 ) printf ( " \n " , * pin , intr ) ; return ( 0 ) ; }
Find the IO APIC and pin on that APIC associated with a given global
 interrupt.
Find the IO APIC and pin on that APIC associated with a given global interrupt .