mirror of
https://github.com/qemu/qemu.git
synced 2024-12-19 10:13:43 +08:00
spapr_irq: Expose the phandle of the interrupt controller
This will be used by PHB hotplug in order to create the "interrupt-map" property of the PHB node. Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <155059669374.1466090.12943228478046223856.stgit@bahia.lab.toulouse-stg.fr.ibm.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
743ed566c1
commit
ad62bff638
@ -638,6 +638,27 @@ void spapr_irq_reset(sPAPRMachineState *spapr, Error **errp)
|
||||
}
|
||||
}
|
||||
|
||||
int spapr_irq_get_phandle(sPAPRMachineState *spapr, void *fdt, Error **errp)
|
||||
{
|
||||
const char *nodename = spapr->irq->get_nodename(spapr);
|
||||
int offset, phandle;
|
||||
|
||||
offset = fdt_subnode_offset(fdt, 0, nodename);
|
||||
if (offset < 0) {
|
||||
error_setg(errp, "Can't find node \"%s\": %s", nodename,
|
||||
fdt_strerror(offset));
|
||||
return -1;
|
||||
}
|
||||
|
||||
phandle = fdt_get_phandle(fdt, offset);
|
||||
if (!phandle) {
|
||||
error_setg(errp, "Can't get phandle of node \"%s\"", nodename);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return phandle;
|
||||
}
|
||||
|
||||
/*
|
||||
* XICS legacy routines - to deprecate one day
|
||||
*/
|
||||
|
@ -61,6 +61,7 @@ void spapr_irq_free(sPAPRMachineState *spapr, int irq, int num);
|
||||
qemu_irq spapr_qirq(sPAPRMachineState *spapr, int irq);
|
||||
int spapr_irq_post_load(sPAPRMachineState *spapr, int version_id);
|
||||
void spapr_irq_reset(sPAPRMachineState *spapr, Error **errp);
|
||||
int spapr_irq_get_phandle(sPAPRMachineState *spapr, void *fdt, Error **errp);
|
||||
|
||||
/*
|
||||
* XICS legacy routines
|
||||
|
Loading…
Reference in New Issue
Block a user