Message ID | 1454086429-4373-4-git-send-email-eric.auger@linaro.org |
---|---|
State | New |
Headers | show |
On 29 January 2016 at 16:53, Eric Auger <eric.auger@linaro.org> wrote: > This patch stores information about assigned legacy interrupt numbers in > GPEX host structure. > This is used during GPEX INTx number determination from a pin during > INTx routing. > > Signed-off-by: Pranavkumar Sawargaonkar <address@hidden> > Signed-off-by: Tushar Jagad <address@hidden> > --- > hw/arm/virt.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/hw/arm/virt.c b/hw/arm/virt.c > index 15658f4..3839c68 100644 > --- a/hw/arm/virt.c > +++ b/hw/arm/virt.c > @@ -826,6 +826,7 @@ static void create_pcie(const VirtBoardInfo *vbi, qemu_irq *pic, > char *nodename; > int i; > PCIHostState *pci; > + GPEXHost *s; > > dev = qdev_create(NULL, TYPE_GPEX_HOST); > qdev_init_nofail(dev); > @@ -861,8 +862,11 @@ static void create_pcie(const VirtBoardInfo *vbi, qemu_irq *pic, > /* Map IO port space */ > sysbus_mmio_map(SYS_BUS_DEVICE(dev), 2, base_pio); > > + s = GPEX_HOST(dev); > + > for (i = 0; i < GPEX_NUM_IRQS; i++) { > sysbus_connect_irq(SYS_BUS_DEVICE(dev), i, pic[irq + i]); > + s->irq_num[i] = irq + i; > } I don't think that the board code should be prodding stuff in the GPEXHost struct like this -- device structs are supposed to be private to the device implementation. If you need the information in the device then you need to come up with a better API for this. thanks -- PMM
Hi Peter, On 02/16/2016 07:14 PM, Peter Maydell wrote: > On 29 January 2016 at 16:53, Eric Auger <eric.auger@linaro.org> wrote: >> This patch stores information about assigned legacy interrupt numbers in >> GPEX host structure. >> This is used during GPEX INTx number determination from a pin during >> INTx routing. >> >> Signed-off-by: Pranavkumar Sawargaonkar <address@hidden> >> Signed-off-by: Tushar Jagad <address@hidden> >> --- >> hw/arm/virt.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/hw/arm/virt.c b/hw/arm/virt.c >> index 15658f4..3839c68 100644 >> --- a/hw/arm/virt.c >> +++ b/hw/arm/virt.c >> @@ -826,6 +826,7 @@ static void create_pcie(const VirtBoardInfo *vbi, qemu_irq *pic, >> char *nodename; >> int i; >> PCIHostState *pci; >> + GPEXHost *s; >> >> dev = qdev_create(NULL, TYPE_GPEX_HOST); >> qdev_init_nofail(dev); >> @@ -861,8 +862,11 @@ static void create_pcie(const VirtBoardInfo *vbi, qemu_irq *pic, >> /* Map IO port space */ >> sysbus_mmio_map(SYS_BUS_DEVICE(dev), 2, base_pio); >> >> + s = GPEX_HOST(dev); >> + >> for (i = 0; i < GPEX_NUM_IRQS; i++) { >> sysbus_connect_irq(SYS_BUS_DEVICE(dev), i, pic[irq + i]); >> + s->irq_num[i] = irq + i; >> } > > I don't think that the board code should be prodding stuff in the GPEXHost > struct like this -- device structs are supposed to be private to the > device implementation. If you need the information in the device then > you need to come up with a better API for this. Sure, Thanks Eric > > thanks > -- PMM >
diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 15658f4..3839c68 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -826,6 +826,7 @@ static void create_pcie(const VirtBoardInfo *vbi, qemu_irq *pic, char *nodename; int i; PCIHostState *pci; + GPEXHost *s; dev = qdev_create(NULL, TYPE_GPEX_HOST); qdev_init_nofail(dev); @@ -861,8 +862,11 @@ static void create_pcie(const VirtBoardInfo *vbi, qemu_irq *pic, /* Map IO port space */ sysbus_mmio_map(SYS_BUS_DEVICE(dev), 2, base_pio); + s = GPEX_HOST(dev); + for (i = 0; i < GPEX_NUM_IRQS; i++) { sysbus_connect_irq(SYS_BUS_DEVICE(dev), i, pic[irq + i]); + s->irq_num[i] = irq + i; } pci = PCI_HOST_BRIDGE(dev);