Zephyr API Documentation 4.4.0-rc3
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
section_tags.h
Go to the documentation of this file.
1/* Macros for tagging symbols and putting them in the correct sections. */
2
3/*
4 * Copyright (c) 2013-2014, Wind River Systems, Inc.
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 */
8
9#ifndef ZEPHYR_INCLUDE_LINKER_SECTION_TAGS_H_
10#define ZEPHYR_INCLUDE_LINKER_SECTION_TAGS_H_
11
12#include <zephyr/toolchain.h>
13
14#if !defined(_ASMLANGUAGE)
15
17
18#define __noinit __in_section_unique(_NOINIT_SECTION_NAME)
19#define __noinit_named(name) __in_section_unique_named(_NOINIT_SECTION_NAME, name)
20#define __irq_vector_table Z_GENERIC_SECTION(_IRQ_VECTOR_TABLE_SECTION_NAME)
21#define __sw_isr_table Z_GENERIC_SECTION(_SW_ISR_TABLE_SECTION_NAME)
22
23#ifdef CONFIG_SHARED_INTERRUPTS
24#define __shared_sw_isr_table Z_GENERIC_SECTION(_SHARED_SW_ISR_TABLE_SECTION_NAME)
25#endif /* CONFIG_SHARED_INTERRUPTS */
26
27/* Attribute macros to place code and data into IMR memory */
28#define __imr __in_section_unique(imr)
29#define __imrdata __in_section_unique(imrdata)
30
31#if defined(CONFIG_ARM)
32#define __kinetis_flash_config_section __in_section_unique(_KINETIS_FLASH_CONFIG_SECTION_NAME)
33#define __ti_ccfg_section Z_GENERIC_SECTION(_TI_CCFG_SECTION_NAME)
34#define __itcm_section Z_GENERIC_SECTION(_ITCM_SECTION_NAME)
35#define __dtcm_data_section Z_GENERIC_SECTION(_DTCM_DATA_SECTION_NAME)
36#define __dtcm_bss_section Z_GENERIC_SECTION(_DTCM_BSS_SECTION_NAME)
37#define __dtcm_noinit_section Z_GENERIC_SECTION(_DTCM_NOINIT_SECTION_NAME)
38#define __ocm_data_section Z_GENERIC_SECTION(_OCM_DATA_SECTION_NAME)
39#define __ocm_bss_section Z_GENERIC_SECTION(_OCM_BSS_SECTION_NAME)
40#define __imx_boot_conf_section Z_GENERIC_SECTION(_IMX_BOOT_CONF_SECTION_NAME)
41#define __imx_boot_data_section Z_GENERIC_SECTION(_IMX_BOOT_DATA_SECTION_NAME)
42#define __imx_boot_ivt_section Z_GENERIC_SECTION(_IMX_BOOT_IVT_SECTION_NAME)
43#define __imx_boot_dcd_section Z_GENERIC_SECTION(_IMX_BOOT_DCD_SECTION_NAME)
44#define __imx_boot_container_section Z_GENERIC_SECTION(_IMX_BOOT_CONTAINER_SECTION_NAME)
45#define __stm32_backup_sram_section Z_GENERIC_SECTION(_STM32_BACKUP_SRAM_SECTION_NAME)
46
47/*
48 * Deprecated aliases, provided for backwards compatibility.
49 * These aliases will be removed in Zephyr v4.5.
50 */
51#define __ccm_data_section __dtcm_data_section __DEPRECATED_MACRO
52#define __ccm_bss_section __dtcm_bss_section __DEPRECATED_MACRO
53#define __ccm_noinit_section __dtcm_noinit_section __DEPRECATED_MACRO
54#endif /* CONFIG_ARM */
55
56#if defined(CONFIG_NOCACHE_MEMORY)
57#define __nocache __in_section_unique(_NOCACHE_SECTION_NAME)
58#define __nocache_load __in_section_unique(_NOCACHE_LOAD_SECTION_NAME)
59#define __nocache_noinit __nocache
60#else
61#define __nocache
62#define __nocache_load
63#define __nocache_noinit __noinit
64#endif /* CONFIG_NOCACHE_MEMORY */
65
66#if defined(CONFIG_KERNEL_COHERENCE)
67#define __incoherent __in_section_unique(cached)
68#if defined(CONFIG_USERSPACE)
69#define __stackmem Z_GENERIC_SECTION(.user_stacks)
70#else
71#define __stackmem __incoherent
72#endif /* CONFIG_USERSPACE */
73#define __kstackmem __incoherent
74#else
75#define __incoherent
76#define __stackmem Z_GENERIC_SECTION(.user_stacks)
77#define __kstackmem __noinit
78#endif /* CONFIG_KERNEL_COHERENCE */
79
80#if defined(CONFIG_LINKER_USE_BOOT_SECTION)
81#define __boot_func Z_GENERIC_DOT_SECTION(BOOT_TEXT_SECTION_NAME)
82#define __boot_data Z_GENERIC_DOT_SECTION(BOOT_DATA_SECTION_NAME)
83#define __boot_rodata Z_GENERIC_DOT_SECTION(BOOT_RODATA_SECTION_NAME)
84#define __boot_bss Z_GENERIC_DOT_SECTION(BOOT_BSS_SECTION_NAME)
85#define __boot_noinit Z_GENERIC_DOT_SECTION(BOOT_NOINIT_SECTION_NAME)
86#else
87#define __boot_func
88#define __boot_data
89#define __boot_rodata
90#define __boot_bss
91#define __boot_noinit __noinit
92#endif /* CONFIG_LINKER_USE_BOOT_SECTION */
93
94#if defined(CONFIG_LINKER_USE_PINNED_SECTION)
95#define __pinned_func Z_GENERIC_DOT_SECTION(PINNED_TEXT_SECTION_NAME)
96#define __pinned_data Z_GENERIC_DOT_SECTION(PINNED_DATA_SECTION_NAME)
97#define __pinned_rodata Z_GENERIC_DOT_SECTION(PINNED_RODATA_SECTION_NAME)
98#define __pinned_bss Z_GENERIC_DOT_SECTION(PINNED_BSS_SECTION_NAME)
99#define __pinned_noinit Z_GENERIC_DOT_SECTION(PINNED_NOINIT_SECTION_NAME)
100#else
101#define __pinned_func
102#define __pinned_data
103#define __pinned_rodata
104#define __pinned_bss
105#define __pinned_noinit __noinit
106#endif /* CONFIG_LINKER_USE_PINNED_SECTION */
107
108#if defined(CONFIG_LINKER_USE_ONDEMAND_SECTION)
109#define __ondemand_func Z_GENERIC_DOT_SECTION(ONDEMAND_TEXT_SECTION_NAME)
110#define __ondemand_rodata Z_GENERIC_DOT_SECTION(ONDEMAND_RODATA_SECTION_NAME)
111#else
112#define __ondemand_func
113#define __ondemand_rodata
114#endif /* CONFIG_LINKER_USE_ONDEMAND_SECTION */
115
116#if defined(CONFIG_LINKER_USE_PINNED_SECTION)
117#define __isr __pinned_func
118#else
119#define __isr
120#endif
121
122/* Symbol table section */
123#if defined(CONFIG_SYMTAB)
124#define __symtab_info Z_GENERIC_SECTION(_SYMTAB_INFO_SECTION_NAME)
125#define __symtab_entry Z_GENERIC_SECTION(_SYMTAB_ENTRY_SECTION_NAME)
126#endif /* CONFIG_SYMTAB */
127
128#endif /* !_ASMLANGUAGE */
129
130#endif /* ZEPHYR_INCLUDE_LINKER_SECTION_TAGS_H_ */
Definitions of various linker Sections.
Macros to abstract toolchain specific capabilities.