summaryrefslogtreecommitdiffstats
path: root/include/hw/ppc/spapr.h
diff options
context:
space:
mode:
authorCédric Le Goater2018-06-18 19:34:00 +0200
committerDavid Gibson2018-06-21 13:22:53 +0200
commit4fe75a8ccd8005f8d0322c5b85ebee6243b2e753 (patch)
tree0c92f857ae9de3c5d01b04c15d227875bbeb46ed /include/hw/ppc/spapr.h
parenttarget/ppc: Add kvmppc_hpt_needs_host_contiguous_pages() helper (diff)
downloadqemu-4fe75a8ccd8005f8d0322c5b85ebee6243b2e753.tar.gz
qemu-4fe75a8ccd8005f8d0322c5b85ebee6243b2e753.tar.xz
qemu-4fe75a8ccd8005f8d0322c5b85ebee6243b2e753.zip
spapr: split the IRQ allocation sequence
Today, when a device requests for IRQ number in a sPAPR machine, the spapr_irq_alloc() routine first scans the ICSState status array to find an empty slot and then performs the assignement of the selected numbers. Split this sequence in two distinct routines : spapr_irq_find() for lookups and spapr_irq_claim() for claiming the IRQ numbers. This will ease the introduction of a static layout of IRQ numbers. Signed-off-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'include/hw/ppc/spapr.h')
-rw-r--r--include/hw/ppc/spapr.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 9dd46a72f6..6bfdf5a2fb 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -776,6 +776,10 @@ int spapr_irq_alloc(sPAPRMachineState *spapr, int irq_hint, bool lsi,
Error **errp);
int spapr_irq_alloc_block(sPAPRMachineState *spapr, int num, bool lsi,
bool align, Error **errp);
+int spapr_irq_find(sPAPRMachineState *spapr, int num, bool align,
+ Error **errp);
+#define spapr_irq_findone(spapr, errp) spapr_irq_find(spapr, 1, false, errp)
+int spapr_irq_claim(sPAPRMachineState *spapr, int irq, bool lsi, Error **errp);
void spapr_irq_free(sPAPRMachineState *spapr, int irq, int num);
qemu_irq spapr_qirq(sPAPRMachineState *spapr, int irq);