aboutsummaryrefslogtreecommitdiff
path: root/examples/standalone
diff options
context:
space:
mode:
authorStefan Kristiansson2011-11-18 19:21:35 +0000
committerWolfgang Denk2012-01-13 21:16:55 +0100
commit3553493d8b4e402a737b80b04fab06f6e81bcb69 (patch)
tree9db3cab6ba5095f86765ed46a3f1fc7899efab21 /examples/standalone
parent2be9fdbfcc4d41e3a7f7d6b1b1b21a39ce5aa6e9 (diff)
openrisc: Add support for standalone programs
Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Diffstat (limited to 'examples/standalone')
-rw-r--r--examples/standalone/stubs.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c
index a6add6abcd4..15e9afcacd0 100644
--- a/examples/standalone/stubs.c
+++ b/examples/standalone/stubs.c
@@ -181,6 +181,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" \*/