X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=examples%2Fstandalone%2Fx86-testapp.c;h=1e16ec7e0e8475e431b72da622aee8164daef441;hb=7794b1a7e6bb7fd678f00b17feb15e5d392fb5b0;hp=e8603d9bac6047009b5ebabcae920019bd0b2405;hpb=84efbf4d144ff8aaed3cca036aebb1fe69eff3f4;p=u-boot diff --git a/examples/standalone/x86-testapp.c b/examples/standalone/x86-testapp.c index e8603d9bac..1e16ec7e0e 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];