[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 05/25] spapr: introduce a spapr_irq_set() helper
From: |
Cédric Le Goater |
Subject: |
[Qemu-ppc] [PATCH 05/25] spapr: introduce a spapr_irq_set() helper |
Date: |
Thu, 23 Nov 2017 14:29:35 +0100 |
It will make synchronisation easier with the XIVE interrupt mode when
available. The 'irq' parameter refers to the global IRQ number space.
Signed-off-by: Cédric Le Goater <address@hidden>
---
hw/ppc/spapr.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 7ae84d40bdb4..79f38a9ff4e1 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3594,6 +3594,11 @@ static int ics_find_free_block(ICSState *ics, int num,
int alignnum)
return -1;
}
+static void spapr_irq_set(sPAPRMachineState *spapr, int irq, bool lsi)
+{
+ ics_set_irq_type(spapr->ics, irq - spapr->ics->offset, lsi);
+}
+
int spapr_irq_alloc(sPAPRMachineState *spapr, int irq_hint, bool lsi,
Error **errp)
{
@@ -3618,7 +3623,7 @@ int spapr_irq_alloc(sPAPRMachineState *spapr, int
irq_hint, bool lsi,
irq += ics->offset;
}
- ics_set_irq_type(ics, irq - ics->offset, lsi);
+ spapr_irq_set(spapr, irq, lsi);
trace_spapr_irq_alloc(irq);
return irq;
@@ -3657,10 +3662,10 @@ int spapr_irq_alloc_block(sPAPRMachineState *spapr, int
num, bool lsi,
return -1;
}
+ first += ics->offset;
for (i = first; i < first + num; ++i) {
- ics_set_irq_type(ics, i, lsi);
+ spapr_irq_set(spapr, i, lsi);
}
- first += ics->offset;
trace_spapr_irq_alloc_block(first, num, lsi, align);
--
2.13.6
- [Qemu-ppc] [PATCH 02/25] ppc/xics: assign of the CPU 'intc' pointer under the core, (continued)
- [Qemu-ppc] [PATCH 04/25] spapr: move the IRQ allocation routines under the machine, Cédric Le Goater, 2017/11/23
- [Qemu-ppc] [PATCH 05/25] spapr: introduce a spapr_irq_set() helper,
Cédric Le Goater <=
- [Qemu-ppc] [PATCH 06/25] spapr: introduce a spapr_irq_get_qirq() helper, Cédric Le Goater, 2017/11/23
- [Qemu-ppc] [PATCH 07/25] migration: add VMSTATE_STRUCT_VARRAY_UINT32_ALLOC, Cédric Le Goater, 2017/11/23
- [Qemu-ppc] [PATCH 08/25] spapr: introduce a skeleton for the XIVE interrupt controller, Cédric Le Goater, 2017/11/23