linker: allow symbols to be in a named __noinit section

This adds a new __noinit_named() macro which can be used to
attach named section attributes for symbols. The original
__noinit creates a section attribute with source file name
and a sequential counter. This simply replaces the counter
with the supplied name. This is useful for demand paging
as developers can choose which symbols is pinned memory.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2021-07-19 14:06:36 -07:00 committed by Christopher Friedt
commit 99290f7fef
2 changed files with 4 additions and 0 deletions

View file

@ -14,6 +14,7 @@
#if !defined(_ASMLANGUAGE)
#define __noinit __in_section_unique(_NOINIT_SECTION_NAME)
#define __noinit_named(name) __in_section_unique_named(_NOINIT_SECTION_NAME, name)
#define __irq_vector_table Z_GENERIC_SECTION(_IRQ_VECTOR_TABLE_SECTION_NAME)
#define __sw_isr_table Z_GENERIC_SECTION(_SW_ISR_TABLE_SECTION_NAME)

View file

@ -156,6 +156,9 @@ do { \
#define __in_section_unique(seg) ___in_section(seg, __FILE__, __COUNTER__)
#define __in_section_unique_named(seg, name) \
___in_section(seg, __FILE__, name)
/* When using XIP, using '__ramfunc' places a function into RAM instead
* of FLASH. Make sure '__ramfunc' is defined only when
* CONFIG_ARCH_HAS_RAMFUNC_SUPPORT is defined, so that the compiler can