+ if (dev->irq) {
+ printf ("PCI: Interrupt: %u\n", dev->irq);
+ }
+}
+
+static void
+pci_setup_irq (struct pci_dev *dev)
+{
+ uint32_t pinline;
+ pinline = pci_read_config(dev->bus_id,
+ dev->devfn >> 4,
+ dev->devfn & 0xf,
+ PCI_REGNUM_INTERRUPT);
+
+ /* Devices without a non-zero pin get IRQ 0. I guess this is acceptable? */
+ if (pinline & PCI_INTERRUPT_MASK_PIN) {
+ dev->irq = pinline & PCI_INTERRUPT_MASK_LINE;
+ }