]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - examples/standalone/stubs.c
Merge branch 'master' of git://git.denx.de/u-boot-arm
[karo-tx-uboot.git] / examples / standalone / stubs.c
index 8fb17653b0d22cf9023dc23cdaceeed4ee090f6e..32a19ce35495d4de76b0bea6c1c6dbce3862b7c9 100644 (file)
@@ -39,17 +39,32 @@ gd_t *global_data;
 "      bctr\n"                         \
        : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r11");
 #elif defined(CONFIG_ARM)
+#ifdef CONFIG_ARM64
 /*
- * r8 holds the pointer to the global_data, ip is a call-clobbered
+ * x18 holds the pointer to the global_data, x9 is a call-clobbered
  * register
  */
 #define EXPORT_FUNC(x) \
        asm volatile (                  \
 "      .globl " #x "\n"                \
 #x ":\n"                               \
-"      ldr     ip, [r8, %0]\n"         \
+"      ldr     x9, [x18, %0]\n"                \
+"      ldr     x9, [x9, %1]\n"         \
+"      br      x9\n"           \
+       : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "x9");
+#else
+/*
+ * r9 holds the pointer to the global_data, ip is a call-clobbered
+ * register
+ */
+#define EXPORT_FUNC(x) \
+       asm volatile (                  \
+"      .globl " #x "\n"                \
+#x ":\n"                               \
+"      ldr     ip, [r9, %0]\n"         \
 "      ldr     pc, [ip, %1]\n"         \
        : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "ip");
+#endif
 #elif defined(CONFIG_MIPS)
 /*
  * k0 ($26) holds the pointer to the global_data; t9 ($25) is a call-