[PATCH v2] arch: Kconfig: Let all little endian architectures define CPU_LITTLE_ENDIAN explicitly

H. Peter Anvin hpa at zytor.com
Tue Aug 12 23:51:34 PDT 2014

On 08/12/2014 10:32 PM, Chen Gang wrote:
> Yeah, we need.
>> The solution you suggest assumes that an arch is either little or big endian.
>> But we cannot ignore the hybriads that can do both.
> For the architectures which can do both, for me, they are: sh, powerpc,
> m32r, and mips (may mark CPU_LITTLE_ENDIAN), also are: arm/arm64, and
> c6x (may mark !CPU_BIG_ENDIAN).
> For the architectures which only support little endian: x86, and ia64.
> The left, I assumes they are big endian (no any 'ENDIAN' can be found
> in their Kconfig files). In my memory, except related with Intel, all
> are (or support) big endian.

I'm quite certain that is wrong.  From memory, for example, I believe
CRIS is littleendian, and sure enough:

: tazenda 103 ; less arch/cris/include/uapi/asm/byteorder.h

#include <linux/byteorder/little_endian.h>


As far as I know, endianism is always a compile-time option on Linux, so
we should be able to relatively easily define the architecture so that
we either have hardwired littleendian, bigendian, or prompt.


More information about the linux-arm-kernel mailing list