All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@kaod.org>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	"Cédric Le Goater" <clg@kaod.org>
Subject: [Qemu-devel] [PATCH v2 07/22] ppc/xics: use the QOM interface to get irqs
Date: Thu, 16 Feb 2017 14:47:30 +0100	[thread overview]
Message-ID: <1487252865-12064-8-git-send-email-clg@kaod.org> (raw)
In-Reply-To: <1487252865-12064-1-git-send-email-clg@kaod.org>

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 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(-)

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;
 }
 
-qemu_irq xics_get_qirq(XICSState *xics, int irq)
+qemu_irq xics_get_qirq(XICSInterface *xi, int irq)
 {
-    ICSState *ics = xics_find_source(xics, irq);
+    XICSInterfaceClass *xic = XICS_INTERFACE_GET_CLASS(xi);
+    ICSState *ics = xic->ics_get(xi, irq);
 
     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 *opaque)
 
     rtas_event_log_queue(RTAS_LOG_TYPE_EPOW, new_epow, true);
 
-    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_EPOW)));
 }
@@ -574,7 +574,7 @@ static void spapr_hotplug_req_event(uint8_t hp_id, uint8_t hp_action,
 
     rtas_event_log_queue(RTAS_LOG_TYPE_HOTPLUG, new_hp, true);
 
-    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_HOTPLUG)));
 }
@@ -695,7 +695,7 @@ static void check_exception(PowerPCCPU *cpu, sPAPRMachineState *spapr,
                 spapr_event_sources_get_source(spapr->event_sources, i);
 
             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));
         }
     }
 
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,
 
     trace_spapr_pci_msi_write(addr, data, irq);
 
-    qemu_irq_pulse(xics_get_qirq(spapr->xics, irq));
+    qemu_irq_pulse(xics_get_qirq(XICS_INTERFACE(spapr), irq));
 }
 
 static const MemoryRegionOps spapr_msi_ops = {
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 sPAPRPHBState *phb, int pin)
 {
     sPAPRMachineState *spapr = SPAPR_MACHINE(qdev_get_machine());
 
-    return xics_get_qirq(spapr->xics, phb->lsi_table[pin].irq);
+    return xics_get_qirq(XICS_INTERFACE(spapr), phb->lsi_table[pin].irq);
 }
 
 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 *dev)
 {
     sPAPRMachineState *spapr = SPAPR_MACHINE(qdev_get_machine());
 
-    return xics_get_qirq(spapr->xics, dev->irq);
+    return xics_get_qirq(XICS_INTERFACE(spapr), dev->irq);
 }
 
 static inline bool spapr_vio_dma_valid(VIOsPAPRDevice *dev, uint64_t taddr,
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 {
 
 #define XICS_IRQS_SPAPR               1024
 
-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);
-- 
2.7.4

  parent reply	other threads:[~2017-02-16 13:49 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-16 13:47 [Qemu-devel] [PATCH v2 00/22] ppc/xics: simplify ICS and ICP creation Cédric Le Goater
2017-02-16 13:47 ` [Qemu-devel] [PATCH v2 01/22] ppc/xics: remove set_nr_irqs() handler from XICSStateClass Cédric Le Goater
2017-02-22  3:21   ` David Gibson
2017-02-24 10:46     ` Cédric Le Goater
2017-02-16 13:47 ` [Qemu-devel] [PATCH v2 02/22] ppc/xics: remove set_nr_servers() " Cédric Le Goater
2017-02-22  6:23   ` David Gibson
2017-02-16 13:47 ` [Qemu-devel] [PATCH v2 03/22] ppc/xics: store the ICS object under the sPAPR machine Cédric Le Goater
2017-02-22  6:59   ` David Gibson
2017-02-24 10:47     ` Cédric Le Goater
2017-02-16 13:47 ` [Qemu-devel] [PATCH v2 04/22] ppc/xics: add an InterruptStatsProvider interface to ICS and ICP objects Cédric Le Goater
2017-02-23  2:15   ` David Gibson
2017-02-24 10:52     ` [Qemu-devel] [Qemu-ppc] " Cédric Le Goater
2017-02-26 23:43       ` David Gibson
2017-02-27  8:48         ` Cédric Le Goater
2017-02-16 13:47 ` [Qemu-devel] [PATCH v2 05/22] ppc/xics: introduce a QOM interface to handle ICSs Cédric Le Goater
2017-02-23  2:18   ` David Gibson
2017-02-24 10:55     ` Cédric Le Goater
2017-02-16 13:47 ` [Qemu-devel] [PATCH v2 06/22] ppc/xics: use the QOM interface under the sPAPR machine Cédric Le Goater
2017-02-23  2:21   ` David Gibson
2017-02-16 13:47 ` Cédric Le Goater [this message]
2017-02-23  2:25   ` [Qemu-devel] [PATCH v2 07/22] ppc/xics: use the QOM interface to get irqs David Gibson
2017-02-16 13:47 ` [Qemu-devel] [PATCH v2 08/22] ppc/xics: use the QOM interface to resend irqs Cédric Le Goater
2017-02-23  2:29   ` David Gibson
2017-02-24 11:12     ` [Qemu-devel] [Qemu-ppc] " Cédric Le Goater
2017-02-24 17:34       ` Cédric Le Goater
2017-02-27  0:37         ` David Gibson
2017-02-27  0:30       ` David Gibson
2017-02-27  8:45         ` Cédric Le Goater
2017-02-16 13:47 ` [Qemu-devel] [PATCH v2 09/22] ppc/xics: remove xics_find_source() Cédric Le Goater
2017-02-23  2:31   ` David Gibson
2017-02-24 11:13     ` [Qemu-devel] [Qemu-ppc] " Cédric Le Goater
2017-02-16 13:47 ` [Qemu-devel] [PATCH v2 10/22] ppc/xics: register the reset handler of ICS objects Cédric Le Goater
2017-02-23  2:33   ` David Gibson
2017-02-16 13:47 ` [Qemu-devel] [PATCH v2 11/22] ppc/xics: remove the XICS list of ICS Cédric Le Goater
2017-02-23  2:33   ` David Gibson
2017-02-16 13:47 ` [Qemu-devel] [PATCH v2 12/22] ppc/xics: extend the QOM interface to handle ICPs Cédric Le Goater
2017-02-23  2:39   ` David Gibson
2017-02-24 11:15     ` [Qemu-devel] [Qemu-ppc] " Cédric Le Goater
2017-02-27  0:57       ` David Gibson
2017-02-16 13:47 ` [Qemu-devel] [PATCH v2 13/22] ppc/xics: simplify the cpu_setup() handler Cédric Le Goater
2017-02-16 13:47 ` [Qemu-devel] [PATCH v2 14/22] ppc/xics: use the QOM interface to grab an ICP Cédric Le Goater
2017-02-16 13:47 ` [Qemu-devel] [PATCH v2 15/22] ppc/xics: simplify spapr_dt_xics() interface Cédric Le Goater
2017-02-16 13:47 ` [Qemu-devel] [PATCH v2 16/22] ppc/xics: register the reset handler of ICP objects Cédric Le Goater
2017-02-23  2:42   ` David Gibson
2017-02-24 11:27     ` [Qemu-devel] [Qemu-ppc] " Cédric Le Goater
2017-02-27  1:00       ` David Gibson
2017-02-27  9:21         ` Cédric Le Goater
2017-02-16 13:47 ` [Qemu-devel] [PATCH v2 17/22] ppc/xics: move the ICP array under the sPAPR machine Cédric Le Goater
2017-02-16 13:47 ` [Qemu-devel] [PATCH v2 18/22] ppc/xics: move kernel_xics_fd out of KVMXICSState Cédric Le Goater
2017-02-16 13:47 ` [Qemu-devel] [PATCH v2 19/22] ppc/xics: move the cpu_setup() handler under the ICPState class Cédric Le Goater
2017-02-16 13:47 ` [Qemu-devel] [PATCH v2 20/22] ppc/xics: remove the 'xics' backlinks Cédric Le Goater
2017-02-16 13:47 ` [Qemu-devel] [PATCH v2 21/22] ppc/xics: export the XICS init routines Cédric Le Goater
2017-02-16 13:47 ` [Qemu-devel] [PATCH v2 22/22] ppc/xics: remove the XICSState classes Cédric Le Goater
2017-02-22  3:34 ` [Qemu-devel] [PATCH v2 00/22] ppc/xics: simplify ICS and ICP creation David Gibson
2017-02-22 10:55   ` Cédric Le Goater
2017-02-23  3:07     ` David Gibson
2017-02-23  6:49       ` Cédric Le Goater
2017-02-23  7:19       ` [Qemu-devel] [Qemu-ppc] " Cédric Le Goater
2017-02-23 22:55         ` David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1487252865-12064-8-git-send-email-clg@kaod.org \
    --to=clg@kaod.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.