Thread (20 messages) 20 messages, 6 authors, 2017-06-08

Re: CPU_BIG_ENDIAN in generic code (was: Re: [PATCH v3 3/7] arch/sparc: Define config parameter CPU_BIG_ENDIAN)

From: Babu Moger <hidden>
Date: 2017-05-25 22:42:50
Also in: linux-arch, linux-serial, lkml, sparclinux

On 5/25/2017 5:27 PM, Max Filippov wrote:
On Wed, May 24, 2017 at 3:18 AM, Arnd Bergmann [off-list ref] wrote:
quoted
On Wed, May 24, 2017 at 11:59 AM, Geert Uytterhoeven
[off-list ref] wrote:
quoted
I guess the time is ripe for adding (both) symbols to all architectures?
Good idea. I think we can do most of this by adding a few lines to
arch/Kconfig:

config CPU_BIG_ENDIAN
         bool

config CPU_LITTLE_ENDIAN
        def_bool !CPU_BIG_ENDIAN

This way, we only need to add 'select CPU_BIG_ENDIAN' to the
architectures that are always big-endian, and we don't need to
change anything for the ones that have a single 'CPU_BIG_ENDIAN'
option.

The three architectures that have a 'choice' statement (mips, ppc and
sh) will have to convert, and m32r will have to replace the
option with the opposite one, which could break 'make oldconfig',
but nobody really cares about m32r any more.
Xtensa may have either endianness and for xtensa we define
CONFIG_CPU_BIG_ENDIAN or CONFIG_CPU_LITTLE_ENDIAN
in the arch/xtensa/Makefile based on the value of the compiler builtin
macro.
Hmm.. That means defining  CPU_LITTLE_ENDIAN  based on "def_bool 
!CPU_BIG_ENDIAN" will
  be a problem for Xtensa because menuconfig does not have the knowledge 
of compiler builtin macro.
Is that correct?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help