From patchwork Tue Feb 4 08:56:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 316493 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 190902C0084 for ; Tue, 4 Feb 2014 19:57:53 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3B0264B9B3; Tue, 4 Feb 2014 09:57:37 +0100 (CET) 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 w0H1SQybEDmu; Tue, 4 Feb 2014 09:57:37 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 432F74B9E2; Tue, 4 Feb 2014 09:57:00 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6D6784B999 for ; Tue, 4 Feb 2014 09:56:52 +0100 (CET) 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 PZoApTEuSEKZ for ; Tue, 4 Feb 2014 09:56:51 +0100 (CET) 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 smtprelay.synopsys.com (smtprelay2.synopsys.com [198.182.60.111]) by theia.denx.de (Postfix) with ESMTPS id 8DA6F4B993 for ; Tue, 4 Feb 2014 09:56:50 +0100 (CET) Received: from us02secmta1.synopsys.com (us02secmta1.synopsys.com [10.12.235.96]) by smtprelay.synopsys.com (Postfix) with ESMTP id CF4EA10C1114; Tue, 4 Feb 2014 00:56:48 -0800 (PST) Received: from us02secmta1.internal.synopsys.com (us02secmta1.internal.synopsys.com [127.0.0.1]) by us02secmta1.internal.synopsys.com (Service) with ESMTP id C31214E21D; Tue, 4 Feb 2014 00:56:48 -0800 (PST) Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.9.202.240]) by us02secmta1.internal.synopsys.com (Service) with ESMTP id 97EE54E202; Tue, 4 Feb 2014 00:56:48 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 88B4E53C; Tue, 4 Feb 2014 00:56:48 -0800 (PST) Received: from abrodkin-8560l.internal.synopsys.com (unknown [10.225.15.140]) by mailhost.synopsys.com (Postfix) with ESMTP id 317E453B; Tue, 4 Feb 2014 00:56:45 -0800 (PST) From: Alexey Brodkin To: u-boot@lists.denx.de Date: Tue, 4 Feb 2014 12:56:17 +0400 Message-Id: <1391504181-15372-6-git-send-email-abrodkin@synopsys.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1391504181-15372-1-git-send-email-abrodkin@synopsys.com> References: <1391504181-15372-1-git-send-email-abrodkin@synopsys.com> Cc: pierrick.hascoet@abilis.com, Francois Bedard , Vineet Gupta , Alexey Brodkin , noamc@ezchip.com Subject: [U-Boot] [PATCH v4 5/9] arc: add support for standalone programs 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 Signed-off-by: Alexey Brodkin Cc: Vineet Gupta Cc: Francois Bedard Cc: Wolfgang Denk Cc: Heiko Schocher --- Changes for v4: * Clean-up of EXPORT_FUNC for ARC. examples/standalone/stubs.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c index 32a19ce..c5c025d 100644 --- a/examples/standalone/stubs.c +++ b/examples/standalone/stubs.c @@ -210,6 +210,19 @@ gd_t *global_data; " l.jr r13\n" \ " l.nop\n" \ : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r13"); +#elif defined(CONFIG_ARC) +/* + * r25 holds the pointer to the global_data. r10 is call clobbered. + */ +#define EXPORT_FUNC(x) \ + asm volatile( \ +" .align 4\n" \ +" .globl " #x "\n" \ +#x ":\n" \ +" ld r10, [r25, %0]\n" \ +" ld r10, [r10, %1]\n" \ +" j [r10]\n" \ + : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r10"); #else /*" addi $sp, $sp, -24\n" \ " br $r16\n" \*/