lkml.org 
[lkml]   [2013]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/1] eventfd: implementation of EFD_MASK flag
On 14/02/13 23:54, Andrew Morton wrote:

>> +/* On x86-64 keep the same binary layout as on i386. */
>> +#ifdef __x86_64__
>> +#define EVENTFD_MASK_PACKED __packed
>> +#else
>> +#define EVENTFD_MASK_PACKED
>> +#endif
>> +
>> +struct eventfd_mask {
>> + __u32 events;
>> + __u64 data;
>> +} EVENTFD_MASK_PACKED;
>
> The x86-64 specific thing is ugly. I can find no explanation of why it
> was done, but it should go away. You could make `events' a u64, or
> swap the order of the two fields and make the struct __packed on all
> architectures.
>
> Given that the size of the types is fixed, I see no compat issues here.

I've just copied how the definition is done for epoll_event. The comment
there goes like this:

/*
* On x86-64 make the 64bit structure have the same alignment as the
* 32bit structure. This makes 32bit emulation easier.
*
* UML/x86_64 needs the same packing as x86_64
*/

If you still think I should remove the #ifdef, I am happy to do so.

Martin


\
 
 \ /
  Last update: 2013-02-18 10:42    [W:0.132 / U:2.804 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site