aboutsummaryrefslogtreecommitdiff
path: root/target-lm32/helper.c
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2012-04-05 19:52:54 +0200
committerMichael Walle <michael@walle.cc>2013-03-18 19:40:34 +0100
commitb92e062a6f53251feef0969135b539d1fb33f7d6 (patch)
tree3b70367ae987c17a2ae8c8781ae652a4b9fa607c /target-lm32/helper.c
parente531761d63b7f8fe6b6423fafb3616ebbff768aa (diff)
target-lm32: fix debug memory access
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>
Diffstat (limited to 'target-lm32/helper.c')
-rw-r--r--target-lm32/helper.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/target-lm32/helper.c b/target-lm32/helper.c
index a0a8399906..03fa5fbe28 100644
--- a/target-lm32/helper.c
+++ b/target-lm32/helper.c
@@ -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)