Section variables.
More...
Section variables.
#define NRF_SECTION_VARS_ADD |
( |
|
section_name, |
|
|
|
type_def |
|
) |
| static type_def __attribute__ ((section(#section_name))) __attribute__((used)) |
Macro to declare a variable to be placed in a named section.
Declares a variable to be placed in a named section. This macro ensures that its symbol is not stripped by the linker because of optimizations.
- Warning
- The order with which variables are placed in a section is implementation dependant. Generally, variables are placed in a section depending on the order with which they are found by the linker.
-
The symbols added in the named section must be word aligned to prevent padding.
- Parameters
-
[in] | section_name | Name of the section. |
[in] | type_def | Datatype of the variable to place in the given section. |
#define NRF_SECTION_VARS_COUNT |
( |
|
type_name, |
|
|
|
section_name |
|
) |
| NRF_SECTION_VARS_LENGTH(section_name) / sizeof(type_name) |
Macro to get number of items in named section.
- Parameters
-
[in] | type_name | Type name of item in section. |
[in] | section_name | Name of the section. |
#define NRF_SECTION_VARS_END_SYMBOL |
( |
|
section_name | ) |
section_name ## $$Limit |
Macro to obtain the linker symbol for the end of a given section.
The symbol that this macro resolves to is used to obtain a section end address.
- Parameters
-
[in] | section_name | Name of the section. |
#define NRF_SECTION_VARS_GET |
( |
|
i, |
|
|
|
type_name, |
|
|
|
section_name |
|
) |
| (type_name*)(NRF_SECTION_VARS_START_ADDR(section_name) + i * sizeof(type_name)) |
Macro to get symbol from named section.
- Warning
- The stored symbol can only be resolved using this macro if the type of the data is word aligned. The operation of acquiring the stored symbol relies on sizeof of the stored type, no padding can exist in the named section in between individual stored items or this macro will fail.
- Parameters
-
[in] | i | Index of item in section. |
[in] | type_name | Type name of item in section. |
[in] | section_name | Name of the section. |
Macro for retrieving the length of a given section, in bytes.
- Parameters
-
[in] | section_name | Name of the section. |
#define NRF_SECTION_VARS_REGISTER_SECTION |
( |
|
section_name | ) |
|
Macro to register a named section.
- Parameters
-
[in] | section_name | Name of the section to register. |
#define NRF_SECTION_VARS_REGISTER_SYMBOLS |
( |
|
type_name, |
|
|
|
section_name |
|
) |
| |
Value:
Macro to extern a named section start and stop symbols.
- Note
- These declarations are required for GCC and Keil linkers (but not for IAR's).
- Parameters
-
[in] | type_name | Name of the type stored in the section. |
[in] | section_name | Name of the section. |
Macro to obtain the start address of a named section.
param[in] section_name Name of the section.
#define NRF_SECTION_VARS_START_SYMBOL |
( |
|
section_name | ) |
section_name ## $$Base |
Macro to obtain the linker symbol for the beginning of a given section.
The symbol that this macro resolves to is used to obtain a section start address.
- Parameters
-
[in] | section_name | Name of the section. |