Skip to contentSkip to conversation

target/avr: Fix interrupt execution

PATCH New Arkadiy 1 participant 1 message Mar 12, 2021

lore
Share & tools
lore

Arkadiy

author
#0 lore raw

PATCH 1/1 target/avr: Fix interrupt execution

From: NDNF <[email protected]>

Only one interrupt is in progress at the moment.It is necessary to set to reset interrupt_request only after all interrupts have been executed

---
 target/avr/helper.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
target/avr/helper.c +3 -1
index 65880b9928..9f20cc198e 100644
@@ -49,7 +49,9 @@ bool avr_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
             cc->tcg_ops->do_interrupt(cs);
 
             env->intsrc &= env->intsrc - 1; /* clear the interrupt */
-            cs->interrupt_request &= ~CPU_INTERRUPT_HARD;
+            if (!env->intsrc) {
+                cs->interrupt_request &= ~CPU_INTERRUPT_HARD;
+            }
 
             ret = true;
         }
Signature · 1 line
2.17.1