]> git.proxmox.com Git - mirror_qemu.git/commitdiff
target-lm32: fix debug memory access
authorMichael Walle <michael@walle.cc>
Thu, 5 Apr 2012 17:52:54 +0000 (19:52 +0200)
committerMichael Walle <michael@walle.cc>
Mon, 18 Mar 2013 18:40:34 +0000 (19:40 +0100)
CPU models which have the LM32_FLAG_IGNORE_MSB flag set will shadow the
lower 2GB to the upper 2GB memory space. This will fix the debug memory
access used by qemu console and GDB to match this behaviour.

Signed-off-by: Michael Walle <michael@walle.cc>
target-lm32/helper.c

index a0a839990602b35d30faf767dc6c8623e90e977c..03fa5fbe283c847f8fe7a9d08a8bc319573f4bb3 100644 (file)
@@ -39,7 +39,12 @@ int cpu_lm32_handle_mmu_fault(CPULM32State *env, target_ulong address, int rw,
 
 hwaddr cpu_get_phys_page_debug(CPULM32State *env, target_ulong addr)
 {
-    return addr & TARGET_PAGE_MASK;
+    addr &= TARGET_PAGE_MASK;
+    if (env->flags & LM32_FLAG_IGNORE_MSB) {
+        return addr & 0x7fffffff;
+    } else {
+        return addr;
+    }
 }
 
 void lm32_cpu_do_interrupt(CPUState *cs)