From da87d12ec838d3d54d80c7ff3c92b8cc81cf59f6 Mon Sep 17 00:00:00 2001 From: Aseda Aboagye Date: Wed, 4 Nov 2015 13:40:49 -0800 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/311209 Commit-Ready: Aseda Aboagye Tested-by: Aseda Aboagye Reviewed-by: Randall Spangler --- include/common.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/common.h') 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) -- cgit v1.2.1