diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2019-08-17 17:29:36 +0300 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2019-08-26 20:59:45 +0000 |
commit | 21160a72eb4df56bd446353d81973a4c7c223922 (patch) | |
tree | d2f5ed65639aa6b8e09dd0641bb550a57ee46158 /src/include | |
parent | 117cf2bdcbbadb3b30c9c250130f82f5e6edc236 (diff) |
Add definition for ENV_ROMSTAGE_OR_BEFORE to <rules.h>
ENV_ROMSTAGE_OR_BEFORE is a direct replacement for testing
defined(__PRE_RAM__) as a true statement instead of with the
help of the preprocessor.
Note that for x86, due to existence of ENV_POSTCAR and ENV_SMM,
ENV_ROMSTAGE_OR_BEFORE and ENV_RAMSTAGE are not the inverse of
each other.
Change-Id: Ibd2292f922ccb9e79d10ca9bc35797048d174287
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/34939
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/rules.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/include/rules.h b/src/include/rules.h index ed147224b9..8a6945b94c 100644 --- a/src/include/rules.h +++ b/src/include/rules.h @@ -266,9 +266,12 @@ #define ENV_PAYLOAD_LOADER ENV_RAMSTAGE #endif +#define ENV_ROMSTAGE_OR_BEFORE \ + (ENV_DECOMPRESSOR || ENV_BOOTBLOCK || ENV_VERSTAGE || ENV_ROMSTAGE) + #if CONFIG(ARCH_X86) -/* Indicates memory layout is determined by arch/x86/car.ld. */ -#define ENV_CACHE_AS_RAM (ENV_BOOTBLOCK || ENV_ROMSTAGE || ENV_VERSTAGE) +/* Indicates memory layout is determined with arch/x86/car.ld. */ +#define ENV_CACHE_AS_RAM ENV_ROMSTAGE_OR_BEFORE /* No .data sections with execute-in-place from ROM. */ #define ENV_STAGE_HAS_DATA_SECTION !ENV_CACHE_AS_RAM /* No .bss sections with execute-in-place from ROM. */ @@ -294,7 +297,7 @@ * be built with simple device model. */ -#if (defined(__PRE_RAM__) || ENV_SMM || !ENV_PAYLOAD_LOADER) +#if !ENV_RAMSTAGE #define __SIMPLE_DEVICE__ #endif |