aboutsummaryrefslogtreecommitdiff
path: root/target/avr
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2022-08-26 13:35:52 -0700
committerRichard Henderson <richard.henderson@linaro.org>2022-09-01 06:41:57 +0100
commitcecaad540155927f2faf1b6897c72cc59074cb45 (patch)
tree171708dbb09c6e6fa707b85ed46b3c0d2406e770 /target/avr
parent9e1b2375daabc4d133baf08766676c5d301bade5 (diff)
downloadqemu-cecaad540155927f2faf1b6897c72cc59074cb45.zip
qemu-cecaad540155927f2faf1b6897c72cc59074cb45.tar.gz
qemu-cecaad540155927f2faf1b6897c72cc59074cb45.tar.bz2
target/avr: Only execute one interrupt at a time
We cannot deliver two interrupts simultaneously; the first interrupt handler must execute first. Reviewed-by: Michael Rolnik <mrolnik@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/avr')
-rw-r--r--target/avr/helper.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/target/avr/helper.c b/target/avr/helper.c
index 9614ccf..34f1cbf 100644
--- a/target/avr/helper.c
+++ b/target/avr/helper.c
@@ -28,7 +28,6 @@
bool avr_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
{
- bool ret = false;
AVRCPU *cpu = AVR_CPU(cs);
CPUAVRState *env = &cpu->env;
@@ -38,8 +37,7 @@ bool avr_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
avr_cpu_do_interrupt(cs);
cs->interrupt_request &= ~CPU_INTERRUPT_RESET;
-
- ret = true;
+ return true;
}
}
if (interrupt_request & CPU_INTERRUPT_HARD) {
@@ -52,11 +50,10 @@ bool avr_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
if (!env->intsrc) {
cs->interrupt_request &= ~CPU_INTERRUPT_HARD;
}
-
- ret = true;
+ return true;
}
}
- return ret;
+ return false;
}
void avr_cpu_do_interrupt(CPUState *cs)