aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorCédric Le Goater <clg@kaod.org>2017-12-01 17:06:03 +0100
committerDavid Gibson <david@gibson.dropbear.id.au>2017-12-15 09:49:24 +1100
commit9e7dc5fc2e9d87a5492099de72800347e944e4ea (patch)
treee16b98a6715c8a5d1d85ea2828e53dcca99f067c /hw
parent60c6823b9bce6789f1ad95bca233fc490161b279 (diff)
downloadqemu-9e7dc5fc2e9d87a5492099de72800347e944e4ea.zip
qemu-9e7dc5fc2e9d87a5492099de72800347e944e4ea.tar.gz
qemu-9e7dc5fc2e9d87a5492099de72800347e944e4ea.tar.bz2
spapr: introduce a spapr_irq_set_lsi() helper
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 <clg@kaod.org> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw')
-rw-r--r--hw/ppc/spapr.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 53c2c58..02cc7ff 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3582,6 +3582,14 @@ static int ics_find_free_block(ICSState *ics, int num, int alignnum)
return -1;
}
+/*
+ * Allocate the IRQ number and set the IRQ type, LSI or MSI
+ */
+static void spapr_irq_set_lsi(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)
{
@@ -3606,7 +3614,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_lsi(spapr, irq, lsi);
trace_spapr_irq_alloc(irq);
return irq;
@@ -3645,10 +3653,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_lsi(spapr, i, lsi);
}
- first += ics->offset;
trace_spapr_irq_alloc_block(first, num, lsi, align);