From 00d6017bdff7e5b38f3c5e4feafb091d22610310 Mon Sep 17 00:00:00 2001 From: Till Straumann Date: Wed, 11 Nov 2009 14:29:08 +0000 Subject: [PATCH] 2009-11-11 Till Straumann * start/start.S: Ensure that initial stack is aligned to CPU_STACK_ALIGNMENT. --- c/src/lib/libbsp/powerpc/psim/start/start.S | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/c/src/lib/libbsp/powerpc/psim/start/start.S b/c/src/lib/libbsp/powerpc/psim/start/start.S index 2e32543fb7..f28afd5cff 100644 --- a/c/src/lib/libbsp/powerpc/psim/start/start.S +++ b/c/src/lib/libbsp/powerpc/psim/start/start.S @@ -100,9 +100,12 @@ _start: .Lnostack: /* set up initial stack frame */ addi sp,sp,-4 /* make sure we don't overwrite debug mem */ + /* align */ + li r3, CPU_STACK_ALIGNMENT-1 + andc sp, sp, r3 lis r0,0 stw r0,0(sp) /* clear back chain */ - stwu sp,-56(sp) /* push another stack frame */ + stwu sp,-CPU_STACK_ALIGNMENT(sp) /* push another stack frame */ bl FUNC_NAME(__eabi) /* Let her rip */