[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] linux-user: fix preadv/pwritev offsets
From: |
Max Filippov |
Subject: |
Re: [Qemu-devel] [PATCH v2] linux-user: fix preadv/pwritev offsets |
Date: |
Thu, 5 Apr 2018 05:53:06 -0700 |
On Wed, Apr 4, 2018 at 8:43 PM, Richard Henderson
<address@hidden> wrote:
> On 04/05/2018 11:41 AM, Max Filippov wrote:
>> +static void target_low_high_to_host_low_high(abi_ulong tlow,
>> + abi_ulong thigh,
>> + unsigned long *hlow,
>> + unsigned long *hhigh)
>> +{
>> +#if TARGET_LONG_BITS == HOST_LONG_BITS
>> + *hlow = tlow;
>> + *hhigh = thigh;
>> +#elif TARGET_LONG_BITS < HOST_LONG_BITS
>> + *hlow = tlow | (unsigned long)thigh << TARGET_LONG_BITS;
>> + *hhigh = 0;
>> +#else
>> + *hlow = (unsigned long)tlow;
>> + *hhigh = (unsigned long)(tlow >> HOST_LONG_BITS);
>> +#endif
>
> It might still be worth a check for HOST_LONG_BITS >= 2 * TARGET_LONG_BITS and
> #error otherwise. Or explicit checks vs 32 & 64 if you like.
Ok, will do in v3.
--
Thanks.
-- Max