summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Song2010-01-05 08:25:24 +0100
committerMike Frysinger2010-03-09 06:30:48 +0100
commitaad16f32284030907b4f105e92e5fb534fd272bc (patch)
treed55bf69a4c8e97be7777d1f1ce3c04cec15be3d0
parentBlackfin: fix the section name of init_thread_union (diff)
downloadkernel-qcow2-linux-aad16f32284030907b4f105e92e5fb534fd272bc.tar.gz
kernel-qcow2-linux-aad16f32284030907b4f105e92e5fb534fd272bc.tar.xz
kernel-qcow2-linux-aad16f32284030907b4f105e92e5fb534fd272bc.zip
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)
#endif
/* Initialize stack pointer */
- sp.l = _init_thread_union;
- sp.h = _init_thread_union;
+ sp.l = _init_thread_union + THREAD_SIZE;
+ sp.h = _init_thread_union + THREAD_SIZE;
fp = sp;
usp = sp;
@@ -257,12 +257,7 @@ ENTRY(_real_start)
R0 = R7;
call _cmdline_init;
- /* Load the current thread pointer and stack */
- p1 = THREAD_SIZE + 4 (z); /* +4 is for reti loading */
- sp = sp + p1;
- usp = sp;
- fp = sp;
- sp += -12;
+ sp += -12 + 4; /* +4 is for reti loading above */
call _init_pda
sp += 12;
jump.l _start_kernel;