* [PATCH] Fix handling of AVR interrupts above 33.
@ 2023-06-13 19:34 Lucas Dietrich
2023-06-14 4:32 ` Richard Henderson
0 siblings, 1 reply; 7+ messages in thread
From: Lucas Dietrich @ 2023-06-13 19:34 UTC (permalink / raw)
To: philmd; +Cc: qemu-devel, mrolnik, qemu-trivial, Lucas Dietrich
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] Fix handling of AVR interrupts above 33.
2023-06-13 19:34 Lucas Dietrich
@ 2023-06-14 4:32 ` Richard Henderson
0 siblings, 0 replies; 7+ messages in thread
From: Richard Henderson @ 2023-06-14 4:32 UTC (permalink / raw)
To: Lucas Dietrich, philmd; +Cc: qemu-devel, mrolnik, qemu-trivial
On 6/13/23 21:34, Lucas Dietrich wrote:
> 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>
The change to target/avr/ looks right, but you shouldn't have all the subproject changes.
r~
> ---
> 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Fix handling of AVR interrupts above 33.
2023-06-14 14:07 [PATCH] Fix handling of AVR interrupts above 33 Lucas Dietrich
@ 2023-06-14 12:22 ` Philippe Mathieu-Daudé
2023-06-14 12:29 ` Michael Rolnik
2023-06-18 6:56 ` Michael Tokarev
1 sibling, 1 reply; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-06-14 12:22 UTC (permalink / raw)
To: Lucas Dietrich; +Cc: qemu-devel, mrolnik, qemu-trivial
On 14/6/23 16:07, Lucas Dietrich wrote:
> 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>
> ---
> target/avr/helper.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Thanks for insisting with the patch posting process :)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Fix handling of AVR interrupts above 33.
2023-06-14 12:22 ` Philippe Mathieu-Daudé
@ 2023-06-14 12:29 ` Michael Rolnik
0 siblings, 0 replies; 7+ messages in thread
From: Michael Rolnik @ 2023-06-14 12:29 UTC (permalink / raw)
To: Philippe Mathieu-Daudé; +Cc: Lucas Dietrich, qemu-devel, qemu-trivial
[-- Attachment #1: Type: text/plain, Size: 894 bytes --]
Reviewed-by: Michael Rolnik <mrolnik@gmail.com>
On Wed, Jun 14, 2023 at 3:22 PM Philippe Mathieu-Daudé <philmd@linaro.org>
wrote:
> On 14/6/23 16:07, Lucas Dietrich wrote:
> > 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>
> > ---
> > target/avr/helper.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
>
> Thanks for insisting with the patch posting process :)
>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>
>
--
Best Regards,
Michael Rolnik
[-- Attachment #2: Type: text/html, Size: 1532 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] Fix handling of AVR interrupts above 33.
@ 2023-06-14 14:07 Lucas Dietrich
2023-06-14 12:22 ` Philippe Mathieu-Daudé
2023-06-18 6:56 ` Michael Tokarev
0 siblings, 2 replies; 7+ messages in thread
From: Lucas Dietrich @ 2023-06-14 14:07 UTC (permalink / raw)
To: philmd; +Cc: qemu-devel, mrolnik, qemu-trivial, Lucas Dietrich
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>
---
target/avr/helper.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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)) {
--
2.40.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] Fix handling of AVR interrupts above 33.
2023-06-14 14:07 [PATCH] Fix handling of AVR interrupts above 33 Lucas Dietrich
2023-06-14 12:22 ` Philippe Mathieu-Daudé
@ 2023-06-18 6:56 ` Michael Tokarev
2023-06-18 10:27 ` Philippe Mathieu-Daudé
1 sibling, 1 reply; 7+ messages in thread
From: Michael Tokarev @ 2023-06-18 6:56 UTC (permalink / raw)
To: Lucas Dietrich, philmd; +Cc: qemu-devel, mrolnik, qemu-trivial
Applied to the trivial tree, thank you!
/mjt
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Fix handling of AVR interrupts above 33.
2023-06-18 6:56 ` Michael Tokarev
@ 2023-06-18 10:27 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-06-18 10:27 UTC (permalink / raw)
To: Michael Tokarev, Lucas Dietrich; +Cc: qemu-devel, mrolnik, qemu-trivial
On 18/6/23 08:56, Michael Tokarev wrote:
> Applied to the trivial tree, thank you!
Thanks. Do you mind updating the patch subject to:
"target/avr: Fix handling of interrupts above 33"?
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-06-18 10:28 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-14 14:07 [PATCH] Fix handling of AVR interrupts above 33 Lucas Dietrich
2023-06-14 12:22 ` Philippe Mathieu-Daudé
2023-06-14 12:29 ` Michael Rolnik
2023-06-18 6:56 ` Michael Tokarev
2023-06-18 10:27 ` Philippe Mathieu-Daudé
-- strict thread matches above, loose matches on Subject: below --
2023-06-13 19:34 Lucas Dietrich
2023-06-14 4:32 ` Richard Henderson
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).