diff options
author | Aurelien Jarno <aurelien@aurel32.net> | 2010-02-06 17:02:45 +0100 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2010-02-06 17:23:33 +0100 |
commit | c36bbb28ad62b4b1f494df0b199432d8c79876db (patch) | |
tree | 5c58e047685761144079d31456142ddf9adc057f /target-mips/op_helper.c | |
parent | 3f26c1227e3b08010f2a65379cecf4cb4b5933fa (diff) |
target-mips: don't call cpu_loop_exit() from helper.c
In helper.c AREG0 may not correspond do env, so it's not possible to
call cpu_loop_exit() here. Call it from op_helper.c instead.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'target-mips/op_helper.c')
-rw-r--r-- | target-mips/op_helper.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c index cccfd8e07e..2bfdd5002f 100644 --- a/target-mips/op_helper.c +++ b/target-mips/op_helper.c @@ -276,10 +276,24 @@ void helper_dmultu (target_ulong arg1, target_ulong arg2) #endif #ifndef CONFIG_USER_ONLY + +static inline target_phys_addr_t do_translate_address(target_ulong address, int rw) +{ + target_phys_addr_t lladdr; + + lladdr = cpu_mips_translate_address(env, address, rw); + + if (lladdr == -1LL) { + cpu_loop_exit(); + } else { + return lladdr; + } +} + #define HELPER_LD_ATOMIC(name, insn) \ target_ulong helper_##name(target_ulong arg, int mem_idx) \ { \ - env->lladdr = do_translate_address(env, arg, 0); \ + env->lladdr = do_translate_address(arg, 0); \ env->llval = do_##insn(arg, mem_idx); \ return env->llval; \ } @@ -298,7 +312,7 @@ target_ulong helper_##name(target_ulong arg1, target_ulong arg2, int mem_idx) \ env->CP0_BadVAddr = arg2; \ helper_raise_exception(EXCP_AdES); \ } \ - if (do_translate_address(env, arg2, 1) == env->lladdr) { \ + if (do_translate_address(arg2, 1) == env->lladdr) { \ tmp = do_##ld_insn(arg2, mem_idx); \ if (tmp == env->llval) { \ do_##st_insn(arg2, arg1, mem_idx); \ |