summaryrefslogtreecommitdiff
path: root/hw/spapr.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2011-09-15 20:49:49 +0000
committerAlexander Graf <agraf@suse.de>2011-10-06 09:48:09 +0200
commite6c866d417d1a09536f489e66c21cf49b7ec60b6 (patch)
tree70fc7c03c5616c7446f6a866ce31e87a7520fb34 /hw/spapr.h
parent44427c401f7c0053db31f40a58a427e1ae3cd8c3 (diff)
downloadqemu-e6c866d417d1a09536f489e66c21cf49b7ec60b6.tar.gz
qemu-e6c866d417d1a09536f489e66c21cf49b7ec60b6.tar.bz2
qemu-e6c866d417d1a09536f489e66c21cf49b7ec60b6.zip
pseries: Refactor spapr irq allocation
Paulo Bonzini changed the original spapr code, which manually assigned irq numbers for each virtual device, to allocate them automatically from the device initialization. That allowed spapr virtual devices to be constructed with -device, which is a good start. However, the way that patch worked doesn't extend nicely for the future when we want to support devices other than sPAPR VIO devices (e.g. virtio and PCI). This patch rearranges the irq allocation to be global across the sPAPR environment, so it can be used by other bus types as well. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/spapr.h')
-rw-r--r--hw/spapr.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/hw/spapr.h b/hw/spapr.h
index 3d21b7a1cc..ec910de5b0 100644
--- a/hw/spapr.h
+++ b/hw/spapr.h
@@ -17,6 +17,7 @@ typedef struct sPAPREnvironment {
long rtas_size;
void *fdt_skel;
target_ulong entry_point;
+ int next_irq;
} sPAPREnvironment;
#define H_SUCCESS 0
@@ -281,11 +282,7 @@ void spapr_register_hypercall(target_ulong opcode, spapr_hcall_fn fn);
target_ulong spapr_hypercall(CPUState *env, target_ulong opcode,
target_ulong *args);
-static inline qemu_irq spapr_find_qirq(sPAPREnvironment *spapr,
- int irq_num)
-{
- return xics_find_qirq(spapr->icp, irq_num);
-}
+qemu_irq spapr_allocate_irq(uint32_t hint, uint32_t *irq_num);
static inline uint32_t rtas_ld(target_ulong phys, int n)
{