qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] Fix 64-bit off_t syscall argument passing in li


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH] Fix 64-bit off_t syscall argument passing in linux-user
Date: Thu, 25 Mar 2010 08:55:46 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Thunderbird/3.0.3

On 03/25/2010 02:04 AM, Tomasz Łukaszewski wrote:
> +#if TARGET_ABI_BITS == 32
> +#ifdef TARGET_ARM
> +    if (((CPUARMState *)cpu_env)->eabi)
> +      {
> +        arg4 = arg5;
> +        arg5 = arg6;
> +      }
> +#endif
> +#if defined TARGET_PPC || defined TARGET_MIPS
> +    arg4 = arg5;
> +    arg5 = arg6;
> +#endif
> +#endif

I wonder if this sequence couldn't be encapsulated in a macro.  Something like

#if TARGET_ABI_BITS == 32
# if defined TARGET_ARM
#  define FIXUP_64BIT_ARGUMENT_PAIR(a,b,c)     \
    do {                                       \
        if (((CPUARMState *)cpu_env)->eabi) {  \
            a = b, b = c;                      \
        }                                      \
    } while (0)
# elif defined TARGET_PPC || defined TARGET_MIPS
#  define FIXUP_64BIT_ARGUMENT_PAIR(a,b,c)     \
    do { a = b, b = c; } while (0)
# endif
#endif
#ifndef FIXUP_64BIT_ARGUMENT_PAIR
# define FIXUP_64BIT_ARGUMENT_PAIR(a,b,c) \
    do { } while (0)
#endif


r~




reply via email to

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