From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754239AbbA2BsP (ORCPT ); Wed, 28 Jan 2015 20:48:15 -0500 Received: from mail-ie0-f176.google.com ([209.85.223.176]:52038 "EHLO mail-ie0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755380AbbA2BsI (ORCPT ); Wed, 28 Jan 2015 20:48:08 -0500 Message-ID: <54C8EE04.6060809@linaro.org> Date: Wed, 28 Jan 2015 08:11:16 -0600 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Ard Biesheuvel , Behan Webster CC: bcm@fixthebug.org, f.fainelli@gmail.com, Russell King - ARM Linux , mporter@linaro.org, bcm-kernel-feedback-list@broadcom.com, "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH] bcm: address clang inline asm incompatibility References: <1422422306-27473-1-git-send-email-behanw@converseincode.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/28/2015 05:15 AM, Ard Biesheuvel wrote: > On 28 January 2015 at 05:18, Behan Webster wrote: >> From: Alex Elder >> >> My GCC-based build environment likes to call register r12 by the >> name "ip" in inline asm. Behan Webster informed me that his Clang- >> based build environment likes "r12" instead. >> >> Try to make them both happy. >> >> Signed-off-by: Alex Elder >> Signed-off-by: Behan Webster >> --- >> arch/arm/mach-bcm/bcm_kona_smc.c | 9 +++++++-- >> 1 file changed, 7 insertions(+), 2 deletions(-) >> >> diff --git a/arch/arm/mach-bcm/bcm_kona_smc.c b/arch/arm/mach-bcm/bcm_kona_smc.c >> index a55a7ec..3937bd5 100644 >> --- a/arch/arm/mach-bcm/bcm_kona_smc.c >> +++ b/arch/arm/mach-bcm/bcm_kona_smc.c >> @@ -106,9 +106,14 @@ int __init bcm_kona_smc_init(void) >> * request result appropriately. This result value is found in r0 >> * when the "smc" request completes. >> */ >> +#ifdef __clang__ >> +#define R12 "r12" >> +#else /* !__clang__ */ >> +#define R12 "ip" /* gcc calls r12 "ip" */ >> +#endif /* !__clang__ */ > > Why not just use r12 for both? Yes, that would have been an obvious fix. But the assembler (in the GCC environment) doesn't accept that. -Alex > >> static int bcm_kona_do_smc(u32 service_id, u32 buffer_phys) >> { >> - register u32 ip asm("ip"); /* Also called r12 */ >> + register u32 ip asm(R12); /* Also called r12 */ >> register u32 r0 asm("r0"); >> register u32 r4 asm("r4"); >> register u32 r5 asm("r5"); >> @@ -120,7 +125,7 @@ static int bcm_kona_do_smc(u32 service_id, u32 buffer_phys) >> >> asm volatile ( >> /* Make sure we got the registers we want */ >> - __asmeq("%0", "ip") >> + __asmeq("%0", R12) >> __asmeq("%1", "r0") >> __asmeq("%2", "r4") >> __asmeq("%3", "r5") >> -- >> 1.9.1 >> >> >> _______________________________________________ >> linux-arm-kernel mailing list >> linux-arm-kernel@lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel