Message ID | 20211116170133.724751-3-fbarrat@linux.ibm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Fix irq allocation of PCI host bridge on powernv | expand |
On 11/16/21 18:01, Frederic Barrat wrote: > Move the pci_intx() definition to the PCI header file, so that it can > be called from other PCI files. It is used by the next patch. > > Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Thanks, C. > --- > hw/pci/pci.c | 5 ----- > include/hw/pci/pci.h | 5 +++++ > 2 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/hw/pci/pci.c b/hw/pci/pci.c > index e5993c1ef5..249d7e4cf6 100644 > --- a/hw/pci/pci.c > +++ b/hw/pci/pci.c > @@ -1497,11 +1497,6 @@ static void pci_irq_handler(void *opaque, int irq_num, int level) > pci_change_irq_level(pci_dev, irq_num, change); > } > > -static inline int pci_intx(PCIDevice *pci_dev) > -{ > - return pci_get_byte(pci_dev->config + PCI_INTERRUPT_PIN) - 1; > -} > - > qemu_irq pci_allocate_irq(PCIDevice *pci_dev) > { > int intx = pci_intx(pci_dev); > diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h > index e7cdf2d5ec..35f8eb67bd 100644 > --- a/include/hw/pci/pci.h > +++ b/include/hw/pci/pci.h > @@ -735,6 +735,11 @@ void lsi53c8xx_handle_legacy_cmdline(DeviceState *lsi_dev); > qemu_irq pci_allocate_irq(PCIDevice *pci_dev); > void pci_set_irq(PCIDevice *pci_dev, int level); > > +static inline int pci_intx(PCIDevice *pci_dev) > +{ > + return pci_get_byte(pci_dev->config + PCI_INTERRUPT_PIN) - 1; > +} > + > static inline void pci_irq_assert(PCIDevice *pci_dev) > { > pci_set_irq(pci_dev, 1); >
diff --git a/hw/pci/pci.c b/hw/pci/pci.c index e5993c1ef5..249d7e4cf6 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1497,11 +1497,6 @@ static void pci_irq_handler(void *opaque, int irq_num, int level) pci_change_irq_level(pci_dev, irq_num, change); } -static inline int pci_intx(PCIDevice *pci_dev) -{ - return pci_get_byte(pci_dev->config + PCI_INTERRUPT_PIN) - 1; -} - qemu_irq pci_allocate_irq(PCIDevice *pci_dev) { int intx = pci_intx(pci_dev); diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index e7cdf2d5ec..35f8eb67bd 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -735,6 +735,11 @@ void lsi53c8xx_handle_legacy_cmdline(DeviceState *lsi_dev); qemu_irq pci_allocate_irq(PCIDevice *pci_dev); void pci_set_irq(PCIDevice *pci_dev, int level); +static inline int pci_intx(PCIDevice *pci_dev) +{ + return pci_get_byte(pci_dev->config + PCI_INTERRUPT_PIN) - 1; +} + static inline void pci_irq_assert(PCIDevice *pci_dev) { pci_set_irq(pci_dev, 1);
Move the pci_intx() definition to the PCI header file, so that it can be called from other PCI files. It is used by the next patch. Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com> --- hw/pci/pci.c | 5 ----- include/hw/pci/pci.h | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-)