[PATCH 07/17] target/avr: Use do_stb in avr_cpu_do_interrupt

Richard Henderson posted 17 patches 1 week, 1 day ago
There is a newer version of this series
[PATCH 07/17] target/avr: Use do_stb in avr_cpu_do_interrupt
Posted by Richard Henderson 1 week, 1 day ago
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/avr/helper.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/target/avr/helper.c b/target/avr/helper.c
index 7cfd3d1093..9608e59584 100644
--- a/target/avr/helper.c
+++ b/target/avr/helper.c
@@ -88,14 +88,14 @@ void avr_cpu_do_interrupt(CPUState *cs)
     }
 
     if (avr_feature(env, AVR_FEATURE_3_BYTE_PC)) {
-        cpu_stb_data(env, env->sp--, (ret & 0x0000ff));
-        cpu_stb_data(env, env->sp--, (ret & 0x00ff00) >> 8);
-        cpu_stb_data(env, env->sp--, (ret & 0xff0000) >> 16);
+        do_stb(env, env->sp--, ret, 0);
+        do_stb(env, env->sp--, ret >> 8, 0);
+        do_stb(env, env->sp--, ret >> 16, 0);
     } else if (avr_feature(env, AVR_FEATURE_2_BYTE_PC)) {
-        cpu_stb_data(env, env->sp--, (ret & 0x0000ff));
-        cpu_stb_data(env, env->sp--, (ret & 0x00ff00) >> 8);
+        do_stb(env, env->sp--, ret, 0);
+        do_stb(env, env->sp--, ret >> 8, 0);
     } else {
-        cpu_stb_data(env, env->sp--, (ret & 0x0000ff));
+        do_stb(env, env->sp--, ret, 0);
     }
 
     env->pc_w = base + vector * size;
-- 
2.43.0
Re: [PATCH 07/17] target/avr: Use do_stb in avr_cpu_do_interrupt
Posted by Pierrick Bouvier 1 week ago
On 3/23/25 10:37, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   target/avr/helper.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/target/avr/helper.c b/target/avr/helper.c
> index 7cfd3d1093..9608e59584 100644
> --- a/target/avr/helper.c
> +++ b/target/avr/helper.c
> @@ -88,14 +88,14 @@ void avr_cpu_do_interrupt(CPUState *cs)
>       }
>   
>       if (avr_feature(env, AVR_FEATURE_3_BYTE_PC)) {
> -        cpu_stb_data(env, env->sp--, (ret & 0x0000ff));
> -        cpu_stb_data(env, env->sp--, (ret & 0x00ff00) >> 8);
> -        cpu_stb_data(env, env->sp--, (ret & 0xff0000) >> 16);
> +        do_stb(env, env->sp--, ret, 0);
> +        do_stb(env, env->sp--, ret >> 8, 0);
> +        do_stb(env, env->sp--, ret >> 16, 0);
>       } else if (avr_feature(env, AVR_FEATURE_2_BYTE_PC)) {
> -        cpu_stb_data(env, env->sp--, (ret & 0x0000ff));
> -        cpu_stb_data(env, env->sp--, (ret & 0x00ff00) >> 8);
> +        do_stb(env, env->sp--, ret, 0);
> +        do_stb(env, env->sp--, ret >> 8, 0);
>       } else {
> -        cpu_stb_data(env, env->sp--, (ret & 0x0000ff));
> +        do_stb(env, env->sp--, ret, 0);
>       }
>   
>       env->pc_w = base + vector * size;

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Re: [PATCH 07/17] target/avr: Use do_stb in avr_cpu_do_interrupt
Posted by Philippe Mathieu-Daudé 1 week, 1 day ago
On 23/3/25 18:37, Richard Henderson wrote:
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   target/avr/helper.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>