Re: RFD: x32 ABI system call numbers

From: Arnd Bergmann
Date: Sat Sep 03 2011 - 04:41:45 EST


On Friday 02 September 2011 22:29:38 H. Peter Anvin wrote:
> On 09/02/2011 09:44 PM, H.J. Lu wrote:
> >
> > Is there a way to support something similar to __SNATIVE_LONG_TYPE
> > and __UNATIVE_LONG_TYPE for kernel header files.
> >
>
> Again, what is the definition you're looking for? We have __u64 and
> __s64, but the question is what alignment those types should be using,
> given that we're presumably stuck with using compat_ioctl for ioctl...

I think the above types have to use full 64 bit alignment, otherwise
you are incompatible with any native data structures that have padding
in the 64-bit ABI.

For the ioctl interface however, the __u64/__s64 type in the x32 ABI
must be defined with __attribute__((packed,aligned(4))) to match what
the kernel implements because it emulates the x86-32 ABI.

This also means we need to audit all ioctl definitions that use
some other type like 'unsigned long long' or 'uint64_t' and change
those to use the proper '__u64'.

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/