summaryrefslogtreecommitdiffstats
path: root/target-sh4
diff options
context:
space:
mode:
authorBlue Swirl2012-12-04 21:16:07 +0100
committerBlue Swirl2012-12-16 09:35:24 +0100
commita8a826a3c3b8c8a1c4def0e9e22b46e78e6163a0 (patch)
tree4477f11f1fdb1a5f1ad2914d1ebbf86e4c2df435 /target-sh4
parentexec: move TB handling to translate-all.c (diff)
downloadqemu-a8a826a3c3b8c8a1c4def0e9e22b46e78e6163a0.tar.gz
qemu-a8a826a3c3b8c8a1c4def0e9e22b46e78e6163a0.tar.xz
qemu-a8a826a3c3b8c8a1c4def0e9e22b46e78e6163a0.zip
exec: refactor cpu_restore_state
Refactor common code around calls to cpu_restore_state(). tb_find_pc() has now no external users, make it static. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'target-sh4')
-rw-r--r--target-sh4/op_helper.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/target-sh4/op_helper.c b/target-sh4/op_helper.c
index 60ec4cbc4d..e8e87f5152 100644
--- a/target-sh4/op_helper.c
+++ b/target-sh4/op_helper.c
@@ -21,21 +21,6 @@
#include "cpu.h"
#include "helper.h"
-static inline void cpu_restore_state_from_retaddr(CPUSH4State *env,
- uintptr_t retaddr)
-{
- TranslationBlock *tb;
-
- if (retaddr) {
- tb = tb_find_pc(retaddr);
- if (tb) {
- /* the PC is inside the translated code. It means that we have
- a virtual CPU fault */
- cpu_restore_state(tb, env, retaddr);
- }
- }
-}
-
#ifndef CONFIG_USER_ONLY
#include "softmmu_exec.h"
@@ -61,7 +46,9 @@ void tlb_fill(CPUSH4State *env, target_ulong addr, int is_write, int mmu_idx,
ret = cpu_sh4_handle_mmu_fault(env, addr, is_write, mmu_idx);
if (ret) {
/* now we have a real cpu fault */
- cpu_restore_state_from_retaddr(env, retaddr);
+ if (retaddr) {
+ cpu_restore_state(env, retaddr);
+ }
cpu_loop_exit(env);
}
}
@@ -82,7 +69,9 @@ static inline void QEMU_NORETURN raise_exception(CPUSH4State *env, int index,
uintptr_t retaddr)
{
env->exception_index = index;
- cpu_restore_state_from_retaddr(env, retaddr);
+ if (retaddr) {
+ cpu_restore_state(env, retaddr);
+ }
cpu_loop_exit(env);
}