qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] target/avr: Use vaddr type for $PC jumps
@ 2025-10-09 20:05 Philippe Mathieu-Daudé
  2025-10-09 21:42 ` Richard Henderson
  0 siblings, 1 reply; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-09 20:05 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael Rolnik, Anton Johansson, Pierrick Bouvier,
	Philippe Mathieu-Daudé

translator_use_goto_tb() expects a vaddr type since commit
b1c09220b4c ("accel/tcg: Replace target_ulong with vaddr in
translator*()").

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/avr/translate.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/target/avr/translate.c b/target/avr/translate.c
index 804b0b21dbd..20191055861 100644
--- a/target/avr/translate.c
+++ b/target/avr/translate.c
@@ -87,7 +87,7 @@ struct DisasContext {
     CPUAVRState *env;
     CPUState *cs;
 
-    target_long npc;
+    vaddr npc;
     uint32_t opcode;
 
     /* Routine used to access memory */
@@ -981,7 +981,7 @@ static void gen_pop_ret(DisasContext *ctx, TCGv ret)
     }
 }
 
-static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest)
+static void gen_goto_tb(DisasContext *ctx, int n, vaddr dest)
 {
     const TranslationBlock *tb = ctx->base.tb;
 
@@ -1004,7 +1004,7 @@ static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest)
  */
 static bool trans_RJMP(DisasContext *ctx, arg_RJMP *a)
 {
-    int dst = ctx->npc + a->imm;
+    vaddr dst = ctx->npc + a->imm;
 
     gen_goto_tb(ctx, 0, dst);
 
@@ -1072,8 +1072,8 @@ static bool trans_JMP(DisasContext *ctx, arg_JMP *a)
  */
 static bool trans_RCALL(DisasContext *ctx, arg_RCALL *a)
 {
-    int ret = ctx->npc;
-    int dst = ctx->npc + a->imm;
+    vaddr ret = ctx->npc;
+    vaddr dst = ctx->npc + a->imm;
 
     gen_push_ret(ctx, ret);
     gen_goto_tb(ctx, 0, dst);
@@ -1094,7 +1094,7 @@ static bool trans_ICALL(DisasContext *ctx, arg_ICALL *a)
         return true;
     }
 
-    int ret = ctx->npc;
+    vaddr ret = ctx->npc;
 
     gen_push_ret(ctx, ret);
     gen_jmp_z(ctx);
@@ -1136,8 +1136,8 @@ static bool trans_CALL(DisasContext *ctx, arg_CALL *a)
         return true;
     }
 
-    int Imm = a->imm;
-    int ret = ctx->npc;
+    vaddr Imm = a->imm;
+    vaddr ret = ctx->npc;
 
     gen_push_ret(ctx, ret);
     gen_goto_tb(ctx, 0, Imm);
@@ -2743,7 +2743,7 @@ static void avr_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
     }
 
     if (ctx->base.is_jmp == DISAS_NEXT) {
-        target_ulong page_first = ctx->base.pc_first & TARGET_PAGE_MASK;
+        vaddr page_first = ctx->base.pc_first & TARGET_PAGE_MASK;
 
         if ((ctx->base.pc_next - page_first) >= TARGET_PAGE_SIZE - 4) {
             ctx->base.is_jmp = DISAS_TOO_MANY;
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-10  4:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-09 20:05 [PATCH] target/avr: Use vaddr type for $PC jumps Philippe Mathieu-Daudé
2025-10-09 21:42 ` Richard Henderson
2025-10-10  2:56   ` Philippe Mathieu-Daudé
2025-10-10  4:30     ` 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).