You can't even depend on that, I think.
There's a further mapping from PCI interrupt to "traditional interrupt"
done by the southbridge, as far as I know. And it is _that_ mapping that
changes PIRQx into int11 - this mapping has to be done even when the
IO-APIC isn't actually in use (virtual wire or whatever its called).
And it is entirely possible that you have two different PIRQ lines mapping
to the same traditional irq line. Admittedly that is stupid from a
performance standpoint, but this may have been set up in the BIOS setups
because the machine may be very scarce on traditional interrupts (and if
you have to share an interrupt, you'd better share a PCI interrupt rather
than anything else).
The only reliable way to detect the PCI interrupt routing that I can think
of is:
- map the PCI interrupts 1:1 by the APIC to irq16-19
- autodetect the interrupt
And even the above is reliable only when the machine happens to have one
particular setup (ie just four PCI interrupts and they really are
connected to the APIC in the standard way) which is by no means guaranteed
to always be true - as we've seen from double-PCI machines the mapping may
be less straightforward.
Plus it is actually hard to autodetect the interrupt: we have to make the
card generate the interrupt in the first place, which implies that the
auto-detection has to be done by the driver rather than by the initial
interrupt setup..
Linus