qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v1 2/4] target-arm: Make SYS_HEAPINFO work for ARMv7


From: Meador Inge
Subject: [Qemu-devel] [PATCH v1 2/4] target-arm: Make SYS_HEAPINFO work for ARMv7-M
Date: Mon, 27 Aug 2012 15:37:46 -0500

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 <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]