linker generated list: introduce Z_STRUCT_SECTION_ITERABLE()
This convenience macro wraps Z_DECL_ALIGN() and __in_section() to simplify static definitions of structure instances gathered in dedicated sections. Most of the time those go together, and the section name is already closely related to the struct type, so abstracting things behind a simpler interface reduces probability of mistakes and makes the code clearer. A few input section names have been adjusted accordingly. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
This commit is contained in:
parent
8bb1f2a947
commit
b1d3742ce2
5 changed files with 35 additions and 39 deletions
|
@ -34,7 +34,7 @@
|
|||
SECTION_DATA_PROLOGUE(_static_thread_area,,SUBALIGN(4))
|
||||
{
|
||||
_static_thread_data_list_start = .;
|
||||
KEEP(*(SORT_BY_NAME("._static_thread_data.static.*")))
|
||||
KEEP(*(SORT_BY_NAME(".__static_thread_data.static.*")))
|
||||
_static_thread_data_list_end = .;
|
||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
||||
|
||||
|
@ -88,6 +88,8 @@
|
|||
{
|
||||
_k_queue_list_start = .;
|
||||
KEEP(*("._k_queue.static.*"))
|
||||
KEEP(*("._k_fifo.static.*"))
|
||||
KEEP(*("._k_lifo.static.*"))
|
||||
_k_queue_list_end = .;
|
||||
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
SECTION_PROLOGUE(object_access,,)
|
||||
{
|
||||
__object_access_start = .;
|
||||
KEEP(*(".object_access.*"))
|
||||
KEEP(*(".__k_object_assignment.*"))
|
||||
__object_access_end = .;
|
||||
} GROUP_LINK_IN(ROMABLE_REGION)
|
||||
#endif
|
||||
|
@ -104,7 +104,7 @@
|
|||
SECTION_DATA_PROLOGUE(_bt_settings_area,,SUBALIGN(4))
|
||||
{
|
||||
_bt_settings_start = .;
|
||||
KEEP(*(SORT_BY_NAME("._bt_settings.static.*")))
|
||||
KEEP(*(SORT_BY_NAME("._bt_settings_handler.static.*")))
|
||||
_bt_settings_end = .;
|
||||
} GROUP_LINK_IN(ROMABLE_REGION)
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue