From patchwork Sat May 31 20:32:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeroen Hofstee X-Patchwork-Id: 354533 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 6093014009C for ; Sun, 1 Jun 2014 06:33:31 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2FEF2A73F6; Sat, 31 May 2014 22:33:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oGqRy6hzmpSa; Sat, 31 May 2014 22:33:19 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8471EA7414; Sat, 31 May 2014 22:32:57 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6ECDBA73FA for ; Sat, 31 May 2014 22:32:41 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8P08OADI0MCK for ; Sat, 31 May 2014 22:32:41 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from orange.myspectrum.nl (orange.myspectrum.nl [149.210.134.247]) by theia.denx.de (Postfix) with ESMTP id 844604B873 for ; Sat, 31 May 2014 22:32:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by orange.myspectrum.nl (Postfix) with ESMTP id 60A7E8A051; Sat, 31 May 2014 22:32:32 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at myspectrum.nl Received: from orange.myspectrum.nl ([127.0.0.1]) by localhost (orange.myspectrum.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OaUTMXzxZhFk; Sat, 31 May 2014 22:32:32 +0200 (CEST) Received: from yellow (ip136-5-208-87.adsl2.static.versatel.nl [87.208.5.136]) (Authenticated sender: jeroen@myspectrum.nl) by orange.myspectrum.nl (Postfix) with ESMTPSA id B1D1789F74; Sat, 31 May 2014 22:32:31 +0200 (CEST) Received: by yellow (Postfix, from userid 1000) id 91592741FA2; Sat, 31 May 2014 22:32:30 +0200 (CEST) From: Jeroen Hofstee To: u-boot@lists.denx.de Date: Sat, 31 May 2014 22:32:21 +0200 Message-Id: <1401568344-4441-8-git-send-email-jeroen@myspectrum.nl> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1401568344-4441-1-git-send-email-jeroen@myspectrum.nl> References: <1401568344-4441-1-git-send-email-jeroen@myspectrum.nl> Cc: Jeroen Hofstee Subject: [U-Boot] [RFC 07/10] ARM: make gd a function a function for clang X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de --- arch/arm/include/asm/global_data.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h index 63e4ad5..646d694 100644 --- a/arch/arm/include/asm/global_data.h +++ b/arch/arm/include/asm/global_data.h @@ -44,10 +44,27 @@ struct arch_global_data { #include +#ifdef __clang__ + +#define DECLARE_GLOBAL_DATA_PTR +#define gd get_gd() + +static __inline volatile gd_t *get_gd(void) +{ + gd_t *gd_ptr; + + __asm__ volatile("mov %0, r9\n" : "=r" (gd_ptr)); + + return gd_ptr; +} + +#else + #ifdef CONFIG_ARM64 #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("x18") #else #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r9") #endif +#endif #endif /* __ASM_GBL_DATA_H */