qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/arm_gic: Correctly restore nested irq priority
@ 2015-11-17  9:12 Francois Baldassari
  2015-11-17 12:11 ` Peter Maydell
  0 siblings, 1 reply; 2+ messages in thread
From: Francois Baldassari @ 2015-11-17  9:12 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, qemu-arm

[-- Attachment #1: Type: text/plain, Size: 1219 bytes --]

Upon activating an interrupt, set the corresponding priority bit in the
APR/NSAPR registers without touching the currently set bits. In the event
of nested interrupts, the GIC will then have the information it needs to
restore the priority of the pre-empted interrupt once the higher priority
interrupt finishes execution.

Signed-off-by: François Baldassari <francois@pebble.com>
---
First time submitter here - I tried to follow
http://qemu-project.org/Contribute/SubmitAPatch as best I could but do let
me know if I missed anything.

 hw/intc/arm_gic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c
index d71aeb8..13e297d 100644
--- a/hw/intc/arm_gic.c
+++ b/hw/intc/arm_gic.c
@@ -254,9 +254,9 @@ static void gic_activate_irq(GICState *s, int cpu, int
irq)
     int bitno = preemption_level % 32;

     if (gic_has_groups(s) && GIC_TEST_GROUP(irq, (1 << cpu))) {
-        s->nsapr[regno][cpu] &= (1 << bitno);
+        s->nsapr[regno][cpu] |= (1 << bitno);
     } else {
-        s->apr[regno][cpu] &= (1 << bitno);
+        s->apr[regno][cpu] |= (1 << bitno);
     }

     s->running_priority[cpu] = prio;
-- 
2.4.0

[-- Attachment #2: Type: text/html, Size: 1576 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-17 12:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-17  9:12 [Qemu-devel] [PATCH] hw/arm_gic: Correctly restore nested irq priority Francois Baldassari
2015-11-17 12:11 ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).