public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] powerpc: Stack Pointer must be 16 aligned
@ 2012-07-20  9:20 Joakim Tjernlund
  2012-07-20  9:20 ` [U-Boot] [PATCH 2/2] mpc85xx: Initial SP alignment is wrong Joakim Tjernlund
  2012-07-20 21:12 ` [U-Boot] [PATCH 1/2] powerpc: Stack Pointer must be 16 aligned Scott Wood
  0 siblings, 2 replies; 11+ messages in thread
From: Joakim Tjernlund @ 2012-07-20  9:20 UTC (permalink / raw)
  To: u-boot

The PowerPC ABI mandates the SP to be 16 bytes aligned, make is so.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
---
 arch/powerpc/lib/board.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git arch/powerpc/lib/board.c arch/powerpc/lib/board.c
index d5b75e5..dc7cc40 100644
--- arch/powerpc/lib/board.c
+++ arch/powerpc/lib/board.c
@@ -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;   /* NULL Back Chain */
+	*--s = 0; /* NULL LR */
 	debug("Stack Pointer at: %08lx\n", addr_sp);
 
 	/*
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-07-23 21:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-20  9:20 [U-Boot] [PATCH 1/2] powerpc: Stack Pointer must be 16 aligned Joakim Tjernlund
2012-07-20  9:20 ` [U-Boot] [PATCH 2/2] mpc85xx: Initial SP alignment is wrong Joakim Tjernlund
2012-07-20 21:11   ` Scott Wood
2012-07-21 15:06     ` Joakim Tjernlund
2012-07-23  9:52       ` Joakim Tjernlund
2012-07-23 16:52       ` Scott Wood
2012-07-23 17:11         ` Joakim Tjernlund
2012-07-23 17:28           ` Scott Wood
2012-07-23 21:02             ` Joakim Tjernlund
2012-07-20 21:12 ` [U-Boot] [PATCH 1/2] powerpc: Stack Pointer must be 16 aligned Scott Wood
2012-07-21 15:10   ` Joakim Tjernlund

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox