On 3 April 2013 11:32, Paolo Bonzini <pbonz...@redhat.com> 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 <pbonz...@redhat.com>
> ---
>  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 <peter.mayd...@linaro.org>

-- PMM

Reply via email to