diff mbox

[1/2] linux-user: Make semihosting heap/stack fields abi_ulongs

Message ID 1466783381-29506-2-git-send-email-peter.maydell@linaro.org
State New
Headers show

Commit Message

Peter Maydell June 24, 2016, 3:49 p.m. UTC
The fields in the TaskState heap_base, heap_limit and stack_base
are all guest addresses (representing the locations of the heap
and stack for the guest binary), so they should be abi_ulong
rather than uint32_t. (This only in practice affects ARM AArch64
since all the other semihosting implementations are 32-bit.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 linux-user/qemu.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Laurent Desnogues June 24, 2016, 3:58 p.m. UTC | #1
On Fri, Jun 24, 2016 at 5:49 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> The fields in the TaskState heap_base, heap_limit and stack_base
> are all guest addresses (representing the locations of the heap
> and stack for the guest binary), so they should be abi_ulong
> rather than uint32_t. (This only in practice affects ARM AArch64
> since all the other semihosting implementations are 32-bit.)
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Laurent Desnogues <laurent.desnogues@gmail.com>

Thanks,

Laurent

> ---
>  linux-user/qemu.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/linux-user/qemu.h b/linux-user/qemu.h
> index 56f29c3..1b3b03b 100644
> --- a/linux-user/qemu.h
> +++ b/linux-user/qemu.h
> @@ -111,10 +111,10 @@ typedef struct TaskState {
>  #endif
>  #if defined(TARGET_ARM) || defined(TARGET_M68K) || defined(TARGET_UNICORE32)
>      /* Extra fields for semihosted binaries.  */
> -    uint32_t heap_base;
> -    uint32_t heap_limit;
> +    abi_ulong heap_base;
> +    abi_ulong heap_limit;
>  #endif
> -    uint32_t stack_base;
> +    abi_ulong stack_base;
>      int used; /* non zero if used */
>      struct image_info *info;
>      struct linux_binprm *bprm;
> --
> 1.9.1
>
diff mbox

Patch

diff --git a/linux-user/qemu.h b/linux-user/qemu.h
index 56f29c3..1b3b03b 100644
--- a/linux-user/qemu.h
+++ b/linux-user/qemu.h
@@ -111,10 +111,10 @@  typedef struct TaskState {
 #endif
 #if defined(TARGET_ARM) || defined(TARGET_M68K) || defined(TARGET_UNICORE32)
     /* Extra fields for semihosted binaries.  */
-    uint32_t heap_base;
-    uint32_t heap_limit;
+    abi_ulong heap_base;
+    abi_ulong heap_limit;
 #endif
-    uint32_t stack_base;
+    abi_ulong stack_base;
     int used; /* non zero if used */
     struct image_info *info;
     struct linux_binprm *bprm;