Okay, so I'm now getting the interrupt line information from the ACPI tables, using ACPICA.
(Side note: the newest version of VirtualBox now reports the interrupt line as 10 instead of 255, despite still sending it to a different line

)
This is what I'm doing:
This appears to get the right interrupts in Qemu and VirtualBox, although I haven't tested it on real hardware yet.
However, I'm concerned by the following statement in the Wiki's article on PCI:
Quote:
With time manufacturers started to use mainly INTA#, forgetting the existence of other pins. So you will likely have 18 devices on INTA# and 2 on INTB#. Motherboard manufacturers decided take the situation in control. So at boot the INTx# are remapped, so that you will have 5 devices for INTA#, 5 for INTB#, 5 for INTC#, and 5 for INTD# (in the best case). That's great! IRQs are balanced and IRQ sharing is reduced. The only problem is that you don't know what devices where mapped. If you read the Interrupt Pin you still get INTA#. You now need to parse the MP Tables or the ACPI ones to solve the mess. Good luck.
Is this accurate? If so, where do I get this information from?
As noted earlier, the IRQ routing table from ACPI gives me a different entry for each pin. Is perhaps using the pin given in the PCI table to select the entry from the routing table already doing what this is referring to?
Thanks.