diff options
author | Julius Werner <jwerner@chromium.org> | 2020-12-30 15:51:10 -0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-02-19 08:39:26 +0000 |
commit | 82d16b150ce3287f4e9f33e86bdde32bc455b193 (patch) | |
tree | f3110d34e3eebb4a57ca429152c1262e65e9f2f4 /src/soc/amd/common/block/cpu/noncar | |
parent | 422501fb14780090527c9a45bcca6628cd6bba71 (diff) |
memlayout: Store region sizes as separate symbols
This patch changes the memlayout macro infrastructure so that the size
of a region "xxx" (i.e. the distance between the symbols _xxx and _exxx)
is stored in a separate _xxx_size symbol. This has the advantage that
region sizes can be used inside static initializers, and also saves an
extra subtraction at runtime. Since linker symbols can only be treated
as addresses (not as raw integers) by C, retain the REGION_SIZE()
accessor macro to hide the necessary typecast.
Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: Ifd89708ca9bd3937d0db7308959231106a6aa373
Reviewed-on: https://review.coreboot.org/c/coreboot/+/49332
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/soc/amd/common/block/cpu/noncar')
-rw-r--r-- | src/soc/amd/common/block/cpu/noncar/memlayout_x86.ld | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/soc/amd/common/block/cpu/noncar/memlayout_x86.ld b/src/soc/amd/common/block/cpu/noncar/memlayout_x86.ld index ff6aebf3fb..e5044e6d43 100644 --- a/src/soc/amd/common/block/cpu/noncar/memlayout_x86.ld +++ b/src/soc/amd/common/block/cpu/noncar/memlayout_x86.ld @@ -4,11 +4,11 @@ #include <arch/header.ld> #include <soc/psp_transfer.h> -#define EARLY_RESERVED_DRAM_START(addr) SYMBOL(early_reserved_dram, addr) -#define EARLY_RESERVED_DRAM_END(addr) SYMBOL(eearly_reserved_dram, addr) +#define EARLY_RESERVED_DRAM_START(addr) REGION_START(early_reserved_dram, addr) +#define EARLY_RESERVED_DRAM_END(addr) REGION_END(early_reserved_dram, addr) -#define PSP_SHAREDMEM_DRAM_START(addr) SYMBOL(psp_sharedmem_dram, addr) -#define PSP_SHAREDMEM_DRAM_END(addr) SYMBOL(epsp_sharedmem_dram, addr) +#define PSP_SHAREDMEM_DRAM_START(addr) REGION_START(psp_sharedmem_dram, addr) +#define PSP_SHAREDMEM_DRAM_END(addr) REGION_END(psp_sharedmem_dram, addr) BOOTBLOCK_END = CONFIG_ROMSTAGE_ADDR; BOOTBLOCK_ADDR = BOOTBLOCK_END - CONFIG_C_ENV_BOOTBLOCK_SIZE; |