apic_irq() returns -1 when there is no match for (IOAPIC, intpin) pair.
Adjust some comments to better match the code.
This commit is contained in:
parent
b94e4b7331
commit
787749e519
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=54618
@ -173,7 +173,7 @@ io_apic_setup(int apic)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
irq = apic_irq(apic, pin);
|
irq = apic_irq(apic, pin);
|
||||||
if (irq == 0xff)
|
if (irq < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* determine the bus type for this pin */
|
/* determine the bus type for this pin */
|
||||||
@ -182,17 +182,22 @@ io_apic_setup(int apic)
|
|||||||
continue;
|
continue;
|
||||||
bustype = apic_bus_type(bus);
|
bustype = apic_bus_type(bus);
|
||||||
|
|
||||||
/* the "ISA" type INTerrupts */
|
|
||||||
if ((bustype == ISA) &&
|
if ((bustype == ISA) &&
|
||||||
(pin < IOAPIC_ISA_INTS) &&
|
(pin < IOAPIC_ISA_INTS) &&
|
||||||
(irq == pin) &&
|
(irq == pin) &&
|
||||||
(apic_polarity(apic, pin) == 0x1) &&
|
(apic_polarity(apic, pin) == 0x1) &&
|
||||||
(apic_trigger(apic, pin) == 0x3)) {
|
(apic_trigger(apic, pin) == 0x3)) {
|
||||||
|
/*
|
||||||
|
* A broken BIOS might describe some ISA
|
||||||
|
* interrupts as active-high level-triggered.
|
||||||
|
* Use default ISA flags for those interrupts.
|
||||||
|
*/
|
||||||
flags = DEFAULT_ISA_FLAGS;
|
flags = DEFAULT_ISA_FLAGS;
|
||||||
}
|
} else {
|
||||||
|
/*
|
||||||
/* PCI or other bus */
|
* Program polarity and trigger mode according to
|
||||||
else {
|
* interrupt entry.
|
||||||
|
*/
|
||||||
flags = DEFAULT_FLAGS;
|
flags = DEFAULT_FLAGS;
|
||||||
level = trigger(apic, pin, &flags);
|
level = trigger(apic, pin, &flags);
|
||||||
if (level == 1)
|
if (level == 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user