From patchwork Sun Nov 27 05:04:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Kristiansson X-Patchwork-Id: 127843 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 E0B28B70ED for ; Sun, 27 Nov 2011 16:08:02 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C6612280CB; Sun, 27 Nov 2011 06:07:31 +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 zmk7Xba982oH; Sun, 27 Nov 2011 06:07:31 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F074B280C4; Sun, 27 Nov 2011 06:07:15 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 46719280A2 for ; Sun, 27 Nov 2011 06:06:48 +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 PZGP-eDXcngd for ; Sun, 27 Nov 2011 06:06:47 +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 smtp-68.nebula.fi (smtp-68.nebula.fi [83.145.220.68]) by theia.denx.de (Postfix) with ESMTPS id 3BB34280A5 for ; Sun, 27 Nov 2011 06:06:44 +0100 (CET) Received: from wonka.TeleWell.gateway (nblzone-224-141.nblnetworks.fi [83.145.224.141]) by smtp-68.nebula.fi (Postfix) with ESMTP id 0D9A543F0826; Sun, 27 Nov 2011 07:06:43 +0200 (EET) From: Stefan Kristiansson To: u-boot@lists.denx.de Date: Sun, 27 Nov 2011 07:04:54 +0200 Message-Id: <1322370297-22892-7-git-send-email-stefan.kristiansson@saunalahti.fi> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1322370297-22892-1-git-send-email-stefan.kristiansson@saunalahti.fi> References: <1322370297-22892-1-git-send-email-stefan.kristiansson@saunalahti.fi> Subject: [U-Boot] [PATCH v2 6/9] openrisc: 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: Stefan Kristiansson --- Changes in v2: - None examples/standalone/stubs.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c index 11c7565..8b291db 100644 --- a/examples/standalone/stubs.c +++ b/examples/standalone/stubs.c @@ -180,6 +180,20 @@ gd_t *global_data; " lwi $r16, [$r16 + (%1)]\n" \ " jr $r16\n" \ : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "$r16"); +#elif defined(CONFIG_OPENRISC) +/* + * r10 holds the pointer to the global_data, r13 is a call-clobbered + * register + */ +#define EXPORT_FUNC(x) \ + asm volatile ( \ +" .globl " #x "\n" \ +#x ":\n" \ +" l.lwz r13, %0(r10)\n" \ +" l.lwz r13, %1(r13)\n" \ +" l.jr r13\n" \ +" l.nop\n" \ + : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r13"); #else /*" addi $sp, $sp, -24\n" \ " br $r16\n" \*/