qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Arkadiy <arkaisp2021@gmail.com>
To: qemu-devel@nongnu.org
Cc: NDNF <arkaisp2021@gmail.com>,
	S.E.Harris@kent.ac.uk, Arkasha <ivanovrkasha@gmail.com>,
	mrolnik@gmail.com, f4bug@amsat.org
Subject: [PATCH] target/avr: Fix interrupt execution
Date: Fri, 12 Mar 2021 19:47:54 +0300	[thread overview]
Message-ID: <20210312164754.18437-1-arkaisp2021@gmail.com> (raw)

From: NDNF <arkaisp2021@gmail.com>

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

Signed-off-by: Arkasha <ivanovrkasha@gmail.com>
---
 target/avr/helper.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/target/avr/helper.c b/target/avr/helper.c
index 65880b9928..9f20cc198e 100644
--- a/target/avr/helper.c
+++ b/target/avr/helper.c
@@ -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;
         }
-- 
2.17.1



                 reply	other threads:[~2021-03-12 19:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210312164754.18437-1-arkaisp2021@gmail.com \
    --to=arkaisp2021@gmail.com \
    --cc=S.E.Harris@kent.ac.uk \
    --cc=f4bug@amsat.org \
    --cc=ivanovrkasha@gmail.com \
    --cc=mrolnik@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).