exec/softmmu*: Misc fixes.
Upstream 2050396801ca0c8359364d61eaadece951006057
Upstream b065927a02cbbaca032ed20d3039baca0914165c
Change-Id: I5b484ed026f8755804d443d45be2e96010cef60a
diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c
index 73dbd50..278cdef 100644
--- a/target-i386/op_helper.c
+++ b/target-i386/op_helper.c
@@ -4926,11 +4926,11 @@
NULL, it means that the function was called in C code (i.e. not
from generated code or from helper.c) */
/* XXX: fix it to restore all registers */
-void tlb_fill(CPUX86State* env1, target_ulong addr, int is_write, int mmu_idx, void *retaddr)
+void tlb_fill(CPUX86State* env1, target_ulong addr, int is_write, int mmu_idx,
+ uintptr_t retaddr)
{
TranslationBlock *tb;
int ret;
- unsigned long pc;
CPUX86State *saved_env;
/* XXX: hack to restore env in all cases, even if not called from
@@ -4941,12 +4941,11 @@
if (ret) {
if (retaddr) {
/* now we have a real cpu fault */
- pc = (unsigned long)retaddr;
- tb = tb_find_pc(pc);
+ 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(env, pc);
+ cpu_restore_state(env, retaddr);
}
}
raise_exception_err(env->exception_index, env->error_code);