X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=examples%2Fstandalone%2Fstubs.c;h=0827bde35e581b27b9b7d081fef35ae296c4f698;hb=b5b9eff26d28feb7dc59661b78e5844d12fca0c8;hp=a6a9fcf189a4dbf1ad5e0c3044a5a3f97cc9ef0c;hpb=04735a8fc45ba7c9f5b17d4837a0c649087b29e1;p=oweals%2Fu-boot.git diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c index a6a9fcf189..0827bde35e 100644 --- a/examples/standalone/stubs.c +++ b/examples/standalone/stubs.c @@ -141,19 +141,6 @@ gd_t *global_data; " lwi r5, r5, %1\n" \ " bra r5\n" \ : : "i"(offsetof(gd_t, jt)), "i"(FO(x)) : "r5"); -#elif defined(CONFIG_AVR32) -/* - * r6 holds the pointer to the global_data. r8 is call clobbered. - */ -#define EXPORT_FUNC(f, a, x, ...) \ - asm volatile( \ - " .globl\t" #x "\n" \ - #x ":\n" \ - " ld.w r8, r6[%0]\n" \ - " ld.w pc, r8[%1]\n" \ - : \ - : "i"(offsetof(gd_t, jt)), "i"(FO(x)) \ - : "r8"); #elif defined(CONFIG_SH) /* * r13 holds the pointer to the global_data. r1 is a call clobbered. @@ -185,6 +172,29 @@ gd_t *global_data; " lwi $r16, [$r16 + (%1)]\n" \ " jr $r16\n" \ : : "i"(offsetof(gd_t, jt)), "i"(FO(x)) : "$r16"); +#elif defined(CONFIG_RISCV) +/* + * gp holds the pointer to the global_data. t0 is call clobbered. + */ +#ifdef CONFIG_ARCH_RV64I +#define EXPORT_FUNC(f, a, x, ...) \ + asm volatile ( \ +" .globl " #x "\n" \ +#x ":\n" \ +" ld t0, %0(gp)\n" \ +" ld t0, %1(t0)\n" \ +" jr t0\n" \ + : : "i"(offsetof(gd_t, jt)), "i"(FO(x)) : "t0"); +#else +#define EXPORT_FUNC(f, a, x, ...) \ + asm volatile ( \ +" .globl " #x "\n" \ +#x ":\n" \ +" lw t0, %0(gp)\n" \ +" lw t0, %1(t0)\n" \ +" jr t0\n" \ + : : "i"(offsetof(gd_t, jt)), "i"(FO(x)) : "t0"); +#endif #elif defined(CONFIG_ARC) /* * r25 holds the pointer to the global_data. r10 is call clobbered.