- PCIBus *bus = pci_get_bus(&s->dev);
- int i, pic_level, pic_irq = via_isa_get_pci_irq(s, irq_num);
-
- /* IRQ 0: disabled, IRQ 2,8,13: reserved */
- if (!pic_irq) {
- return;
- }
- if (unlikely(pic_irq == 2 || pic_irq == 8 || pic_irq == 13)) {
- qemu_log_mask(LOG_GUEST_ERROR, "Invalid ISA IRQ routing");
- }
-
- /* The pic level is the logical OR of all the PCI irqs mapped to it. */
- pic_level = 0;
- for (i = 0; i < PCI_NUM_PINS; i++) {
- if (pic_irq == via_isa_get_pci_irq(s, i)) {
- pic_level |= pci_bus_get_irq_level(bus, i);
- }
- }
- /* Now we change the pic irq level according to the via irq mappings. */
- qemu_set_irq(s->isa_irqs_in[pic_irq], pic_level);