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 <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/25716
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Justin TerAvest <teravest@chromium.org>
This commit is contained in:
Aaron Durbin 2018-04-17 17:33:10 -06:00
parent 3b16e78a9e
commit 1705d6546d
2 changed files with 9 additions and 1 deletions

View File

@ -20,7 +20,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <rules.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(".section .car.global_data,\"w\",@nobits");
asm(".previous"); asm(".previous");
#ifdef __clang__ #ifdef __clang__

View File

@ -253,4 +253,12 @@
#define __SIMPLE_DEVICE__ #define __SIMPLE_DEVICE__
#endif #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 */ #endif /* _RULES_H */