On 9/26/2026 6:08 AM, Yonggang Luo wrote:
helper_wait is a global C symbol. Prefix it and take the resume PC
as vaddr.

Signed-off-by: Yonggang Luo <[email protected]>
---

Reviewed-by: Brian Cain <[email protected]>


  target/hexagon/gen_tcg_sys.h | 2 +-
  target/hexagon/helper.h      | 2 +-
  target/hexagon/op_helper.c   | 8 ++++----
  3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/target/hexagon/gen_tcg_sys.h b/target/hexagon/gen_tcg_sys.h
index af5032214c4..489d2780470 100644
--- a/target/hexagon/gen_tcg_sys.h
+++ b/target/hexagon/gen_tcg_sys.h
@@ -80,7 +80,7 @@
  #define fGEN_TCG_Y2_wait(SHORTCODE) \
      do { \
          RsV = RsV; \
-        gen_helper_wait(tcg_env, tcg_constant_tl(ctx->pkt.pc)); \
+        gen_helper_hexagon_wait(tcg_env, tcg_constant_vaddr(ctx->pkt.pc)); \
      } while (0)
#define fGEN_TCG_Y2_resume(SHORTCODE) \
diff --git a/target/hexagon/helper.h b/target/hexagon/helper.h
index 71c8da4c46d..030ed6dcef5 100644
--- a/target/hexagon/helper.h
+++ b/target/hexagon/helper.h
@@ -136,7 +136,7 @@ DEF_HELPER_3(sreg_write_masked, void, env, i32, i32)
  DEF_HELPER_3(setprio, void, env, i32, i32)
  DEF_HELPER_2(start, void, env, i32)
  DEF_HELPER_1(stop, void, env)
-DEF_HELPER_2(wait, void, env, i32)
+DEF_HELPER_2(hexagon_wait, void, env, vaddr)
  DEF_HELPER_2(resume, void, env, i32)
  DEF_HELPER_1(resched, void, env)
  DEF_HELPER_3(modify_ssr, void, env, i32, i32)
diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c
index 4f00ca773f3..7f026292ce8 100644
--- a/target/hexagon/op_helper.c
+++ b/target/hexagon/op_helper.c
@@ -1741,7 +1741,7 @@ static void set_wait_mode(CPUHexagonState *env)
      SET_SYSTEM_FIELD(env, HEX_SREG_MODECTL, MODECTL_W, thread_wait_mask);
  }
-static void hexagon_wait_thread(CPUHexagonState *env, uint32_t PC)
+static void hexagon_wait_thread(CPUHexagonState *env, vaddr pc)
  {
      CPUState *cs;
@@ -1768,7 +1768,7 @@ static void hexagon_wait_thread(CPUHexagonState *env, uint32_t PC)
          return;
      }
      set_wait_mode(env);
-    env->wait_next_pc = PC + 4;
+    env->wait_next_pc = pc + 4;
cpu_interrupt(cs, CPU_INTERRUPT_HALT);
  }
@@ -1836,12 +1836,12 @@ void HELPER(resched)(CPUHexagonState *env)
      resched(env);
  }
-void HELPER(wait)(CPUHexagonState *env, uint32_t PC)
+void HELPER(hexagon_wait)(CPUHexagonState *env, vaddr pc)
  {
      BQL_LOCK_GUARD();
if (!fIN_DEBUG_MODE(env->threadId)) {
-        hexagon_wait_thread(env, PC);
+        hexagon_wait_thread(env, pc);
      }
  }

Reply via email to