summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2015-10-15 18:27:41 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-11-08 07:59:39 -0800
commit260e85cd07135c4d7ab2696ac1cc8212e092ecdb (patch)
treeed154bd876afe57dec79d517afc83f7c93b29e9d /core
parente97da2f17c8eb188c09177b821521bebf5d830ea (diff)
downloadchrome-ec-260e85cd07135c4d7ab2696ac1cc8212e092ecdb.tar.gz
system: Copy the loader lastly before jumping.
The point at which we reloaded the loader was too early. When items are placed into .bss.slow via CONFIG_REPLACE_LOADER_WITH_BSS_SLOW, other tasks could still access their variables that may have been in that region after we had replaced those contents with the loader. This commit moves the reloading of the loader to as late as possible once all tasks have done their HOOK_SYSJUMP work. Also, fixed a bug with the .bss.slow section. If a board is not using the config option but items are placed in that section, that part of RAM would not be cleared out. BUG=chrome-os-partner:46056 BRANCH=None TEST=Enable config option on GLaDOS and add a few variables to the .bss.slow section. 'sysjump' between RO and RW and verify that no data bus error is encountered. TEST=make -j buildall tests Change-Id: I3084700b9d5c144e86e2e408b72d2e3075a67413 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/306173 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/cortex-m/ec.lds.S8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S
index f778ca8f88..9fe53747b2 100644
--- a/core/cortex-m/ec.lds.S
+++ b/core/cortex-m/ec.lds.S
@@ -223,8 +223,10 @@ SECTIONS
*(.bss.system_stack)
/* Rest of .bss takes care of its own alignment */
*(.bss)
+#ifdef CONFIG_REPLACE_LOADER_WITH_BSS_SLOW
. = ALIGN(4);
__bss_end = .;
+#endif /* defined(CONFIG_REPLACE_LOADER_WITH_BSS_SLOW) */
} > IRAM
.bss.slow : {
@@ -233,6 +235,12 @@ SECTIONS
#ifdef CONFIG_REPLACE_LOADER_WITH_BSS_SLOW
} > LDR_REGION
#else
+ /*
+ * Not replacing the loader, so .bss.slow is part of .bss. It needs to
+ * be followed by __bss_end so that .bss.slow will be zeroed by init.
+ */
+ . = ALIGN(4);
+ __bss_end = .;
} > IRAM
#endif /* defined(CONFIG_REPLACE_LOADER_WITH_BSS_SLOW) */