From b2dc1fc9fb966cc214585869bf13afe21f6fe396 Mon Sep 17 00:00:00 2001 From: Jordan Yates Date: Sat, 12 Jun 2021 16:14:39 +1000 Subject: [PATCH] linker: arm: move IDT_LIST region Move the IDT_LIST memory region to the location recommended by `intlist.ld`. The documentation specifies that this region should not overlap other regions, and there is no guarantee that the area after the `SRAM` region is not used. The end of the address space is much less likely to be a valid RAM address. Signed-off-by: Jordan Yates --- include/arch/arm/aarch32/cortex_a_r/scripts/linker.ld | 2 +- include/arch/arm/aarch32/cortex_m/scripts/linker.ld | 6 +++--- include/arch/arm64/scripts/linker.ld | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/arch/arm/aarch32/cortex_a_r/scripts/linker.ld b/include/arch/arm/aarch32/cortex_a_r/scripts/linker.ld index a351ebf2477..a8391b26143 100644 --- a/include/arch/arm/aarch32/cortex_a_r/scripts/linker.ld +++ b/include/arch/arm/aarch32/cortex_a_r/scripts/linker.ld @@ -83,7 +83,7 @@ MEMORY FLASH (rx) : ORIGIN = ROM_ADDR, LENGTH = ROM_SIZE SRAM (wx) : ORIGIN = RAM_ADDR, LENGTH = RAM_SIZE /* Used by and documented in include/linker/intlist.ld */ - IDT_LIST (wx) : ORIGIN = (RAM_ADDR + RAM_SIZE), LENGTH = 2K + IDT_LIST (wx) : ORIGIN = 0xFFFFF7FF, LENGTH = 2K } ENTRY(CONFIG_KERNEL_ENTRY) diff --git a/include/arch/arm/aarch32/cortex_m/scripts/linker.ld b/include/arch/arm/aarch32/cortex_m/scripts/linker.ld index 30e80898485..926b19bb6aa 100644 --- a/include/arch/arm/aarch32/cortex_m/scripts/linker.ld +++ b/include/arch/arm/aarch32/cortex_m/scripts/linker.ld @@ -85,8 +85,8 @@ _region_min_align = 4; MEMORY { - FLASH (rx) : ORIGIN = ROM_ADDR, LENGTH = ROM_SIZE - SRAM (wx) : ORIGIN = RAM_ADDR, LENGTH = RAM_SIZE + FLASH (rx) : ORIGIN = ROM_ADDR, LENGTH = ROM_SIZE + SRAM (wx) : ORIGIN = RAM_ADDR, LENGTH = RAM_SIZE /* TI CCFG Registers */ LINKER_DT_REGION_FROM_NODE(FLASH_CCFG, rwx, DT_NODELABEL(ti_ccfg_partition)) /* Data & Instruction Tightly Coupled Memory */ @@ -104,7 +104,7 @@ MEMORY LINKER_DT_REGION_FROM_NODE(SDRAM2, rw, DT_NODELABEL(sdram2)) LINKER_DT_REGION_FROM_NODE(BACKUP_SRAM, rw, DT_NODELABEL(backup_sram)) /* Used by and documented in include/linker/intlist.ld */ - IDT_LIST (wx) : ORIGIN = (RAM_ADDR + RAM_SIZE), LENGTH = 2K + IDT_LIST (wx) : ORIGIN = 0xFFFFF7FF, LENGTH = 2K } ENTRY(CONFIG_KERNEL_ENTRY) diff --git a/include/arch/arm64/scripts/linker.ld b/include/arch/arm64/scripts/linker.ld index 7f591b5db70..dcbbe267f8c 100644 --- a/include/arch/arm64/scripts/linker.ld +++ b/include/arch/arm64/scripts/linker.ld @@ -69,7 +69,7 @@ MEMORY FLASH (rx) : ORIGIN = ROM_ADDR, LENGTH = ROM_SIZE SRAM (wx) : ORIGIN = RAM_ADDR, LENGTH = RAM_SIZE /* Used by and documented in include/linker/intlist.ld */ - IDT_LIST (wx) : ORIGIN = (RAM_ADDR + RAM_SIZE), LENGTH = 2K + IDT_LIST (wx) : ORIGIN = 0xFFFFF7FF, LENGTH = 2K } ENTRY(CONFIG_KERNEL_ENTRY)