Use the common raise_excp helper for translated exceptions and route the remaining C callers through cpu_raise_excp().
Signed-off-by: Yonggang Luo <[email protected]> --- target/hppa/helper.h | 2 -- target/hppa/op_helper.c | 10 +--------- target/hppa/sys_helper.c | 5 +++-- target/hppa/translate.c | 2 +- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/target/hppa/helper.h b/target/hppa/helper.h index 8369855d78e..5ed39e01e31 100644 --- a/target/hppa/helper.h +++ b/target/hppa/helper.h @@ -1,5 +1,3 @@ -DEF_HELPER_2(excp, noreturn, env, int) - DEF_HELPER_FLAGS_3(stby_b, TCG_CALL_NO_WG, void, env, tl, tl) DEF_HELPER_FLAGS_3(stby_b_parallel, TCG_CALL_NO_WG, void, env, tl, tl) DEF_HELPER_FLAGS_3(stby_e, TCG_CALL_NO_WG, void, env, tl, tl) diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c index 76a8d8a0d34..9c560a56d34 100644 --- a/target/hppa/op_helper.c +++ b/target/hppa/op_helper.c @@ -30,14 +30,6 @@ #include "user/page-protection.h" #endif -G_NORETURN void HELPER(excp)(CPUHPPAState *env, int excp) -{ - CPUState *cs = env_cpu(env); - - cs->exception_index = excp; - cpu_loop_exit(cs); -} - G_NORETURN void hppa_dynamic_excp(CPUHPPAState *env, int excp, uintptr_t ra) { CPUState *cs = env_cpu(env); @@ -341,7 +333,7 @@ target_ulong HELPER(probe)(CPUHPPAState *env, target_ulong addr, if (excp == EXCP_DTLB_MISS) { excp = EXCP_NA_DTLB_MISS; } - helper_excp(env, excp); + cpu_raise_excp(env_cpu(env), excp); } return (want & prot) != 0; #endif diff --git a/target/hppa/sys_helper.c b/target/hppa/sys_helper.c index 88109f0181a..1c10d3d85b3 100644 --- a/target/hppa/sys_helper.c +++ b/target/hppa/sys_helper.c @@ -21,6 +21,7 @@ #include "qemu/log.h" #include "cpu.h" #include "exec/helper-proto.h" +#include "accel/tcg/cpu-loop.h" #include "qemu/timer.h" #include "system/runstate.h" #include "system/system.h" @@ -51,13 +52,13 @@ void HELPER(write_interval_timer)(CPUHPPAState *env, target_ulong val) void HELPER(halt)(CPUHPPAState *env) { qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); - helper_excp(env, EXCP_HLT); + cpu_raise_excp(env_cpu(env), EXCP_HLT); } void HELPER(reset)(CPUHPPAState *env) { qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); - helper_excp(env, EXCP_HLT); + cpu_raise_excp(env_cpu(env), EXCP_HLT); } target_ulong HELPER(swap_system_mask)(CPUHPPAState *env, target_ulong nsm) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 41300c0dd73..35766e6ee06 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -726,7 +726,7 @@ static void install_link(DisasContext *ctx, unsigned link, bool with_sr0) static void gen_excp_1(int exception) { - gen_helper_excp(tcg_env, tcg_constant_i32(exception)); + gen_helper_raise_excp(tcg_env, tcg_constant_i32(exception)); } static void gen_excp(DisasContext *ctx, int exception) -- 2.52.0.windows.1
