浏览代码

arc: add support for standalone programs

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>
Alexey Brodkin 11 年之前
父节点
当前提交
794ab57497
共有 1 个文件被更改,包括 13 次插入0 次删除
  1. 13 0
      examples/standalone/stubs.c

+ 13 - 0
examples/standalone/stubs.c

@@ -210,6 +210,19 @@ gd_t *global_data;
 "	l.jr	r13\n"		\
 "	l.jr	r13\n"		\
 "	l.nop\n"				\
 "	l.nop\n"				\
 	: : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r13");
 	: : "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
 #else
 /*"	addi	$sp, $sp, -24\n"	\
 /*"	addi	$sp, $sp, -24\n"	\
 "	br	$r16\n"			\*/
 "	br	$r16\n"			\*/