[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH v6 14/37] spapr: modify the irq backend 'init' method
From: |
Cédric Le Goater |
Subject: |
[Qemu-ppc] [PATCH v6 14/37] spapr: modify the irq backend 'init' method |
Date: |
Thu, 6 Dec 2018 00:22:28 +0100 |
Add a 'nr_irqs' parameter to the 'init' method to remove the use of
the machine class. This will be useful when we introduce the machine
supporting the two sPAPR IRQ backends : XICS and XIVE.
Signed-off-by: Cédric Le Goater <address@hidden>
---
include/hw/ppc/spapr_irq.h | 2 +-
hw/ppc/spapr_irq.c | 7 +++----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/include/hw/ppc/spapr_irq.h b/include/hw/ppc/spapr_irq.h
index bd7301e6d9c6..0e9229bf219e 100644
--- a/include/hw/ppc/spapr_irq.h
+++ b/include/hw/ppc/spapr_irq.h
@@ -33,7 +33,7 @@ typedef struct sPAPRIrq {
uint32_t nr_irqs;
uint32_t nr_msis;
- void (*init)(sPAPRMachineState *spapr, Error **errp);
+ void (*init)(sPAPRMachineState *spapr, int nr_irqs, Error **errp);
int (*claim)(sPAPRMachineState *spapr, int irq, bool lsi, Error **errp);
void (*free)(sPAPRMachineState *spapr, int irq, int num);
qemu_irq (*qirq)(sPAPRMachineState *spapr, int irq);
diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c
index f8b651de0ec9..bac450ffff23 100644
--- a/hw/ppc/spapr_irq.c
+++ b/hw/ppc/spapr_irq.c
@@ -90,11 +90,10 @@ error:
return NULL;
}
-static void spapr_irq_init_xics(sPAPRMachineState *spapr, Error **errp)
+static void spapr_irq_init_xics(sPAPRMachineState *spapr, int nr_irqs,
+ Error **errp)
{
MachineState *machine = MACHINE(spapr);
- sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
- int nr_irqs = smc->irq->nr_irqs;
Error *local_err = NULL;
if (kvm_enabled()) {
@@ -217,7 +216,7 @@ void spapr_irq_init(sPAPRMachineState *spapr, Error **errp)
spapr_irq_msi_init(spapr, smc->irq->nr_msis);
}
- smc->irq->init(spapr, errp);
+ smc->irq->init(spapr, smc->irq->nr_irqs, errp);
}
int spapr_irq_claim(sPAPRMachineState *spapr, int irq, bool lsi, Error **errp)
--
2.17.2
- [Qemu-ppc] [PATCH v6 07/37] ppc/xive: introduce the XIVE interrupt thread context, (continued)
- [Qemu-ppc] [PATCH v6 09/37] ppc/xive: notify the CPU when the interrupt priority is more privileged, Cédric Le Goater, 2018/12/05
- [Qemu-ppc] [PATCH v6 12/37] spapr: initialize VSMT before initializing the IRQ backend, Cédric Le Goater, 2018/12/05
- [Qemu-ppc] [PATCH v6 14/37] spapr: modify the irq backend 'init' method,
Cédric Le Goater <=
- [Qemu-ppc] [PATCH v6 10/37] spapr/xive: introduce a XIVE interrupt controller, Cédric Le Goater, 2018/12/05
- [Qemu-ppc] [PATCH v6 13/37] spapr: introduce a spapr_irq_init() routine, Cédric Le Goater, 2018/12/05
- [Qemu-ppc] [PATCH v6 15/37] spapr: export and rename the xics_max_server_number() routine, Cédric Le Goater, 2018/12/05
- [Qemu-ppc] [PATCH v6 11/37] spapr/xive: use the VCPU id as a NVT identifier, Cédric Le Goater, 2018/12/05
- [Qemu-ppc] [PATCH v6 16/37] spapr: introdude a new machine IRQ backend for XIVE, Cédric Le Goater, 2018/12/05