On 09/20/2011 12:19 PM, Alan Amaral wrote: > QEMU emulator version 0.14.50, Copyright (c) 2003-2008 Fabrice Bellard > You are correct, it's not hardcoded to 4. However, when it's allocated the > number of elements IS 4. Also, > there's a comment just above pci_set_irq which says: > > /* 0 <= irq_num <= 3. level must be 0 or 1 */ > static void pci_set_irq(void *opaque, int irq_num, int level) > so, that implies to me that it's probably always 4...
The first use I examined was apb_pci.c: d->bus = pci_register_bus(&d->busdev.qdev, "pci", pci_apb_set_irq, pci_pbm_map_irq, d, &d->pci_mmio, get_system_io(), 0, 32); where the last argument indicates that we allocate 32 irqs, and the pci_pbm_map_irq function returns a value in the set { 0, 1, 2, 3, 16, 17, 18, 19 }. r~