qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix handling of AVR interrupts above 33.


From: Lucas Dietrich
Subject: [PATCH] Fix handling of AVR interrupts above 33.
Date: Tue, 13 Jun 2023 21:34:46 +0200

This commit addresses a bug in the AVR interrupt handling code.
The modification involves replacing the usage of the ctz32 function
with ctz64 to ensure proper handling of interrupts above 33 in the AVR
target.

Previously, timers 3, 4, and 5 interrupts were not functioning correctly
because most of their interrupt vectors are numbered above 33.

Signed-off-by: Lucas Dietrich <ld.adecy@gmail.com>
---
 capstone                      | 1 +
 dtc                           | 1 +
 meson                         | 1 +
 roms/sgabios                  | 1 +
 slirp                         | 1 +
 target/avr/helper.c           | 4 ++--
 tests/fp/berkeley-softfloat-3 | 1 +
 tests/fp/berkeley-testfloat-3 | 1 +
 ui/keycodemapdb               | 1 +
 9 files changed, 10 insertions(+), 2 deletions(-)
 create mode 160000 capstone
 create mode 160000 dtc
 create mode 160000 meson
 create mode 160000 roms/sgabios
 create mode 160000 slirp
 create mode 160000 tests/fp/berkeley-softfloat-3
 create mode 160000 tests/fp/berkeley-testfloat-3
 create mode 160000 ui/keycodemapdb

diff --git a/capstone b/capstone
new file mode 160000
index 0000000000..f8b1b83301
--- /dev/null
+++ b/capstone
@@ -0,0 +1 @@
+Subproject commit f8b1b833015a4ae47110ed068e0deb7106ced66d
diff --git a/dtc b/dtc
new file mode 160000
index 0000000000..b6910bec11
--- /dev/null
+++ b/dtc
@@ -0,0 +1 @@
+Subproject commit b6910bec11614980a21e46fbccc35934b671bd81
diff --git a/meson b/meson
new file mode 160000
index 0000000000..12f9f04ba0
--- /dev/null
+++ b/meson
@@ -0,0 +1 @@
+Subproject commit 12f9f04ba0decfda425dbbf9a501084c153a2d18
diff --git a/roms/sgabios b/roms/sgabios
new file mode 160000
index 0000000000..cbaee52287
--- /dev/null
+++ b/roms/sgabios
@@ -0,0 +1 @@
+Subproject commit cbaee52287e5f32373181cff50a00b6c4ac9015a
diff --git a/slirp b/slirp
new file mode 160000
index 0000000000..a88d9ace23
--- /dev/null
+++ b/slirp
@@ -0,0 +1 @@
+Subproject commit a88d9ace234a24ce1c17189642ef9104799425e0
diff --git a/target/avr/helper.c b/target/avr/helper.c
index 2bad242a66..e6e7d51487 100644
--- a/target/avr/helper.c
+++ b/target/avr/helper.c
@@ -52,7 +52,7 @@ bool avr_cpu_exec_interrupt(CPUState *cs, int 
interrupt_request)
     }
     if (interrupt_request & CPU_INTERRUPT_HARD) {
         if (cpu_interrupts_enabled(env) && env->intsrc != 0) {
-            int index = ctz32(env->intsrc);
+            int index = ctz64(env->intsrc);
             cs->exception_index = EXCP_INT(index);
             avr_cpu_do_interrupt(cs);
 
@@ -79,7 +79,7 @@ void avr_cpu_do_interrupt(CPUState *cs)
     if (cs->exception_index == EXCP_RESET) {
         vector = 0;
     } else if (env->intsrc != 0) {
-        vector = ctz32(env->intsrc) + 1;
+        vector = ctz64(env->intsrc) + 1;
     }
 
     if (avr_feature(env, AVR_FEATURE_3_BYTE_PC)) {
diff --git a/tests/fp/berkeley-softfloat-3 b/tests/fp/berkeley-softfloat-3
new file mode 160000
index 0000000000..b64af41c32
--- /dev/null
+++ b/tests/fp/berkeley-softfloat-3
@@ -0,0 +1 @@
+Subproject commit b64af41c3276f97f0e181920400ee056b9c88037
diff --git a/tests/fp/berkeley-testfloat-3 b/tests/fp/berkeley-testfloat-3
new file mode 160000
index 0000000000..5a59dcec19
--- /dev/null
+++ b/tests/fp/berkeley-testfloat-3
@@ -0,0 +1 @@
+Subproject commit 5a59dcec19327396a011a17fd924aed4fec416b3
diff --git a/ui/keycodemapdb b/ui/keycodemapdb
new file mode 160000
index 0000000000..d21009b1c9
--- /dev/null
+++ b/ui/keycodemapdb
@@ -0,0 +1 @@
+Subproject commit d21009b1c9f94b740ea66be8e48a1d8ad8124023
-- 
2.40.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]