aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Song <barry.song@analog.com>2010-01-05 02:25:24 -0500
committerMike Frysinger <vapier@gentoo.org>2010-03-09 00:30:48 -0500
commitaad16f32284030907b4f105e92e5fb534fd272bc (patch)
treed55bf69a4c8e97be7777d1f1ce3c04cec15be3d0
parent8916a1499d958fcb9086a2c49a5fa3000689bb81 (diff)
Blackfin: fix initial stack pointer setup
During very early init, the stack pointer is given a slightly incorrect value (&init_thread_union). The value is later adjusted to the right one during early init (&init_thread_union + THREAD_SIZE), but it is used a few times in between. While the few functions used don't actually put things onto the stack (due to optimization), it's best if we simply use the right value from the start. Signed-off-by: Barry Song <barry.song@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--arch/blackfin/mach-common/head.S11
1 files changed, 3 insertions, 8 deletions
diff --git a/arch/blackfin/mach-common/head.S b/arch/blackfin/mach-common/head.S
index cab0a0031eee..cf037782c8ad 100644
--- a/arch/blackfin/mach-common/head.S
+++ b/arch/blackfin/mach-common/head.S
@@ -144,8 +144,8 @@ ENTRY(__start)
144#endif 144#endif
145 145
146 /* Initialize stack pointer */ 146 /* Initialize stack pointer */
147 sp.l = _init_thread_union; 147 sp.l = _init_thread_union + THREAD_SIZE;
148 sp.h = _init_thread_union; 148 sp.h = _init_thread_union + THREAD_SIZE;
149 fp = sp; 149 fp = sp;
150 usp = sp; 150 usp = sp;
151 151
@@ -257,12 +257,7 @@ ENTRY(_real_start)
257 R0 = R7; 257 R0 = R7;
258 call _cmdline_init; 258 call _cmdline_init;
259 259
260 /* Load the current thread pointer and stack */ 260 sp += -12 + 4; /* +4 is for reti loading above */
261 p1 = THREAD_SIZE + 4 (z); /* +4 is for reti loading */
262 sp = sp + p1;
263 usp = sp;
264 fp = sp;
265 sp += -12;
266 call _init_pda 261 call _init_pda
267 sp += 12; 262 sp += 12;
268 jump.l _start_kernel; 263 jump.l _start_kernel;