Skip to contentSkip to conversation

arch: Kconfig: Let all little endian architectures define CPU_LITTLE_ENDIAN explicitly

PATCH Superseded Chen Gang 2 participants 3 messages Aug 11, 2014 – Aug 12, 2014

Subsystems (4)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH 1/1 arch: Kconfig: Let all little endian architectures define CPU_LITTLE_ENDIAN explicitly

x86, ia64, and arm(64) are little endian, and also another architectures may be little endian (mips, sh, powerpc, and m32r) which already marked CPU_LITTLE_ENDIAN explicitly.

Some drivers (e.g. some of "drivers/isdn/hisax") may only support little endian (CPU_LITTLE_ENDIAN), and some drivers may only support big endian (!CPU_LITTLE_ENDIAN).

So export all little endian architectures within kernel wide, so can let Kconfig easier for the modules which only support little endian or only big endian.

---
 arch/arm/Kconfig   | 3 +++
 arch/arm64/Kconfig | 3 +++
 arch/ia64/Kconfig  | 3 +++
 arch/x86/Kconfig   | 3 +++
 4 files changed, 12 insertions(+)
arch/arm/Kconfig +3 -0
index c49a775..bfc2c65 100644
@@ -199,6 +199,9 @@ config NEED_DMA_MAP_STATE
 config ARCH_SUPPORTS_UPROBES
 	def_bool y
 
+config CPU_LITTLE_ENDIAN
+	def_bool y
+
 config ARCH_HAS_DMA_SET_COHERENT_MASK
 	bool
 
arch/arm64/Kconfig +3 -0
index 62b4ae1..69b893e 100644
@@ -129,6 +129,9 @@ config KERNEL_MODE_NEON
 config FIX_EARLYCON_MEM
 	def_bool y
 
+config CPU_LITTLE_ENDIAN
+	def_bool y
+
 source "init/Kconfig"
 
 source "kernel/Kconfig.freezer"
arch/ia64/Kconfig +3 -0
index 64aefb7..fa12d34 100644
@@ -133,6 +133,9 @@ config AUDIT_ARCH
 	bool
 	default y
 
+config CPU_LITTLE_ENDIAN
+	def_bool y
+
 menuconfig PARAVIRT_GUEST
 	bool "Paravirtualized guest support"
 	depends on BROKEN
arch/x86/Kconfig +3 -0
index 541e7cc..a1b3568 100644
@@ -270,6 +270,9 @@ config ARCH_SUPPORTS_UPROBES
 config FIX_EARLYCON_MEM
 	def_bool y
 
+config CPU_LITTLE_ENDIAN
+	def_bool y
+
 source "init/Kconfig"
 source "kernel/Kconfig.freezer"
 
Signature · 1 line
1.7.11.7
#1 lore raw
Quoted 3 lines · Chen Gang

x86, ia64, and arm(64) are little endian, and also another architectures may be little endian (mips, sh, powerpc, and m32r) which already marked CPU_LITTLE_ENDIAN explicitly.

This is incorrect. ARM can be either endian.

arch/arm/mm/Kconfig:

config CPU_BIG_ENDIAN
bool "Build big-endian kernel"
depends on ARCH_SUPPORTS_BIG_ENDIAN
help
Say Y if you plan on running a kernel in big-endian mode. Note that your board must be properly built and your board port must properly enable any big-endian related features of your chipset/board/processor.

Signature · 2 lines
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
author
#2 lore raw
Quoted 9 lines · Russell King - ARM Linux
Quoted 3 lines · Chen Gang

x86, ia64, and arm(64) are little endian, and also another architectures may be little endian (mips, sh, powerpc, and m32r) which already marked CPU_LITTLE_ENDIAN explicitly.

This is incorrect. ARM can be either endian.

arch/arm/mm/Kconfig:

Quoted 9 lines

config CPU_BIG_ENDIAN
bool "Build big-endian kernel"
depends on ARCH_SUPPORTS_BIG_ENDIAN
help
Say Y if you plan on running a kernel in big-endian mode. Note that your board must be properly built and your board port must properly enable any big-endian related features of your chipset/board/processor.

OK, thanks, I shall check all CPU_BIG_ENDIAN and send patch v2 for it.

And still welcome another ideas, suggestions or completions, especially for another architectures.

Thanks.

Signature · 3 lines
Chen Gang

Open, share, and attitude like air, water, and life which God blessed