From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H. Peter Anvin" Subject: Re: [PATCH v2] arch: Kconfig: Let all little endian architectures define CPU_LITTLE_ENDIAN explicitly Date: Tue, 12 Aug 2014 23:51:34 -0700 Message-ID: <53EB0AF6.6060208@zytor.com> References: <53EA99C3.90203@gmail.com> <20140813050809.GB30459@ravnborg.org> <53EAF85E.3000208@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53EAF85E.3000208@gmail.com> Sender: linux-kernel-owner@vger.kernel.org To: Chen Gang , Sam Ravnborg Cc: Arnd Bergmann , akpm@linux-foundation.org, Geert Uytterhoeven , Jean Delvare , linux@arm.linux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com, msalter@redhat.com, a-jacquiot@ti.com, tony.luck@intel.com, fenghua.yu@intel.com, tglx@linutronix.de, mingo@redhat.com, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-ia64@vger.kernel.org, "linux-kernel@vger.kernel.org" , linux-arch@vger.kernel.org List-Id: linux-arch.vger.kernel.org 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 #ifndef _CRIS_BYTEORDER_H #define _CRIS_BYTEORDER_H #include #endif 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. -hpa From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from terminus.zytor.com ([198.137.202.10]:51246 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751393AbaHMGzQ (ORCPT ); Wed, 13 Aug 2014 02:55:16 -0400 Message-ID: <53EB0AF6.6060208@zytor.com> Date: Tue, 12 Aug 2014 23:51:34 -0700 From: "H. Peter Anvin" MIME-Version: 1.0 Subject: Re: [PATCH v2] arch: Kconfig: Let all little endian architectures define CPU_LITTLE_ENDIAN explicitly References: <53EA99C3.90203@gmail.com> <20140813050809.GB30459@ravnborg.org> <53EAF85E.3000208@gmail.com> In-Reply-To: <53EAF85E.3000208@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-arch-owner@vger.kernel.org List-ID: To: Chen Gang , Sam Ravnborg Cc: Arnd Bergmann , akpm@linux-foundation.org, Geert Uytterhoeven , Jean Delvare , linux@arm.linux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com, msalter@redhat.com, a-jacquiot@ti.com, tony.luck@intel.com, fenghua.yu@intel.com, tglx@linutronix.de, mingo@redhat.com, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-ia64@vger.kernel.org, "linux-kernel@vger.kernel.org" , linux-arch@vger.kernel.org Message-ID: <20140813065134.X8VloK5M8jjIE1yXi6gPHER6PEXM__IHQKIA5fP0fMs@z> 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 #ifndef _CRIS_BYTEORDER_H #define _CRIS_BYTEORDER_H #include #endif 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. -hpa