lkml.org 
[lkml]   [2007]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Fix/add raw1394 CONFIG_COMPAT code
I wrote:
> Arnd Bergmann wrote:
>>>> Note that this data structure only needs conversion on x86_64 and ia64, but
>>>> not on powerpc and other 64 bit architectures that align __u64 also in
>>>> 32 bit mode.
...
> maybe we should change
>
> /* argument to RAW1394_IOC_GET_CYCLE_TIMER ioctl */
> struct raw1394_cycle_timer {
...
> __u32 cycle_timer;
...
> __u64 local_time;
> };
>
> to
>
> /* argument to RAW1394_IOC_GET_CYCLE_TIMER ioctl */
> struct raw1394_cycle_timer {
...
> __u64 cycle_timer;
...
> __u64 local_time;
> };
>
> before a libraw1394 with get-cycle-timer support is released.

On the other hand, we could handle it in the compat code alone and leave
the rest as-is.

/* PPC32 aligns this at 64bit, IA32 packs it */
struct raw1394_cycle_timer32 {
__u32 cycle_timer;
__u64 local_time;
}
#if defined(CONFIG_X86_64) || defined(CONFIG_IA64)
__attribute__((packed))
#endif
;

Eventually, Arnd's suggestion

> I would suggest you introduce a new __compat_u64 type as
>
> typedef __u64 __compat_u64 __attribute__((aligned(4)));
>
> in include/asm-{x86_64,ia64}/compat.h and as
>
> typdef __u64 __compat_u64;
>
> in the other architectures. Other people have hit the same problem
> before and found varying workarounds, but I think we should just
> do it correctly now.

should be put into practice though.
--
Stefan Richter
-=====-=-=== -=-= =-=-=
http://arcgraph.de/sr/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-05-21 09:31    [W:0.102 / U:0.784 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site