summary refs log tree commit diff stats
path: root/hw/ppce500_pci.c
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2012-12-13 01:16:24 +0100
committerAlexander Graf <agraf@suse.de>2012-12-14 13:12:57 +0100
commit9e2c12988bebca7b99c0cd064b23fb7ea6643c86 (patch)
tree7dee741527eb75b537cccac75ccef86aae9a70c0 /hw/ppce500_pci.c
parent3bb7e02a9725a24e5bf915b35f914f82f5b07a1f (diff)
downloadfocaccia-qemu-9e2c12988bebca7b99c0cd064b23fb7ea6643c86.tar.gz
focaccia-qemu-9e2c12988bebca7b99c0cd064b23fb7ea6643c86.zip
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>
Diffstat (limited to 'hw/ppce500_pci.c')
-rw-r--r--hw/ppce500_pci.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/ppce500_pci.c b/hw/ppce500_pci.c
index 561a77661d..09e3507994 100644
--- a/hw/ppce500_pci.c
+++ b/hw/ppce500_pci.c
@@ -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);