Received: from eggs.gnu.org ([208.118.235.92]:54555) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDMOZ-0004Ik-34 for qemu-devel@nongnu.org; Wed, 06 Mar 2013 17:01:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDMOX-0004b7-TW for qemu-devel@nongnu.org; Wed, 06 Mar 2013 17:01:07 -0500 Received: from ssl.serverraum.org ([88.198.40.39]:47180) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDMOX-0004ac-Mi for qemu-devel@nongnu.org; Wed, 06 Mar 2013 17:01:05 -0500 From: Michael Walle Date: Wed, 6 Mar 2013 22:59:58 +0100 Message-Id: <1362607209-12232-2-git-send-email-michael@walle.cc> In-Reply-To: <1362607209-12232-1-git-send-email-michael@walle.cc> References: <1362607209-12232-1-git-send-email-michael@walle.cc> Subject: [Qemu-devel] [PATCH 01/12] target-lm32: fix debug memory access List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Michael Walle 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 --- target-lm32/helper.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/target-lm32/helper.c b/target-lm32/helper.c index 47ae7e7..ef04643 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 do_interrupt(CPULM32State *env) -- 1.7.2.5