3 #if defined(CONFIG_I386)
5 * x86 does not have a dedicated register to store the pointer to
6 * the global_data. Thus the jump table address is stored in a
7 * global variable, but such approach does not allow for execution
8 * from flash memory. The global_data address is passed as argv[-1]
9 * to the application program.
14 #define EXPORT_FUNC(x) \
20 " jmp *(%%ecx, %%eax)\n" \
21 : : "i"(XF_ ## x * sizeof(void *)) : "eax", "ecx");
22 #elif defined(CONFIG_PPC)
24 * r29 holds the pointer to the global_data, r11 is a call-clobbered
27 #define EXPORT_FUNC(x) \
31 " lwz %%r11, %0(%%r29)\n" \
32 " lwz %%r11, %1(%%r11)\n" \
35 : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r11");
36 #elif defined(CONFIG_ARM)
38 * r8 holds the pointer to the global_data, ip is a call-clobbered
41 #define EXPORT_FUNC(x) \
45 " ldr ip, [r8, %0]\n" \
46 " ldr pc, [ip, %1]\n" \
47 : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "ip");
48 #elif defined(CONFIG_MIPS)
50 * k0 ($26) holds the pointer to the global_data; t9 ($25) is a call-
51 * clobbered register that is also used to set gp ($26). Note that the
52 * jr instruction also executes the instruction immediately following
53 * it; however, GCC/mips generates an additional `nop' after each asm
56 #define EXPORT_FUNC(x) \
60 " lw $25, %0($26)\n" \
61 " lw $25, %1($25)\n" \
63 : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "t9");
64 #elif defined(CONFIG_NIOS)
66 * %g7 holds the pointer to the global_data. %g0 is call clobbered.
68 #define EXPORT_FUNC(x) \
73 " movi %%g0, %%lo(%0)\n" \
75 " ld %%g0, [%%g0]\n" \
77 " ld %%g0, [%%g0]\n" \
80 : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x) : "r0");
81 #elif defined(CONFIG_M68K)
83 * d7 holds the pointer to the global_data, a0 is a call-clobbered
86 #define EXPORT_FUNC(x) \
90 " move.l %%d7, %%a0\n" \
91 " adda.l %0, %%a0\n" \
92 " move.l (%%a0), %%a0\n" \
93 " adda.l %1, %%a0\n" \
94 " move.l (%%a0), %%a0\n" \
96 : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "a0");
97 #elif defined(CONFIG_MICROBLZE)
99 * r31 holds the pointer to the global_data. r5 is a call-clobbered.
101 #define EXPORT_FUNC(x) \
105 " lwi r5, r31, %0\n" \
106 " lwi r5, r5, %1\n" \
108 : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r5");
110 #error stubs definition missing for this architecture
113 /* This function is necessary to prevent the compiler from
114 * generating prologue/epilogue, preparing stack frame etc.
115 * The stub functions are special, they do not use the stack
116 * frame passed to them, but pass it intact to the actual
117 * implementation. On the other hand, asm() statements with
118 * arguments can be used only inside the functions (gcc limitation)
120 static void __attribute__((unused)) dummy(void)
122 #include <_exports.h>
125 extern unsigned long __bss_start, _end;
127 void app_startup(char **argv)
129 unsigned long * cp = &__bss_start;
136 #if defined(CONFIG_I386)
137 /* x86 does not have a dedicated register for passing global_data */
138 global_data = (gd_t *)argv[-1];
139 jt = global_data->jt;