diff options
author | Duane Sand <duanes@mips.com> | 2012-06-21 14:30:38 -0700 |
---|---|---|
committer | Duane Sand <duanes@mips.com> | 2012-06-21 14:30:38 -0700 |
commit | 342a01fc826881e6b12b7673c7d2c280295f4d9e (patch) | |
tree | e680d838836d3cad018925130633fe5a3da7b9bc | |
parent | 870f03672ca3513fe5d666f425942fda651f30ec (diff) | |
download | external_qemu-342a01fc826881e6b12b7673c7d2c280295f4d9e.zip external_qemu-342a01fc826881e6b12b7673c7d2c280295f4d9e.tar.gz external_qemu-342a01fc826881e6b12b7673c7d2c280295f4d9e.tar.bz2 |
[MIPS] Fix startup segfault in emulator64-mips
Avoid truncation of 64-bit host addresses for 32-bit Mips physaddrs.
Revert workaround I17fe688d19e3cd7f328721e6363bacd6e6689ca;
allow emulator to again default to emulator64-mips.
Change-Id: I0c83d8bf60fc52a758b84d8131b2bad53375aa61
Signed-off-by: Duane Sand <duanes@mips.com>
-rw-r--r-- | android/main-emulator.c | 2 | ||||
-rw-r--r-- | target-mips/op_helper.c | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/android/main-emulator.c b/android/main-emulator.c index ac4d2e9..0981a71 100644 --- a/android/main-emulator.c +++ b/android/main-emulator.c @@ -148,8 +148,6 @@ int main(int argc, char** argv) avdArch = "arm"; D("Can't determine target AVD architecture: defaulting to %s\n", avdArch); } - if (!strcmp(avdArch, "mips")) - force_32bit = 1; /* emulator64-mips segfaults currently, 4-19-2012 */ /* Find the architecture-specific program in the same directory */ emulatorPath = getTargetEmulatorPath(argv[0], avdArch, force_32bit); diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c index 565cf94..a0c64f4 100644 --- a/target-mips/op_helper.c +++ b/target-mips/op_helper.c @@ -1870,7 +1870,7 @@ static unsigned long v2p_mmu(target_ulong addr, int is_user) { int index; target_ulong tlb_addr; - target_phys_addr_t physaddr; + unsigned long physaddr; void *retaddr; index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1); @@ -1892,12 +1892,12 @@ redo: * to the address of simulation host (not the physical * address of simulated OS. */ -target_phys_addr_t v2p(target_ulong ptr, int is_user) +unsigned long v2p(target_ulong ptr, int is_user) { CPUState *saved_env; int index; target_ulong addr; - target_phys_addr_t physaddr; + unsigned long physaddr; saved_env = env; env = cpu_single_env; @@ -1907,7 +1907,7 @@ target_phys_addr_t v2p(target_ulong ptr, int is_user) (addr & TARGET_PAGE_MASK), 0)) { physaddr = v2p_mmu(addr, is_user); } else { - physaddr = (target_phys_addr_t)addr + env->tlb_table[is_user][index].addend; + physaddr = addr + env->tlb_table[is_user][index].addend; } env = saved_env; return physaddr; |