mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
PPC: e500: pci: Export slot2irq calculation
We need the calculation method to get from a PCI slot ID to its respective interrupt line twice. Once in the internal map function and once when assembling the device tree. So let's extract the calculation to a separate function that can be called by both users. Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
3bb7e02a97
commit
9e2c12988b
3 changed files with 15 additions and 2 deletions
|
@ -19,6 +19,7 @@
|
|||
#include "pci.h"
|
||||
#include "pci_host.h"
|
||||
#include "bswap.h"
|
||||
#include "ppce500_pci.h"
|
||||
|
||||
#ifdef DEBUG_PCI
|
||||
#define pci_debug(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__)
|
||||
|
@ -256,7 +257,7 @@ static int mpc85xx_pci_map_irq(PCIDevice *pci_dev, int irq_num)
|
|||
int devno = pci_dev->devfn >> 3;
|
||||
int ret;
|
||||
|
||||
ret = (irq_num + devno) % 4;
|
||||
ret = ppce500_pci_map_irq_slot(devno, irq_num);
|
||||
|
||||
pci_debug("%s: devfn %x irq %d -> %d devno:%x\n", __func__,
|
||||
pci_dev->devfn, irq_num, ret, devno);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue