Signed-off-by: Brendan Fennell <[email protected]>
---
hw/pl190.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/hw/pl190.c b/hw/pl190.c
index cb50afb..eddb531 100644
--- a/hw/pl190.c
+++ b/hw/pl190.c
@@ -120,7 +120,8 @@ static uint64_t pl190_read(void *opaque, target_phys_addr_t
offset,
current priority level to that of the current interrupt. */
for (i = 0; i < s->priority; i++)
{
- if ((s->level | s->soft_level) & s->prio_mask[i])
+ /* Ensure that 'i' is current highest priority interrupt on exit */
+ if ((s->level | s->soft_level) & s->prio_mask[i+1])
break;
}
/* Reading this value with no pending interrupts is undefined.
--
1.7.2.5