From 82d16b150ce3287f4e9f33e86bdde32bc455b193 Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Wed, 30 Dec 2020 15:51:10 -0800 Subject: 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 Change-Id: Ifd89708ca9bd3937d0db7308959231106a6aa373 Reviewed-on: https://review.coreboot.org/c/coreboot/+/49332 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/soc/rockchip/rk3399/memlayout.ld | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/soc/rockchip/rk3399') diff --git a/src/soc/rockchip/rk3399/memlayout.ld b/src/soc/rockchip/rk3399/memlayout.ld index aa925a25c9..7a4fb70cfc 100644 --- a/src/soc/rockchip/rk3399/memlayout.ld +++ b/src/soc/rockchip/rk3399/memlayout.ld @@ -12,9 +12,9 @@ SECTIONS DMA_COHERENT(0x10000000, 2M) /* 8K of special SRAM in PMU power domain. */ - SYMBOL(pmu_sram, 0xFF3B0000) + REGION_START(pmu_sram, 0xFF3B0000) WATCHDOG_TOMBSTONE(0xFF3B1FFC, 4) - SYMBOL(epmu_sram, 0xFF3B2000) + REGION_END(pmu_sram, 0xFF3B2000) SRAM_START(0xFF8C0000) #if ENV_RAMSTAGE -- cgit v1.2.3