[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 20/20] hw/intc: ibex_plic: Honour source priorities
From: |
Alistair Francis |
Subject: |
[PULL v2 20/20] hw/intc: ibex_plic: Honour source priorities |
Date: |
Fri, 14 Aug 2020 08:05:06 -0700 |
This patch follows what commit aa4d30f6618dc "riscv: plic: Honour source
priorities" does and ensures that the highest priority interrupt will be
serviced first.
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Cc: Jessica Clarke <jrtc27@jrtc27.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id:
<a697ca8a31eff8eb18a88e09a28206063cf85d48.1595655188.git.alistair.francis@wdc.com>
---
hw/intc/ibex_plic.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/hw/intc/ibex_plic.c b/hw/intc/ibex_plic.c
index 669247ef08..f49fa67c91 100644
--- a/hw/intc/ibex_plic.c
+++ b/hw/intc/ibex_plic.c
@@ -57,6 +57,8 @@ static void ibex_plic_irqs_set_pending(IbexPlicState *s, int
irq, bool level)
static bool ibex_plic_irqs_pending(IbexPlicState *s, uint32_t context)
{
int i;
+ uint32_t max_irq = 0;
+ uint32_t max_prio = s->threshold;
for (i = 0; i < s->pending_num; i++) {
uint32_t irq_num = ctz64(s->pending[i]) + (i * 32);
@@ -66,14 +68,17 @@ static bool ibex_plic_irqs_pending(IbexPlicState *s,
uint32_t context)
continue;
}
- if (s->priority[irq_num] > s->threshold) {
- if (!s->claim) {
- s->claim = irq_num;
- }
- return true;
+ if (s->priority[irq_num] > max_prio) {
+ max_irq = irq_num;
+ max_prio = s->priority[irq_num];
}
}
+ if (max_irq) {
+ s->claim = max_irq;
+ return true;
+ }
+
return false;
}
--
2.27.0
- [PULL v2 04/20] target/riscv: Check nanboxed inputs to fp helpers, (continued)
- [PULL v2 04/20] target/riscv: Check nanboxed inputs to fp helpers, Alistair Francis, 2020/08/14
- [PULL v2 01/20] target/riscv: Generate nanboxed results from fp helpers, Alistair Francis, 2020/08/14
- [PULL v2 05/20] target/riscv: Check nanboxed inputs in trans_rvf.inc.c, Alistair Francis, 2020/08/14
- [PULL v2 16/20] target/riscv: Fix the translation of physical address, Alistair Francis, 2020/08/14
- [PULL v2 06/20] target/riscv: Clean up fmv.w.x, Alistair Francis, 2020/08/14
- [PULL v2 07/20] target/riscv: check before allocating TCG temps, Alistair Francis, 2020/08/14
- [PULL v2 17/20] target/riscv: Change the TLB page size depends on PMP entries., Alistair Francis, 2020/08/14
- [PULL v2 08/20] hw/riscv: sifive_u: Add a dummy L2 cache controller device, Alistair Francis, 2020/08/14
- [PULL v2 09/20] riscv: Fix bug in setting pmpcfg CSR for RISCV64, Alistair Francis, 2020/08/14
- [PULL v2 18/20] hw/intc: ibex_plic: Update the pending irqs, Alistair Francis, 2020/08/14
- [PULL v2 20/20] hw/intc: ibex_plic: Honour source priorities,
Alistair Francis <=
- [PULL v2 19/20] hw/intc: ibex_plic: Don't allow repeat interrupts on claimed lines, Alistair Francis, 2020/08/14
- [PULL v2 10/20] configure: Create symbolic links for pc-bios/*.elf files, Alistair Francis, 2020/08/14
- [PULL v2 11/20] roms/opensbi: Upgrade from v0.7 to v0.8, Alistair Francis, 2020/08/14
- [PULL v2 12/20] roms/Makefile: Build the generic platform for RISC-V OpenSBI firmware, Alistair Francis, 2020/08/14
- [PULL v2 13/20] hw/riscv: Use pre-built bios image of generic platform for virt & sifive_u, Alistair Francis, 2020/08/14
- [PULL v2 14/20] hw/riscv: spike: Change the default bios to use generic platform image, Alistair Francis, 2020/08/14
- Re: [PULL v2 00/20] riscv-to-apply queue, Peter Maydell, 2020/08/21