From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56998) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T664P-0007hV-3n for qemu-devel@nongnu.org; Mon, 27 Aug 2012 16:38:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T664O-0004ma-0s for qemu-devel@nongnu.org; Mon, 27 Aug 2012 16:38:01 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:35535) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T664N-0004mR-RG for qemu-devel@nongnu.org; Mon, 27 Aug 2012 16:37:59 -0400 From: Meador Inge Date: Mon, 27 Aug 2012 15:37:46 -0500 Message-ID: <1346099868-7774-3-git-send-email-meadori@codesourcery.com> In-Reply-To: <1346099868-7774-1-git-send-email-meadori@codesourcery.com> References: <1346099868-7774-1-git-send-email-meadori@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH v1 2/4] target-arm: Make SYS_HEAPINFO work for ARMv7-M List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, paul@codesourcery.com The current implementation of the ARM semi-hosting SYS_HEAPINFO system call assumes that the base address of RAM for all ARM devices is 0x0. This isn't true for ARMv7-M devices, which uses a base of 0x20000000 for SRAM. Signed-off-by: Meador Inge --- target-arm/arm-semi.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/target-arm/arm-semi.c b/target-arm/arm-semi.c index 73bde58..fd90794 100644 --- a/target-arm/arm-semi.c +++ b/target-arm/arm-semi.c @@ -486,7 +486,13 @@ uint32_t do_arm_semihosting(CPUARMState *env) ptr[3] = tswap32(0); /* Stack limit. */ unlock_user(ptr, ARG(0), 16); #else - limit = ram_size; + /* For ARMv7-M use the base address of SRAM as specified by the + architecture. */ + if (arm_feature(env, ARM_FEATURE_M)) { + limit = 0x20000000 + ram_size; + } else { + limit = ram_size; + } if (!(ptr = lock_user(VERIFY_WRITE, ARG(0), 16, 0))) /* FIXME - should this error code be -TARGET_EFAULT ? */ return (uint32_t)-1; -- 1.7.7.6