summaryrefslogtreecommitdiffstats
path: root/examples/stubs.c
diff options
context:
space:
mode:
authorwdenk <wdenk>2004-10-10 21:27:30 +0000
committerwdenk <wdenk>2004-10-10 21:27:30 +0000
commit5c952cf0245421feb4644f2e71487c0b2e1dbd13 (patch)
tree47b80e839d339fe11dabd01ec8c89b46b791f797 /examples/stubs.c
parent03f5c55021c2d6297e66cc11bfea75f149a5d71c (diff)
downloadbarebox-5c952cf0245421feb4644f2e71487c0b2e1dbd13.tar.gz
barebox-5c952cf0245421feb4644f2e71487c0b2e1dbd13.tar.xz
Patches by Scott McNutt, 24 Aug 2004:
- Add support for Altera Nios-II processors. - Add support for Psyent PCI-5441 board. - Add support for Psyent PK1C20 board.
Diffstat (limited to 'examples/stubs.c')
-rw-r--r--examples/stubs.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/stubs.c b/examples/stubs.c
index c3d2a77a82..d4c6e063e3 100644
--- a/examples/stubs.c
+++ b/examples/stubs.c
@@ -82,6 +82,21 @@ gd_t *global_data;
" jmp %%g0\n" \
" nop \n" \
: : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x) : "r0");
+#elif defined(CONFIG_NIOS2)
+/*
+ * r15 holds the pointer to the global_data, r8 is call-clobbered
+ */
+#define EXPORT_FUNC(x) \
+ asm volatile ( \
+" .globl " #x "\n" \
+#x ":\n" \
+" movhi r8, %%hi(%0)\n" \
+" ori r8, r0, %%lo(%0)\n" \
+" add r8, r0, r15\n" \
+" ldw r8, 0(r8)\n" \
+" ldw r8, %1(r8)\n" \
+" jmp r8\n" \
+ : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r15");
#elif defined(CONFIG_M68K)
/*
* d7 holds the pointer to the global_data, a0 is a call-clobbered