diff options
author | Alexander Graf <agraf@suse.de> | 2012-12-13 01:16:24 +0100 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2012-12-14 13:12:57 +0100 |
commit | 9e2c12988bebca7b99c0cd064b23fb7ea6643c86 (patch) | |
tree | 7dee741527eb75b537cccac75ccef86aae9a70c0 /hw/ppce500_pci.h | |
parent | 3bb7e02a9725a24e5bf915b35f914f82f5b07a1f (diff) |
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.h')
-rw-r--r-- | hw/ppce500_pci.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/ppce500_pci.h b/hw/ppce500_pci.h new file mode 100644 index 0000000000..61f773ef30 --- /dev/null +++ b/hw/ppce500_pci.h @@ -0,0 +1,9 @@ +#ifndef PPCE500_PCI_H +#define PPCE500_PCI_H + +static inline int ppce500_pci_map_irq_slot(int devno, int irq_num) +{ + return (devno + irq_num) % 4; +} + +#endif |