[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 32/40] openpic: Accelerate pending irq search
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 32/40] openpic: Accelerate pending irq search |
Date: |
Fri, 14 Dec 2012 13:13:48 +0100 |
When we're done with one interrupt, we need to search for the next pending
interrupt in the queue. This search has grown quite big now that we have
more than 256 possible irq lines.
So let's memorize how many interrupts we have pending in our bitmaps, so
that we can always bail out in the usual case - the one where we're all done.
Signed-off-by: Alexander Graf <address@hidden>
---
hw/openpic.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/hw/openpic.c b/hw/openpic.c
index 25d5cd7..3cbcea8 100644
--- a/hw/openpic.c
+++ b/hw/openpic.c
@@ -169,6 +169,7 @@ typedef struct IRQ_queue_t {
uint32_t queue[BF_WIDTH(MAX_IRQ)];
int next;
int priority;
+ int pending; /* nr of pending bits in queue */
} IRQ_queue_t;
typedef struct IRQ_src_t {
@@ -251,11 +252,13 @@ static void openpic_irq_raise(OpenPICState *opp, int
n_CPU, IRQ_src_t *src);
static inline void IRQ_setbit(IRQ_queue_t *q, int n_IRQ)
{
+ q->pending++;
set_bit(q->queue, n_IRQ);
}
static inline void IRQ_resetbit(IRQ_queue_t *q, int n_IRQ)
{
+ q->pending--;
reset_bit(q->queue, n_IRQ);
}
@@ -271,6 +274,12 @@ static void IRQ_check(OpenPICState *opp, IRQ_queue_t *q)
next = -1;
priority = -1;
+
+ if (!q->pending) {
+ /* IRQ bitmap is empty */
+ goto out;
+ }
+
for (i = 0; i < opp->max_irq; i++) {
if (IRQ_testbit(q, i)) {
DPRINTF("IRQ_check: irq %d set ipvp_pr=%d pr=%d\n",
@@ -281,6 +290,8 @@ static void IRQ_check(OpenPICState *opp, IRQ_queue_t *q)
}
}
}
+
+out:
q->next = next;
q->priority = priority;
}
--
1.6.0.2
- [Qemu-devel] [PATCH 33/40] PPC: E500: PCI: Make first slot qdev settable, (continued)
- [Qemu-devel] [PATCH 33/40] PPC: E500: PCI: Make first slot qdev settable, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 25/40] openpic: convert to qdev, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 39/40] target-ppc: Don't use hwaddr to represent hardware state, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 10/40] Adding BAR0 for e500 PCI controller, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 22/40] openpic: convert simple reg operations to builtin bitops, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 26/40] openpic: make brr1 model specific, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 23/40] openpic: rename openpic_t to OpenPICState, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 04/40] pseries: Allow RTAS tokens without a qemu handler, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 30/40] MSI-X: Fix endianness, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 32/40] openpic: Accelerate pending irq search,
Alexander Graf <=
- [Qemu-devel] [PATCH 29/40] PPC: e500: Declare pci bridge as bridge, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 13/40] mpic: Unify numbering scheme, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 40/40] pseries: Increase default NVRAM size, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 35/40] PPC: E500: Generate dt pci irq map dynamically, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 38/40] PPC: e500: pci: Export slot2irq calculation, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 24/40] openpic: remove irq_out, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 28/40] PPC: e500: Add MSI support, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 31/40] openpic: fix minor coding style issues, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 36/40] PPC: E500: Move PCI slot information into params, Alexander Graf, 2012/12/14
- [Qemu-devel] [PATCH 02/40] pseries: Use #define for XICS base irq number, Alexander Graf, 2012/12/14