mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
spapr: Move interrupt allocator to xics
The current allocator returns IRQ numbers from a pool and does not support IRQs reuse in any form as it did not keep track of what it previously returned, it only keeps the last returned IRQ. Some use cases such as PCI hot(un)plug may require IRQ release and reallocation. This moves an allocator from SPAPR to XICS. This switches IRQ users to use new API. This uses LSI/MSI flags to know if interrupt is allocated. The interrupt release function will be posted as a separate patch. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
a7e519a8cf
commit
bee763dbfb
8 changed files with 99 additions and 82 deletions
|
@ -339,16 +339,6 @@ target_ulong spapr_hypercall(PowerPCCPU *cpu, target_ulong opcode,
|
|||
int spapr_allocate_irq(int hint, bool lsi);
|
||||
int spapr_allocate_irq_block(int num, bool lsi, bool msi);
|
||||
|
||||
static inline int spapr_allocate_msi(int hint)
|
||||
{
|
||||
return spapr_allocate_irq(hint, false);
|
||||
}
|
||||
|
||||
static inline int spapr_allocate_lsi(int hint)
|
||||
{
|
||||
return spapr_allocate_irq(hint, true);
|
||||
}
|
||||
|
||||
/* RTAS return codes */
|
||||
#define RTAS_OUT_SUCCESS 0
|
||||
#define RTAS_OUT_NO_ERRORS_FOUND 1
|
||||
|
|
|
@ -160,6 +160,8 @@ struct ICSIRQState {
|
|||
|
||||
qemu_irq xics_get_qirq(XICSState *icp, int irq);
|
||||
void xics_set_irq_type(XICSState *icp, int irq, bool lsi);
|
||||
int xics_alloc(XICSState *icp, int src, int irq_hint, bool lsi);
|
||||
int xics_alloc_block(XICSState *icp, int src, int num, bool lsi, bool align);
|
||||
|
||||
void xics_cpu_setup(XICSState *icp, PowerPCCPU *cpu);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue