From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1165776AbdEYWmu (ORCPT ); Thu, 25 May 2017 18:42:50 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:19299 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030517AbdEYWmF (ORCPT ); Thu, 25 May 2017 18:42:05 -0400 Subject: Re: CPU_BIG_ENDIAN in generic code (was: Re: [PATCH v3 3/7] arch/sparc: Define config parameter CPU_BIG_ENDIAN) To: Max Filippov , Arnd Bergmann Cc: Geert Uytterhoeven , "David S. Miller" , Peter Zijlstra , Ingo Molnar , sparclinux , "linux-kernel@vger.kernel.org" , Linux-Arch , "devicetree@vger.kernel.org" , "linux-serial@vger.kernel.org" References: From: Babu Moger Organization: Oracle Corporation Message-ID: <116e7ba5-cb5e-8e96-ea74-bf91b4818d69@oracle.com> Date: Thu, 25 May 2017 17:41:11 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/25/2017 5:27 PM, Max Filippov wrote: > On Wed, May 24, 2017 at 3:18 AM, Arnd Bergmann wrote: >> On Wed, May 24, 2017 at 11:59 AM, Geert Uytterhoeven >> wrote: >>> 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?