bsps: Support RTEMS_NOINIT in linkcmds

Update #3866.
This commit is contained in:
Sebastian Huber
2021-04-30 15:47:10 +02:00
parent a84bf966b5
commit e10dec0fe7
62 changed files with 256 additions and 1 deletions

View File

@@ -77,6 +77,10 @@ typedef struct {
.begin = (uint32_t) bsp_section_rtemsstack_begin, \
.end = (uint32_t) bsp_section_rtemsstack_end, \
.flags = ARMV7_MMU_DATA_READ_WRITE_CACHED \
}, { \
.begin = (uint32_t) bsp_section_noinit_begin, \
.end = (uint32_t) bsp_section_noinit_end, \
.flags = ARMV7_MMU_DATA_READ_WRITE_CACHED \
}, { \
.begin = (uint32_t) bsp_section_work_begin, \
.end = (uint32_t) bsp_section_work_end, \
@@ -99,7 +103,7 @@ typedef struct {
.flags = ARMV7_MMU_DATA_READ_WRITE_CACHED \
}
#define ARMV7_CP15_START_WORKSPACE_ENTRY_INDEX 9
#define ARMV7_CP15_START_WORKSPACE_ENTRY_INDEX 10
BSP_START_DATA_SECTION extern const arm_cp15_start_section_config
arm_cp15_start_mmu_config_table[];

View File

@@ -96,6 +96,10 @@ LINKER_SYMBOL(bsp_section_rtemsstack_begin)
LINKER_SYMBOL(bsp_section_rtemsstack_end)
LINKER_SYMBOL(bsp_section_rtemsstack_size)
LINKER_SYMBOL(bsp_section_noinit_begin)
LINKER_SYMBOL(bsp_section_noinit_end)
LINKER_SYMBOL(bsp_section_noinit_size)
LINKER_SYMBOL(bsp_section_work_begin)
LINKER_SYMBOL(bsp_section_work_end)
LINKER_SYMBOL(bsp_section_work_size)

View File

@@ -338,6 +338,13 @@ SECTIONS {
} > REGION_WORK AT > REGION_WORK
bsp_section_rtemsstack_size = bsp_section_rtemsstack_end - bsp_section_rtemsstack_begin;
.noinit (NOLOAD) : ALIGN_WITH_INPUT {
bsp_section_noinit_begin = .;
*(.noinit*)
bsp_section_noinit_end = .;
} > REGION_WORK AT > REGION_WORK
bsp_section_noinit_size = bsp_section_noinit_end - bsp_section_noinit_begin;
.work : ALIGN_WITH_INPUT {
/*
* The work section will occupy the remaining REGION_WORK region and

View File

@@ -128,6 +128,10 @@ SECTIONS
__end = .;
} > sdram
.noinit (NOLOAD) : {
*(.noinit*)
} > sdram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
_WorkAreaBase = .;

View File

@@ -136,6 +136,10 @@ SECTIONS
__end = .;
} > sdram
.noinit (NOLOAD) : {
*(.noinit*)
} > sdram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
_WorkAreaBase = .;

View File

@@ -125,6 +125,10 @@ SECTIONS
__end = .;
} > sdram
.noinit (NOLOAD) : {
*(.noinit*)
} > sdram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
_WorkAreaBase = .;

View File

@@ -205,6 +205,9 @@ SECTIONS
}
. = ALIGN(32 / 8);
_end = .; PROVIDE (end = .);
.noinit (NOLOAD) : {
*(.noinit*)
}
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
}

View File

@@ -253,6 +253,10 @@ SECTIONS
} > sdram
.noinit (NOLOAD) : {
*(.noinit*)
} > sdram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
WorkAreaBase = .;

View File

@@ -251,6 +251,10 @@ SECTIONS
_clear_end = .;
} > sdram
.noinit (NOLOAD) : {
*(.noinit*)
} > sdram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
WorkAreaBase = .;

View File

@@ -183,6 +183,10 @@ SECTIONS
_clear_end = .;
} >ram
.noinit (NOLOAD) : {
*(.noinit*)
} >ram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
WorkAreaBase = .;

View File

@@ -183,6 +183,10 @@ SECTIONS
_clear_end = .;
}
.noinit (NOLOAD) : {
*(.noinit*)
}
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
WorkAreaBase = .;

View File

@@ -182,6 +182,10 @@ SECTIONS
_clear_end = .;
} >ram
.noinit (NOLOAD) : {
*(.noinit*)
} >ram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
WorkAreaBase = .;

View File

@@ -158,6 +158,10 @@ SECTIONS
clear_end = .;
} > ram
.noinit (NOLOAD) : {
*(.noinit*)
} >ram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
WorkAreaBase = .;

View File

@@ -189,6 +189,10 @@ SECTIONS {
_clear_end = .;
} >ram
.noinit (NOLOAD) : {
*(.noinit*)
} >ram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
WorkAreaBase = .;

View File

@@ -153,6 +153,10 @@ SECTIONS {
_clear_end = .;
} >ram
.noinit (NOLOAD) : {
*(.noinit*)
} > ram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
WorkAreaBase = .;

View File

@@ -155,6 +155,10 @@ SECTIONS {
_clear_end = .;
} >myram
.noinit (NOLOAD) : {
*(.noinit*)
} >mvram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
WorkAreaBase = .;

View File

@@ -153,6 +153,10 @@ SECTIONS {
_clear_end = .;
} >ram
.noinit (NOLOAD) : {
*(.noinit*)
} > ram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
WorkAreaBase = .;

View File

@@ -191,6 +191,10 @@ SECTIONS
clear_end = .;
} > ram
.noinit (NOLOAD) : {
*(.noinit*)
} >ram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
WorkAreaBase = .;

View File

@@ -190,6 +190,10 @@ SECTIONS
clear_end = .;
} > ram
.noinit (NOLOAD) : {
*(.noinit*)
} >ram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
WorkAreaBase = .;

View File

@@ -171,6 +171,10 @@ SECTIONS
PROVIDE (_clear_end = .);
} >sram
.noinit (NOLOAD) : {
*(.noinit*)
} >sram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
PROVIDE(WorkAreaBase = .);

View File

@@ -171,6 +171,10 @@ SECTIONS
PROVIDE (_clear_end = .);
} >sram
.noinit (NOLOAD) : {
*(.noinit*)
} >sram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
PROVIDE(WorkAreaBase = .);

View File

@@ -190,6 +190,10 @@ SECTIONS
_clear_end = .;
} > dram
.noinit (NOLOAD) : {
*(.noinit*)
} > dram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
WorkAreaBase = .;

View File

@@ -195,6 +195,10 @@ SECTIONS
_clear_end = .;
} >ram
.noinit (NOLOAD) : {
*(.noinit*)
} > ram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
WorkAreaBase = .;

View File

@@ -190,6 +190,10 @@ SECTIONS
_clear_end = .;
} >ram
.noinit (NOLOAD) : {
*(.noinit*)
} > ram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
WorkAreaBase = .;

View File

@@ -179,6 +179,10 @@ SECTIONS
. = ALIGN (16);
PROVIDE (_end = .);
_clear_end = .;
} > dram
.noinit (NOLOAD) : {
*(.noinit*)
WorkAreaBase = .;
} > dram

View File

@@ -175,6 +175,10 @@ SECTIONS
. = ALIGN (16);
PROVIDE (_end = .);
_clear_end = .;
} > dram
.noinit (NOLOAD) : {
*(.noinit*)
WorkAreaBase = .;
} > dram

View File

@@ -194,6 +194,9 @@ SECTIONS
PROVIDE (end = .);
_clear_end = .;
} > ram
.noinit (NOLOAD) : {
*(.noinit*)
} > ram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
WorkAreaBase = .;

View File

@@ -249,6 +249,13 @@ SECTIONS {
} > REGION_DATA AT > REGION_DATA
bsp_section_bss_size = bsp_section_bss_end - bsp_section_bss_begin;
.noinit (NOLOAD) : ALIGN_WITH_INPUT {
bsp_section_noinit_begin = .;
*(.noinit*)
bsp_section_noinit_end = .;
} > REGION_DATA AT > REGION_DATA
bsp_section_noinit_size = bsp_section_noinit_end - bsp_section_noinit_begin;
.rtemsstack (NOLOAD) : ALIGN_WITH_INPUT {
*(SORT(.rtemsstack.*))
} > REGION_DATA AT > REGION_DATA

View File

@@ -199,6 +199,10 @@ SECTIONS
_clear_end = .;
} >ram
.noinit (NOLOAD) : {
*(.noinit*)
} >ram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
WorkAreaBase = .;

View File

@@ -192,6 +192,10 @@ SECTIONS
_end = .;
} >ram
.noinit (NOLOAD) : {
*(.noinit*)
} >ram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
WorkAreaBase = .;

View File

@@ -170,6 +170,10 @@ SECTIONS
_end = .;
}
.noinit (NOLOAD) : {
*(.noinit*)
}
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
WorkAreaBase = .;

View File

@@ -167,6 +167,10 @@ SECTIONS
_clear_end = .;
}
.noinit (NOLOAD) : {
*(.noinit*)
}
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
WorkAreaBase = .;

View File

@@ -168,6 +168,10 @@ SECTIONS
_clear_end = .;
}
.noinit (NOLOAD) : {
*(.noinit*)
}
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
WorkAreaBase = .;

View File

@@ -170,6 +170,10 @@ SECTIONS
_end = .;
}
.noinit (NOLOAD) : {
*(.noinit*)
}
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
WorkAreaBase = .;

View File

@@ -170,6 +170,10 @@ SECTIONS
_end = .;
}
.noinit (NOLOAD) : {
*(.noinit*)
}
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
WorkAreaBase = .;

View File

@@ -230,6 +230,9 @@ SECTIONS
_end = .;
_bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
PROVIDE (end = .);
.noinit (NOLOAD) : {
*(.noinit*)
}
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
}

View File

@@ -267,6 +267,10 @@ SECTIONS
__bss_end = ABSOLUTE(.);
} > onchip_memory_0
.noinit (NOLOAD) : {
*(.noinit*)
} > onchip_memory_0
.rtemsstack (NOLOAD) : {
_stack_low = ABSOLUTE(.);
*(SORT(.rtemsstack.*))

View File

@@ -285,6 +285,13 @@ SECTIONS {
} > REGION_BSS AT > REGION_BSS
bsp_section_bss_size = bsp_section_bss_end - bsp_section_bss_begin;
.noinit (NOLOAD) : ALIGN_WITH_INPUT {
bsp_section_noinit_begin = .;
*(.noinit*)
bsp_section_noinit_end = .;
} > REGION_BSS AT > REGION_BSS
bsp_section_noinit_size = bsp_section_noinit_end - bsp_section_noinit_begin;
.rtemsstack (NOLOAD) : ALIGN_WITH_INPUT{
*(SORT(.rtemsstack.*))
} > REGION_WORK AT > REGION_WORK

View File

@@ -295,6 +295,10 @@ SECTIONS {
bsp_section_data_size = bsp_section_data_end - bsp_section_data_start;
bsp_section_bss_size = bsp_section_bss_end - bsp_section_bss_start;
.noinit (NOLOAD) : {
*(.noinit*)
} > RAM
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
} > RAM

View File

@@ -250,6 +250,10 @@ SECTIONS
bss.size = bss.end - bss.start;
sbss.size = sbss.end - sbss.start;
.noinit (NOLOAD) : {
*(.noinit*)
} >RAM
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
} >RAM

View File

@@ -93,6 +93,10 @@ LINKER_SYMBOL(bsp_section_rtemsstack_begin)
LINKER_SYMBOL(bsp_section_rtemsstack_end)
LINKER_SYMBOL(bsp_section_rtemsstack_size)
LINKER_SYMBOL(bsp_section_noinit_begin)
LINKER_SYMBOL(bsp_section_noinit_end)
LINKER_SYMBOL(bsp_section_noinit_size)
LINKER_SYMBOL(bsp_section_work_begin)
LINKER_SYMBOL(bsp_section_work_end)
LINKER_SYMBOL(bsp_section_work_size)

View File

@@ -289,6 +289,10 @@ SECTIONS
clear_end = .;
.noinit (NOLOAD) : {
*(.noinit*)
} >ram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
} >ram

View File

@@ -133,6 +133,7 @@ static entry DATA config[] = {
ENTRY_RW(bsp_section_sbss_begin, bsp_section_sbss_size),
ENTRY_RW(bsp_section_bss_begin, bsp_section_bss_size),
ENTRY_RW(bsp_section_rtemsstack_begin, bsp_section_rtemsstack_size),
ENTRY_RW(bsp_section_noinit_begin, bsp_section_noinit_size),
ENTRY_RW(bsp_section_stack_begin, bsp_section_stack_size),
ENTRY_IO(bsp_section_nocache_begin, bsp_section_nocache_size),
ENTRY_IO(bsp_section_nocachenoload_begin, bsp_section_nocachenoload_size),

View File

@@ -343,6 +343,13 @@ SECTIONS {
} > REGION_RTEMSSTACK AT > REGION_RTEMSSTACK
bsp_section_rtemsstack_size = bsp_section_rtemsstack_end - bsp_section_rtemsstack_begin;
.noinit (NOLOAD) : ALIGN_WITH_INPUT {
bsp_section_noinit_begin = .;
*(.noinit*)
bsp_section_noinit_end = .;
} > REGION_WORK AT > REGION_WORK
bsp_section_noinit_size = bsp_section_noinit_end - bsp_section_noinit_begin;
.work : ALIGN_WITH_INPUT {
/*
* The work section will occupy the remaining REGION_WORK region and

View File

@@ -253,6 +253,9 @@ SECTIONS
. = ALIGN(16);
PROVIDE (__bss_end = .);
} > CODE
.noinit (NOLOAD) : {
*(.noinit*)
} > CODE
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
} >CODE

View File

@@ -233,6 +233,10 @@ SECTIONS
PROVIDE(_end = bss.end);
.noinit (NOLOAD) : {
*(.noinit*)
}
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
}

View File

@@ -252,6 +252,10 @@ SECTIONS
. = ALIGN(0x10); /* Align to a cache-line boundary */
PROVIDE(__bsp_ram_start = .);
.noinit (NOLOAD) : {
*(.noinit*)
} >RAM
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
} >RAM

View File

@@ -252,6 +252,10 @@ SECTIONS
. = ALIGN(0x20); /* Align to a cache-line boundary */
PROVIDE(__bsp_ram_start = .);
.noinit (NOLOAD) : {
*(.noinit*)
} >RAM
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
} >RAM

View File

@@ -63,6 +63,10 @@ LINKER_SYMBOL(bsp_section_rtemsstack_begin)
LINKER_SYMBOL(bsp_section_rtemsstack_end)
LINKER_SYMBOL(bsp_section_rtemsstack_size)
LINKER_SYMBOL(bsp_section_noinit_begin)
LINKER_SYMBOL(bsp_section_noinit_end)
LINKER_SYMBOL(bsp_section_noinit_size)
LINKER_SYMBOL(bsp_section_work_begin)
LINKER_SYMBOL(bsp_section_work_end)
LINKER_SYMBOL(bsp_section_work_size)

View File

@@ -314,6 +314,13 @@ SECTIONS {
} > REGION_RTEMSSTACK AT > REGION_RTEMSSTACK
bsp_section_rtemsstack_size = bsp_section_rtemsstack_end - bsp_section_rtemsstack_begin;
.noinit (NOLOAD) : @RISCV_LINKER_ALIGN_DIRECTIVE@ {
bsp_section_noinit_begin = .;
*(.noinit*)
bsp_section_noinit_end = .;
} > REGION_WORK AT > REGION_WORK
bsp_section_noinit_size = bsp_section_noinit_end - bsp_section_noinit_begin;
.work (NOLOAD) : @RISCV_LINKER_ALIGN_DIRECTIVE@ {
/*
* The work section will occupy the remaining REGION_WORK region and

View File

@@ -187,6 +187,10 @@ SECTIONS
_end = . ;
PROVIDE (end = .);
.noinit (NOLOAD) : {
*(.noinit*)
} > ram
.rtemsstackidle (NOLOAD) : {
*(SORT(.rtemsstack.idle*))
} > ram

View File

@@ -198,6 +198,10 @@ SECTIONS
_end = . ;
PROVIDE (end = .);
.noinit (NOLOAD) : {
*(.noinit*)
} > ram
.rtemsstackidle (NOLOAD) : {
*(SORT(.rtemsstack.idle*))
} > ram

View File

@@ -200,6 +200,10 @@ SECTIONS
_end = . ;
PROVIDE (end = .);
.noinit (NOLOAD) : {
*(.noinit*)
} > ram
.rtemsstackidle (NOLOAD) : {
*(SORT(.rtemsstack.idle*))
} > ram

View File

@@ -201,6 +201,10 @@ SECTIONS
_end = . ;
PROVIDE (end = .);
.noinit (NOLOAD) : {
*(.noinit*)
} > ram
.rtemsstackidle (NOLOAD) : {
*(SORT(.rtemsstack.idle*))
} > ram

View File

@@ -145,6 +145,10 @@ SECTIONS
__bss_end = .;
} > ram
.noinit (NOLOAD) : {
*(.noinit*)
} > ram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
} > ram

View File

@@ -188,6 +188,10 @@ SECTIONS
__bss_end = .;
} > ram
.noinit (NOLOAD) : {
*(.noinit*)
} > ram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
} > ram

View File

@@ -192,6 +192,10 @@ SECTIONS
*(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
} >ram
.noinit (NOLOAD) : {
*(.noinit*)
} > ram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
} > ram

View File

@@ -203,6 +203,10 @@ SECTIONS
_end = . ;
PROVIDE (end = .);
.noinit (NOLOAD) : {
*(.noinit*)
} > ram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
} > ram

View File

@@ -154,6 +154,9 @@ SECTIONS
*(.rela.rtemsroset*)
*(.rela.rtemsrwset*)
} >ram
.noinit (NOLOAD) : {
*(.noinit*)
} > ram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
} > ram

View File

@@ -179,6 +179,10 @@ SECTIONS
__end = .;
} > ram
.noinit (NOLOAD) : {
*(.noinit*)
} > ram
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
PROVIDE (WorkAreaBase = .);

View File

@@ -192,6 +192,9 @@ SECTIONS
*(.bss)
*(COMMON)
}
.noinit (NOLOAD) : {
*(.noinit*)
}
.rtemsstack (NOLOAD) : {
*(SORT(.rtemsstack.*))
}

View File

@@ -10,6 +10,7 @@
* Changes:
* - Added HeapSize, RamBase, RamSize, WorkBase
* - rtemssroset section
* - noinit section
* - rtemsstack section
*/
@@ -231,6 +232,10 @@ SECTIONS
}
. = ALIGN(64 / 8);
_end = .; PROVIDE (end = .);
.noinit (NOLOAD) :
{
*(.noinit*)
}
.rtemsstack (NOLOAD) :
{
*(SORT(.rtemsstack.*))