aboutsummaryrefslogtreecommitdiff
path: root/bl31
diff options
context:
space:
mode:
authorSandrine Bailleux <sandrine.bailleux@arm.com>2013-11-28 09:43:06 +0000
committerDan Handley <dan.handley@arm.com>2013-12-05 11:33:15 +0000
commit65f546a14fbc0438c051b4243f71abd2206a7307 (patch)
tree1187ac9d3eb596ecb61ac4568969041392764a14 /bl31
parent8d69a03f6a7db3c437b7cfdd15402627277d8cb4 (diff)
downloadarm-trusted-firmware-65f546a14fbc0438c051b4243f71abd2206a7307.tar.gz
Properly initialise the C runtime environment
This patch makes sure the C runtime environment is properly initialised before executing any C code. - Zero-initialise NOBITS sections (e.g. the bss section). - Relocate BL1 data from ROM to RAM. Change-Id: I0da81b417b2f0d1f7ef667cc5131b1e47e22571f
Diffstat (limited to 'bl31')
-rw-r--r--bl31/aarch64/bl31_entrypoint.S14
1 files changed, 14 insertions, 0 deletions
diff --git a/bl31/aarch64/bl31_entrypoint.S b/bl31/aarch64/bl31_entrypoint.S
index cb481b8..13725d7 100644
--- a/bl31/aarch64/bl31_entrypoint.S
+++ b/bl31/aarch64/bl31_entrypoint.S
@@ -93,6 +93,20 @@ bl31_entrypoint:; .type bl31_entrypoint, %function
bl platform_is_primary_cpu
cbz x0, _panic
+ /* ---------------------------------------------
+ * Zero out NOBITS sections. There are 2 of them:
+ * - the .bss section;
+ * - the coherent memory section.
+ * ---------------------------------------------
+ */
+ ldr x0, =__BSS_START__
+ ldr x1, =__BSS_SIZE__
+ bl zeromem16
+
+ ldr x0, =__COHERENT_RAM_START__
+ ldr x1, =__COHERENT_RAM_UNALIGNED_SIZE__
+ bl zeromem16
+
/* --------------------------------------------
* Give ourselves a small coherent stack to
* ease the pain of initializing the MMU