summaryrefslogtreecommitdiff
path: root/common/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/main.c')
-rw-r--r--common/main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/common/main.c b/common/main.c
index 016d4f6279..bafb18c94a 100644
--- a/common/main.c
+++ b/common/main.c
@@ -25,6 +25,7 @@
#include "task.h"
#include "timer.h"
#include "uart.h"
+#include "util.h"
#include "watchdog.h"
/* Console output macros */
@@ -34,6 +35,15 @@
test_mockable __keep int main(void)
{
+#ifdef CONFIG_REPLACE_LOADER_WITH_BSS_SLOW
+ /*
+ * Now that we have started execution, we no longer need the loader.
+ * Instead, variables placed in the .bss.slow section will use this
+ * space. Therefore, clear out this region now.
+ */
+ memset((void *)(CONFIG_PROGRAM_MEMORY_BASE + CONFIG_LOADER_MEM_OFF), 0,
+ CONFIG_LOADER_SIZE);
+#endif /* defined(CONFIG_REPLACE_LOADER_WITH_BSS_SLOW) */
/*
* Pre-initialization (pre-verified boot) stage. Initialization at
* this level should do as little as possible, because verified boot