summaryrefslogtreecommitdiff
path: root/examples/standalone/x86-testapp.c
diff options
context:
space:
mode:
authorMacpaul Lin <macpaul@andestech.com>2011-10-11 22:33:20 +0000
committerWolfgang Denk <wd@denx.de>2011-10-22 00:53:48 +0200
commit72c73ddec3d50776fda2fcd92854f0d9fc9d4a33 (patch)
treeb6884d2e3f5870552bd74d6181df17d4ce72a94d /examples/standalone/x86-testapp.c
parent463d47f66ce19aac043d98d77a958908e2a3eb39 (diff)
downloadu-boot-imx-72c73ddec3d50776fda2fcd92854f0d9fc9d4a33.zip
u-boot-imx-72c73ddec3d50776fda2fcd92854f0d9fc9d4a33.tar.gz
u-boot-imx-72c73ddec3d50776fda2fcd92854f0d9fc9d4a33.tar.bz2
nds32: standalone support
Add standalone program related support for nds32 architecture. Signed-off-by: Macpaul Lin <macpaul@andestech.com>
Diffstat (limited to 'examples/standalone/x86-testapp.c')
-rw-r--r--examples/standalone/x86-testapp.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/examples/standalone/x86-testapp.c b/examples/standalone/x86-testapp.c
index e8603d9..1e16ec7 100644
--- a/examples/standalone/x86-testapp.c
+++ b/examples/standalone/x86-testapp.c
@@ -52,6 +52,17 @@ asm volatile ( \
" lw $25, %1($25)\n" \
" jr $25\n" \
: : "i"(offsetof(xxx_t, pfunc)), "i"(XF_ ## x * sizeof(void *)) : "t9");
+#elif defined(__nds32__)
+#define EXPORT_FUNC(x) \
+asm volatile ( \
+" .globl mon_" #x "\n" \
+"mon_" #x ":\n" \
+" lwi $r16, [$gp + (%0)]\n" \
+" lwi $r16, [$r16 + (%1)]\n" \
+" jr $r16\n" \
+: : "i"(offsetof(xxx_t, pfunc)), \
+"i"(XF_ ## x * sizeof(void *)) : "$r16");
+
#else
#error [No stub code for this arch]
#endif
@@ -72,6 +83,8 @@ int main(void)
register volatile xxx_t *pq asm("r8");
#elif defined(__mips__)
register volatile xxx_t *pq asm("k0");
+#elif defined(__nds32__)
+ register volatile xxx_t *pq asm("$r16");
#endif
char buf[32];