This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Byte swapping support
- From: Andi Kleen <ak at linux dot intel dot com>
- To: Jürg Billeter <juerg dot billeter at codethink dot co dot uk>
- Cc: Eric Botcazou <ebotcazou at adacore dot com>, gcc at gcc dot gnu dot org
- Date: Wed, 13 Sep 2017 19:21:00 -0700
- Subject: Re: Byte swapping support
- Authentication-results: sourceware.org; auth=none
- References: <1505208772.3423.7.camel@codethink.co.uk> <1524176.JWFjpHKHfN@polaris> <1505295593.49984.18.camel@codethink.co.uk>
Jürg Billeter <juerg.billeter@codethink.co.uk> writes:
>
> I don't. The idea is to reverse scalar storage order for the whole
> userspace process and then add byte swapping to the Linux kernel when
> accessing userspace memory. This keeps userspace memory consistent
> with regards to endianness, which should lead to high compatibility
> with big-endian applications. Userspace memory access from the kernel
> always uses a small set of helper functions, which should make it
> easier to insert byte swapping at appropriate places.
I expect you'll find that it isn't that easy. There are a lot of opaque
copies that copy whole structures.
You'll need a whole compat layer, similar to 32<->64bit compat layers,
but actually doing more work because it has to handle all fields larger
than one byte, not just fields which differ in size.
-Andi