]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
arc: add support for standalone programs
authorAlexey Brodkin <Alexey.Brodkin@synopsys.com>
Tue, 4 Feb 2014 08:56:17 +0000 (12:56 +0400)
committerTom Rini <trini@ti.com>
Fri, 7 Feb 2014 13:14:33 +0000 (08:14 -0500)
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Vineet Gupta <vgupta@synopsys.com>
Cc: Francois Bedard <fbedard@synopsys.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Heiko Schocher <hs@denx.de>
examples/standalone/stubs.c

index 32a19ce35495d4de76b0bea6c1c6dbce3862b7c9..c5c025dab33060ec870cf49733eb8420ce4456d6 100644 (file)
@@ -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");
 "      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"                 \*/
 #else
 /*"    addi    $sp, $sp, -24\n"        \
 "      br      $r16\n"                 \*/