]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - examples/stubs.c
ppc4xx: HCU4/5. Fix make O=../xx
[karo-tx-uboot.git] / examples / stubs.c
index 26df6e06a15ea58d8853fbbcd30ce3b14002581e..571c4d50a437e905a289a177b4a4721e24850b1d 100644 (file)
@@ -132,7 +132,7 @@ gd_t *global_data;
  */
 #define EXPORT_FUNC(x)                 \
        asm volatile (                  \
-"       .globl _" #x "\n_"             \
+"      .globl _" #x "\n_"              \
 #x ":\n"                               \
 "      P0 = [P5 + %0]\n"               \
 "      P0 = [P0 + %1]\n"               \
@@ -151,6 +151,22 @@ gd_t *global_data;
                :                                       \
                : "i"(offsetof(gd_t, jt)), "i"(XF_ ##x) \
                : "r8");
+#elif defined(CONFIG_SH)
+/*
+ * r13 holds the pointer to the global_data. r1 is a call clobbered.
+ */
+#define EXPORT_FUNC(x)                                 \
+       asm volatile (                                  \
+               "       .align  2\n"                    \
+               "       .globl " #x "\n"                \
+               #x ":\n"                                \
+               "       mov     r13, r1\n"              \
+               "       add     %0, r1\n"               \
+               "       add     %1, r1\n"               \
+               "       jmp     @r1\n"                  \
+               "       nop\n"                          \
+               "       nop\n"                          \
+               : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r1");
 #else
 #error stubs definition missing for this architecture
 #endif