toolchain: add STRUCT_SECTION_START|END helpers

Even though they are just wrappers around TYPE_SECTION_START|END, it
allows using the STRUCT_SECTION* API namespace everywhere when working
with struct-based iterable sections.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2023-04-26 10:28:39 +02:00 committed by Carles Cufí
parent 13f87494bb
commit 7525a551cf

View file

@ -321,6 +321,14 @@
(uintptr_t)TYPE_SECTION_START(secname)) / sizeof(type); \
} while (0)
/**
* @brief iterable section start symbol for a struct type
*
* @param[in] struct_type data type of section
*/
#define STRUCT_SECTION_START(struct_type) \
TYPE_SECTION_START(struct_type)
/**
* @brief iterable section extern for start symbol for a struct
*
@ -331,6 +339,14 @@
#define STRUCT_SECTION_START_EXTERN(struct_type) \
TYPE_SECTION_START_EXTERN(struct struct_type, struct_type)
/**
* @brief iterable section end symbol for a struct type
*
* @param[in] struct_type data type of section
*/
#define STRUCT_SECTION_END(struct_type) \
TYPE_SECTION_END(struct_type)
/**
* @brief iterable section extern for end symbol for a struct
*