Inline do_raise_exception as it's used by other arch.

Signed-off-by: Yonggang Luo <[email protected]>
---
 target/hexagon/internal.h  | 10 +++++++++-
 target/hexagon/op_helper.c |  5 ++---
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/target/hexagon/internal.h b/target/hexagon/internal.h
index 05d1129916e..981ff7c4607 100644
--- a/target/hexagon/internal.h
+++ b/target/hexagon/internal.h
@@ -36,11 +36,19 @@ extern const char * const hexagon_sregnames[];
 extern const char * const hexagon_gregnames[];
 #endif
 
-void G_NORETURN do_raise_exception(CPUHexagonState *env,
+void G_NORETURN hexagon_do_raise_exception(CPUHexagonState *env,
         uint32_t exception,
         uint32_t PC,
         uintptr_t retaddr);
 
+static inline void G_NORETURN do_raise_exception(CPUHexagonState *env,
+        uint32_t exception,
+        uint32_t PC,
+        uintptr_t retaddr)
+{
+    hexagon_do_raise_exception(env, exception, PC, retaddr);
+}
+
 #define hexagon_cpu_mmu_enabled(env) ({ \
     HexagonCPU *cpu = env_archcpu(env); \
     cpu->globalregs ? \
diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c
index 4f00ca773f3..1536e81d4b8 100644
--- a/target/hexagon/op_helper.c
+++ b/target/hexagon/op_helper.c
@@ -73,7 +73,7 @@ uint64_t HELPER(utimer)(void)
 
 /* Exceptions processing helpers */
 G_NORETURN
-void do_raise_exception(CPUHexagonState *env, uint32_t exception,
+void hexagon_do_raise_exception(CPUHexagonState *env, uint32_t exception,
                         uint32_t PC, uintptr_t retaddr)
 {
     CPUState *cs = env_cpu(env);
@@ -82,8 +82,7 @@ void do_raise_exception(CPUHexagonState *env, uint32_t 
exception,
     ASSERT_DIRECT_TO_GUEST_UNSET(env, exception);
 
     env->gpr[HEX_REG_PC] = PC;
-    cs->exception_index = exception;
-    cpu_loop_exit_restore(cs, retaddr);
+    cpu_raise_excp_restore(cs, exception, retaddr);
 }
 
 G_NORETURN void hexagon_raise_exception_err(CPUHexagonState *env,
-- 
2.52.0.windows.1


Reply via email to