summaryrefslogtreecommitdiff
path: root/hw/pci-host
diff options
context:
space:
mode:
authorPranavkumar Sawargaonkar <pranavkumar@linaro.org>2017-09-14 18:43:18 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-09-14 18:43:18 +0100
commit70bfdce6a1263fd06144ecc1c3727c44e562d89b (patch)
tree4afa57d3b7067ab9cea89e9e737d87b626752b2d /hw/pci-host
parent37e29a64254bf82a1901784fcca17c25f8164c2f (diff)
downloadqemu-70bfdce6a1263fd06144ecc1c3727c44e562d89b.tar.gz
hw/pci-host/gpex: Set INTx index/gsi mapping
To implement INTx to gsi routing we need to pass the gpex host bridge the gsi associated to each INTx index. Let's introduce irq_num array and gpex_set_irq_num setter function. Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org> Signed-off-by: Tushar Jagad <tushar.jagad@linaro.org> Signed-off-by: Eric Auger <eric.auger@redhat.com> Tested-by: Feng Kan <fkan@apm.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Message-id: 1505296004-6798-2-git-send-email-eric.auger@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/pci-host')
-rw-r--r--hw/pci-host/gpex.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/hw/pci-host/gpex.c b/hw/pci-host/gpex.c
index 83084b9aab..41a884da3f 100644
--- a/hw/pci-host/gpex.c
+++ b/hw/pci-host/gpex.c
@@ -43,6 +43,16 @@ static void gpex_set_irq(void *opaque, int irq_num, int level)
qemu_set_irq(s->irq[irq_num], level);
}
+int gpex_set_irq_num(GPEXHost *s, int index, int gsi)
+{
+ if (index >= GPEX_NUM_IRQS) {
+ return -EINVAL;
+ }
+
+ s->irq_num[index] = gsi;
+ return 0;
+}
+
static void gpex_host_realize(DeviceState *dev, Error **errp)
{
PCIHostState *pci = PCI_HOST_BRIDGE(dev);