From 1705d6546df6e56b15fa76389eafa2430afa9eb9 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Tue, 17 Apr 2018 17:33:10 -0600 Subject: arch/x86: add ENV_CACHE_AS_RAM Add ENV_CACHE_AS_RAM to indicate to compilation units if cache-as-ram is employed for that particular stage. BUG=b:72728953 Change-Id: I06dfa7afe2d967229549090d5aa95455687b0bb9 Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/25716 Tested-by: build bot (Jenkins) Reviewed-by: Justin TerAvest --- src/arch/x86/include/arch/early_variables.h | 2 +- src/include/rules.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/arch/x86/include/arch/early_variables.h b/src/arch/x86/include/arch/early_variables.h index 2c6c539654..1b6810de86 100644 --- a/src/arch/x86/include/arch/early_variables.h +++ b/src/arch/x86/include/arch/early_variables.h @@ -20,7 +20,7 @@ #include #include -#if defined(__PRE_RAM__) && IS_ENABLED(CONFIG_CACHE_AS_RAM) +#if ENV_CACHE_AS_RAM asm(".section .car.global_data,\"w\",@nobits"); asm(".previous"); #ifdef __clang__ diff --git a/src/include/rules.h b/src/include/rules.h index 8cb6d86683..4017d37ff5 100644 --- a/src/include/rules.h +++ b/src/include/rules.h @@ -253,4 +253,12 @@ #define __SIMPLE_DEVICE__ #endif +/* x86 specific. Indicates that the current stage is running with cache-as-ram + * enabled from the beginning of the stage in C code. */ +#if defined(__PRE_RAM__) +#define ENV_CACHE_AS_RAM IS_ENABLED(CONFIG_CACHE_AS_RAM) +#else +#define ENV_CACHE_AS_RAM 0 +#endif + #endif /* _RULES_H */ -- cgit v1.2.3