summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2015-11-04 13:40:49 -0800
committerchrome-bot <chrome-bot@chromium.org>2015-11-08 07:59:40 -0800
commitda87d12ec838d3d54d80c7ff3c92b8cc81cf59f6 (patch)
tree5f03c581efda57f7b8b257ae9eb5edf54251709a
parent260e85cd07135c4d7ab2696ac1cc8212e092ecdb (diff)
downloadchrome-ec-da87d12ec838d3d54d80c7ff3c92b8cc81cf59f6.tar.gz
common.h: Create __bss_slow tag.
Some ECs such as the MEC1322 have a data RAM optimized region as well as a code RAM optimized region. We discovered that we could save quite a bit more space by reusing the a portion of the code RAM region as an additional .bss section. However, this region resides in the code RAM region. If on the same cycle the processor fetches an instruction and does a load or store to this code RAM region, the data access will be delayed by one cycle. Hence, the naming of ``.bss.slow" section. For boards which do not define CONFIG_REUSE_LOADER_WITH_BSS_SLOW, all objects bearing this tag will be simply appended to the existing .bss section. BUG=chrome-os-partner:46056 BUG=chrome-os-partner:46063 BRANCH=None TEST=make -j buildall tests CQ-DEPEND=CL:306173 Change-Id: I126fbeee5255732a6dd6fea1d4557fc2b2c62c96 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/311209 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--include/common.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/common.h b/include/common.h
index fe51a9b79b..84b9366064 100644
--- a/include/common.h
+++ b/include/common.h
@@ -68,6 +68,16 @@
#define __keep __attribute__((used)) __attribute__((externally_visible))
#endif
+/*
+ * Place the object in the .bss.slow region.
+ *
+ * On boards with unoptimized RAM there is no penalty and it simply is appended
+ * to the .bss section.
+ */
+#ifndef __bss_slow
+#define __bss_slow __attribute__((section(".bss.slow")))
+#endif
+
/* There isn't really a better place for this */
#define C_TO_K(temp_c) ((temp_c) + 273)
#define K_TO_C(temp_c) ((temp_c) - 273)