[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 25/32] xics: Add xics_find_source()
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PULL 25/32] xics: Add xics_find_source() |
Date: |
Fri, 27 Jun 2014 13:52:17 +0200 |
From: Alexey Kardashevskiy <address@hidden>
PAPR allows having multiple interrupt sources such as PHB.
This adds a source lookup function and makes use of it.
Since at the moment QEMU only supports a single source,
no change in behaviour is expected.
Signed-off-by: Alexey Kardashevskiy <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
hw/intc/xics.c | 30 +++++++++++++++++++++++++-----
1 file changed, 25 insertions(+), 5 deletions(-)
diff --git a/hw/intc/xics.c b/hw/intc/xics.c
index 5220d4f..c02feaf 100644
--- a/hw/intc/xics.c
+++ b/hw/intc/xics.c
@@ -633,14 +633,32 @@ static const TypeInfo ics_info = {
/*
* Exported functions
*/
+static int xics_find_source(XICSState *icp, int irq)
+{
+ int sources = 1;
+ int src;
+
+ /* FIXME: implement multiple sources */
+ for (src = 0; src < sources; ++src) {
+ ICSState *ics = &icp->ics[src];
+ if (ics_valid_irq(ics, irq)) {
+ return src;
+ }
+ }
+
+ return -1;
+}
qemu_irq xics_get_qirq(XICSState *icp, int irq)
{
- if (!ics_valid_irq(icp->ics, irq)) {
- return NULL;
+ int src = xics_find_source(icp, irq);
+
+ if (src >= 0) {
+ ICSState *ics = &icp->ics[src];
+ return ics->qirqs[irq - ics->offset];
}
- return icp->ics->qirqs[irq - icp->ics->offset];
+ return NULL;
}
static void ics_set_irq_type(ICSState *ics, int srcno, bool lsi)
@@ -653,10 +671,12 @@ static void ics_set_irq_type(ICSState *ics, int srcno,
bool lsi)
void xics_set_irq_type(XICSState *icp, int irq, bool lsi)
{
- ICSState *ics = icp->ics;
+ int src = xics_find_source(icp, irq);
+ ICSState *ics;
- assert(ics_valid_irq(ics, irq));
+ assert(src >= 0);
+ ics = &icp->ics[src];
ics_set_irq_type(ics, irq - ics->offset, lsi);
}
--
1.8.1.4
- [Qemu-devel] [PULL 17/32] target-ppc: Add support for POWER8 pvr 0x4D0000, (continued)
- [Qemu-devel] [PULL 17/32] target-ppc: Add support for POWER8 pvr 0x4D0000, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 18/32] spapr: Fix code design style (s/SPAPRMachine/sPAPRMachineState), Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 05/32] spapr: Add "qemu, boot-menu" property to /chosen, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 04/32] linux-user: Support HWCAP2 in PowerPC, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 08/32] spapr: Fix RTAS token numbers, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 07/32] PPC: Add support for Apple gdb in gdbstub, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 15/32] mac99: Add motherboard devices before PCI cards, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 22/32] spapr: Add RTAS sysparm UUID, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 19/32] spapr: Define a 2.1 pseries machine, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 10/32] vfio: Add vfio_container_ioctl(), Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 25/32] xics: Add xics_find_source(),
Alexander Graf <=
- [Qemu-devel] [PULL 29/32] xics: Implement xics_ics_free(), Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 32/32] PPC: e500: Only create dt entries for existing serial ports, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 21/32] spapr: Fix RTAS sysparm DIAGNOSTICS_RUN_MODE, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 24/32] xics: Add flags for interrupts, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 26/32] xics: Disable flags reset on xics reset, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 16/32] uninorth: Fix PCI hole size, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 06/32] target-ppc: fixed translation of mcrxr instruction, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 31/32] spapr_pci: Use XICS interrupt allocator and do not cache interrupts in PHB, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 28/32] spapr: Remove @next_irq, Alexander Graf, 2014/06/27
- [Qemu-devel] [PULL 20/32] spapr: Add rtas_st_buffer utility function, Alexander Graf, 2014/06/27