Re: [Qemu-devel] [PATCH 07/10] versatile_pci: Implement the correct PCI IRQ mapping

2013-03-25 Thread Michael S. Tsirkin
On Mon, Mar 25, 2013 at 12:17:39PM +, Peter Maydell wrote: > On 25 March 2013 12:12, Michael S. Tsirkin wrote: > > On Sun, Mar 24, 2013 at 11:32:37AM +, Peter Maydell wrote: > >> +return (PCI_SLOT(d->devfn) + irq_num - 2) % PCI_NUM_PINS; > > > > It seems this can be a bit shorter: > >

Re: [Qemu-devel] [PATCH 07/10] versatile_pci: Implement the correct PCI IRQ mapping

2013-03-25 Thread Michael S. Tsirkin
On Sun, Mar 24, 2013 at 11:32:37AM +, Peter Maydell wrote: > Implement the correct IRQ mapping for the Versatile PCI controller; it > differs between realview and versatile boards, but the previous QEMU > implementation was correct only for the first PCI card on a versatile > board, since we we

Re: [Qemu-devel] [PATCH 07/10] versatile_pci: Implement the correct PCI IRQ mapping

2013-03-25 Thread Peter Maydell
On 25 March 2013 12:12, Michael S. Tsirkin wrote: > On Sun, Mar 24, 2013 at 11:32:37AM +, Peter Maydell wrote: >> +return (PCI_SLOT(d->devfn) + irq_num - 2) % PCI_NUM_PINS; > > It seems this can be a bit shorter: > pci_swizzle_map_irq_fn(d, irq_num - 2) > and below irq_num - 1 ? Y

[Qemu-devel] [PATCH 07/10] versatile_pci: Implement the correct PCI IRQ mapping

2013-03-24 Thread Peter Maydell
Implement the correct IRQ mapping for the Versatile PCI controller; it differs between realview and versatile boards, but the previous QEMU implementation was correct only for the first PCI card on a versatile board, since we weren't swizzling IRQs based on the slot number. Note that this change w