From: Alexey Brodkin Date: Tue, 4 Feb 2014 08:56:17 +0000 (+0400) Subject: arc: add support for standalone programs X-Git-Tag: v2014.04-rc1~90 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=794ab57497f822e8178b40867bf419375aad4de0;p=oweals%2Fu-boot.git arc: add support for standalone programs Signed-off-by: Alexey Brodkin Cc: Vineet Gupta Cc: Francois Bedard Cc: Wolfgang Denk Cc: Heiko Schocher --- diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c index 32a19ce354..c5c025dab3 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" \*/