diff mbox

[Bug,1668103] Re: Possible off-by-one error in priority handling of hw/PL190.c

Message ID 285146688.73855.1488143914060@communicator.strato.de
State New
Headers show

Commit Message

Marc Bommert Feb. 26, 2017, 9:18 p.m. UTC
From 0cd0c1346f9adb7b90df3e4e30a5904eeda33bfa Mon Sep 17 00:00:00 2001
From: Marc Bommert <marc@brightwise.de>
Date: Sun, 26 Feb 2017 22:08:49 +0100
Subject: [PATCH] Fix off-by-one error in priority handling when reading
 VECTADDR: Also, if enabled, have the "current" priority bit (1<<i) set in
 s->prio_mask[i].

Signed-off-by: Marc Bommert <marc@brightwise.de>
---
 hw/intc/pl190.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.5.0
diff mbox

Patch

diff --git a/hw/intc/pl190.c b/hw/intc/pl190.c
index 55ea15d..0369da8 100644
--- a/hw/intc/pl190.c
+++ b/hw/intc/pl190.c
@@ -80,12 +80,12 @@  static void pl190_update_vectors(PL190State *s)
     mask = 0;
     for (i = 0; i < 16; i++)
       {
-        s->prio_mask[i] = mask;
         if (s->vect_control[i] & 0x20)
           {
             n = s->vect_control[i] & 0x1f;
             mask |= 1 << n;
           }
+        s->prio_mask[i] = mask;
       }
     s->prio_mask[16] = mask;
     pl190_update(s);