]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
powerpc: Stack Pointer not properly aligned
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>
Mon, 23 Jul 2012 10:58:03 +0000 (10:58 +0000)
committerAndy Fleming <afleming@freescale.com>
Wed, 22 Aug 2012 21:07:42 +0000 (16:07 -0500)
The code first aligns the SP to 16 then subtract 8, making it
8 bytes aligned. Furthermore the initial stack frame not
quite correct either.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Signed-off-by: Andy Fleming <afleming@freescale.com>
arch/powerpc/lib/board.c

index fea310eedd1c5ce4cc4f82246d09661f6fe042f0..435ef10a2eb75ad7581539ff76eaa07642c79d54 100644 (file)
@@ -521,9 +521,8 @@ void board_init_f(ulong bootflag)
        addr_sp -= 16;
        addr_sp &= ~0xF;
        s = (ulong *) addr_sp;
-       *s-- = 0;
-       *s-- = 0;
-       addr_sp = (ulong) s;
+       *s = 0; /* Terminate back chain */
+       *++s = 0; /* NULL return address */
        debug("Stack Pointer at: %08lx\n", addr_sp);
 
        /*