Received: from eggs.gnu.org ([2001:4830:134:3::10]:40506) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgjkc-0003uB-0t for qemu-devel@nongnu.org; Wed, 22 Feb 2017 22:07:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cgjka-0005Kw-GX for qemu-devel@nongnu.org; Wed, 22 Feb 2017 22:07:25 -0500 Date: Thu, 23 Feb 2017 13:25:22 +1100 From: David Gibson Message-ID: <20170223022522.GV12577@umbus.fritz.box> References: <1487252865-12064-1-git-send-email-clg@kaod.org> <1487252865-12064-8-git-send-email-clg@kaod.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="22hJjvOmZW2O/jbw" Content-Disposition: inline In-Reply-To: <1487252865-12064-8-git-send-email-clg@kaod.org> Subject: Re: [Qemu-devel] [PATCH v2 07/22] ppc/xics: use the QOM interface to get irqs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?C=E9dric?= Le Goater Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org --22hJjvOmZW2O/jbw Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 16, 2017 at 02:47:30PM +0100, C=E9dric Le Goater wrote: > Signed-off-by: C=E9dric Le Goater Reviewed-by: David Gibson > --- > hw/intc/xics.c | 5 +++-- > hw/ppc/spapr_events.c | 6 +++--- > hw/ppc/spapr_pci.c | 2 +- > include/hw/pci-host/spapr.h | 2 +- > include/hw/ppc/spapr_vio.h | 2 +- > include/hw/ppc/xics.h | 3 ++- > 6 files changed, 11 insertions(+), 9 deletions(-) >=20 > diff --git a/hw/intc/xics.c b/hw/intc/xics.c > index 39c442f70116..0ffdf09c5304 100644 > --- a/hw/intc/xics.c > +++ b/hw/intc/xics.c > @@ -747,9 +747,10 @@ ICSState *xics_find_source(XICSState *xics, int irq) > return NULL; > } > =20 > -qemu_irq xics_get_qirq(XICSState *xics, int irq) > +qemu_irq xics_get_qirq(XICSInterface *xi, int irq) > { > - ICSState *ics =3D xics_find_source(xics, irq); > + XICSInterfaceClass *xic =3D XICS_INTERFACE_GET_CLASS(xi); > + ICSState *ics =3D xic->ics_get(xi, irq); > =20 > if (ics) { > return ics->qirqs[irq - ics->offset]; > diff --git a/hw/ppc/spapr_events.c b/hw/ppc/spapr_events.c > index 38b4258a9be7..aa627dc13008 100644 > --- a/hw/ppc/spapr_events.c > +++ b/hw/ppc/spapr_events.c > @@ -481,7 +481,7 @@ static void spapr_powerdown_req(Notifier *n, void *op= aque) > =20 > rtas_event_log_queue(RTAS_LOG_TYPE_EPOW, new_epow, true); > =20 > - qemu_irq_pulse(xics_get_qirq(spapr->xics, > + qemu_irq_pulse(xics_get_qirq(XICS_INTERFACE(spapr), > rtas_event_log_to_irq(spapr, > RTAS_LOG_TYPE_EPO= W))); > } > @@ -574,7 +574,7 @@ static void spapr_hotplug_req_event(uint8_t hp_id, ui= nt8_t hp_action, > =20 > rtas_event_log_queue(RTAS_LOG_TYPE_HOTPLUG, new_hp, true); > =20 > - qemu_irq_pulse(xics_get_qirq(spapr->xics, > + qemu_irq_pulse(xics_get_qirq(XICS_INTERFACE(spapr), > rtas_event_log_to_irq(spapr, > RTAS_LOG_TYPE_HOT= PLUG))); > } > @@ -695,7 +695,7 @@ static void check_exception(PowerPCCPU *cpu, sPAPRMac= hineState *spapr, > spapr_event_sources_get_source(spapr->event_sources, i); > =20 > g_assert(source->enabled); > - qemu_irq_pulse(xics_get_qirq(spapr->xics, source->irq)); > + qemu_irq_pulse(xics_get_qirq(XICS_INTERFACE(spapr), source->= irq)); > } > } > =20 > diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c > index 01d5c92425ed..e52d6e993c9e 100644 > --- a/hw/ppc/spapr_pci.c > +++ b/hw/ppc/spapr_pci.c > @@ -736,7 +736,7 @@ static void spapr_msi_write(void *opaque, hwaddr addr, > =20 > trace_spapr_pci_msi_write(addr, data, irq); > =20 > - qemu_irq_pulse(xics_get_qirq(spapr->xics, irq)); > + qemu_irq_pulse(xics_get_qirq(XICS_INTERFACE(spapr), irq)); > } > =20 > static const MemoryRegionOps spapr_msi_ops =3D { > diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h > index 092294ed5a65..bfd307be30ca 100644 > --- a/include/hw/pci-host/spapr.h > +++ b/include/hw/pci-host/spapr.h > @@ -106,7 +106,7 @@ static inline qemu_irq spapr_phb_lsi_qirq(struct sPAP= RPHBState *phb, int pin) > { > sPAPRMachineState *spapr =3D SPAPR_MACHINE(qdev_get_machine()); > =20 > - return xics_get_qirq(spapr->xics, phb->lsi_table[pin].irq); > + return xics_get_qirq(XICS_INTERFACE(spapr), phb->lsi_table[pin].irq); > } > =20 > PCIHostState *spapr_create_phb(sPAPRMachineState *spapr, int index); > diff --git a/include/hw/ppc/spapr_vio.h b/include/hw/ppc/spapr_vio.h > index fc6f673ea086..1b04523b683d 100644 > --- a/include/hw/ppc/spapr_vio.h > +++ b/include/hw/ppc/spapr_vio.h > @@ -87,7 +87,7 @@ static inline qemu_irq spapr_vio_qirq(VIOsPAPRDevice *d= ev) > { > sPAPRMachineState *spapr =3D SPAPR_MACHINE(qdev_get_machine()); > =20 > - return xics_get_qirq(spapr->xics, dev->irq); > + return xics_get_qirq(XICS_INTERFACE(spapr), dev->irq); > } > =20 > static inline bool spapr_vio_dma_valid(VIOsPAPRDevice *dev, uint64_t tad= dr, > diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h > index 640603b3d76d..896fa5d87c1c 100644 > --- a/include/hw/ppc/xics.h > +++ b/include/hw/ppc/xics.h > @@ -197,7 +197,8 @@ typedef struct XICSInterfaceClass { > =20 > #define XICS_IRQS_SPAPR 1024 > =20 > -qemu_irq xics_get_qirq(XICSState *icp, int irq); > +qemu_irq xics_get_qirq(XICSInterface *xi, int irq); > + > int spapr_ics_alloc(ICSState *ics, int irq_hint, bool lsi, Error **errp); > int spapr_ics_alloc_block(ICSState *ics, int num, bool lsi, bool align, > Error **errp); --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --22hJjvOmZW2O/jbw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYrkgSAAoJEGw4ysog2bOSXcMQAM7wmr1/4B+N2lWNqHIJWZ4j xQadRIlOZxoWZZSB0GLAsFlVta1Cq/y+KIdB5r1RUSLLNkYmfDKU3evBcE5lB0aH F2eXInV8h0xbR+IIwuHvRZ9EVITlAf3bhD5jr8EionILXntHa9mP1CxiI24B4Pnd foPWCgOfEAuUUL/YwAPjejC2p2GSgqGsLHC5XebkJ1Eu+iRbmoMNSz9WQipHatPB 374H91FH4rDGv8l6qVUreKNe3aINe2PpxPxKRj0DonP3S88MWjN5OB3Avu1Qi4ps c0T02a3cyECFQ8I6Sl0MFxryRxq/XnNQcGDNdXFMUGGAt4XROf376dXZyLMcVi5M jSpY0036w6fGF6tmGp3t4yOvoErfBSXfm8bJ6Ztu8ha0d2+TeL+mNvKxX5rrxP3x CmtysIiesWWYitgpWSF5advCygjsRkx1jj8hj8CYcWo8CUo9NnY5KP+IKNRxQYKH S7MUB4lNSivDRe2AAIraMfvOfrB5ZhE+BPUCh1xLEFU4xOORi7G2jh8CxvMmxmh1 n1eh9iepCKxUfpAgVewXdFy6Qmat8JA0JeZiibyvv/q0761Rnh3aKx1h4xh03+M5 xpXhxvFpqptoAT7oY8WCVBLcyDsyq5bpB8UeAYEOp5NFLgXm55PqjCYtxvc33e5d eb7/nVhY+uQWyLeJCSL3 =1LJa -----END PGP SIGNATURE----- --22hJjvOmZW2O/jbw--