summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/arch/arm/armv7/bootblock_m.S15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/arch/arm/armv7/bootblock_m.S b/src/arch/arm/armv7/bootblock_m.S
index 0a29a0b4cc..2e46ca064f 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)