[coreboot-gerrit] New patch to review for coreboot: d8461af armv7-m: set stack pointer to _estack

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Wed Apr 8 11:45:45 CEST 2015


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9384

-gerrit

commit d8461af6ca991889e2cf1e9249aee66dddb53fe7
Author: Daisuke Nojiri <dnojiri at chromium.org>
Date:   Fri Oct 24 09:38:31 2014 -0700

    armv7-m: set stack pointer to _estack
    
    this change sets the stack pointer to the value specified in
    memlayout.ld before jumping to the bootblock.
    
    BUG=none
    BRANCH=ToT
    TEST=Built cosmos and all other current boards.
    
    Change-Id: Ic1b790f27bce431124ba70cc2d3d3607c537564b
    Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
    Original-Commit-Id: d50fd02db8bf10147fd808f3030e6297b9ca0aad
    Original-Change-Id: I4bb8cea7435d2a0e2c1ced050c3366d2e636cb8a
    Original-Signed-off-by: Daisuke Nojiri <dnojiri at chromium.org>
    Original-Reviewed-on: https://chromium-review.googlesource.com/225420
    Original-Reviewed-by: Vadim Bendebury <vbendeb at chromium.org>
---
 src/arch/arm/armv7/bootblock_m.S | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/arch/arm/armv7/bootblock_m.S b/src/arch/arm/armv7/bootblock_m.S
index 0a29a0b..2e46ca0 100644
--- a/src/arch/arm/armv7/bootblock_m.S
+++ b/src/arch/arm/armv7/bootblock_m.S
@@ -31,5 +31,20 @@
 #include <arch/asm.h>
 
 ENTRY(_start)
+	/*
+	 * Initialize the stack to a known value. This is used to check for
+	 * stack overflow later in the boot process.
+	 */
+	ldr	r0, =_stack
+	ldr	r1, =_estack
+	ldr	r2, =0xdeadbeef
+init_stack_loop:
+	str	r2, [r0]
+	add	r0, #4
+	cmp	r0, r1
+	bne	init_stack_loop
+
+call_bootblock:
+	ldr	sp, =_estack /* Set up stack pointer */
 	bl	main
 ENDPROC(_start)



More information about the coreboot-gerrit mailing list