qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 02/10] elfload: fix size of registers for N32


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v2 02/10] elfload: fix size of registers for N32
Date: Thu, 4 Apr 2013 16:32:39 +0100

On 3 April 2013 11:32, Paolo Bonzini <address@hidden> wrote:
> Registers are 64-bit in size for the MIPS n32 ABI.  Define
> target_elf_greg_t accordingly, and use the correct function
> to do endian swaps.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
>  linux-user/elfload.c | 21 ++++++++++++++-------
>  1 file changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/linux-user/elfload.c b/linux-user/elfload.c
> index d3589ff..9d5dbb8 100644
> --- a/linux-user/elfload.c
> +++ b/linux-user/elfload.c
> @@ -101,7 +101,14 @@ enum {
>  #define ELF_DATA        ELFDATA2LSB
>  #endif
>
> +#ifdef TARGET_ABI_MIPSN32
>  typedef target_ulong    target_elf_greg_t;
> +#define tswapreg(ptr)   tswapl(ptr)
> +#else
> +typedef abi_ulong       target_elf_greg_t;
> +#define tswapreg(ptr)   tswapal(ptr)
> +#endif

This is kind of ugly but it looks like the kernel is kind
of ugly too (ie elf_greg_t as a type is not defined the
same way necessarily for all targets and ABIs). At some
point this type should probably live in a header file
in linux-user/$arch/ but for now I guess it can pass.

Reviewed-by: Peter Maydell <address@hidden>

-- PMM



reply via email to

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