summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/arch/x86/include/arch/early_variables.h2
-rw-r--r--src/include/rules.h8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/arch/x86/include/arch/early_variables.h b/src/arch/x86/include/arch/early_variables.h
index 2c6c5396547f..1b6810de8661 100644
--- a/src/arch/x86/include/arch/early_variables.h
+++ b/src/arch/x86/include/arch/early_variables.h
@@ -20,7 +20,7 @@
#include <stdlib.h>
#include <rules.h>
-#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 8cb6d86683c2..4017d37ff5de 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 */