Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
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 <toolchain.h>
13
14#if !defined(_ASMLANGUAGE)
15
16#define __noinit __in_section_unique(_NOINIT_SECTION_NAME)
17#define __noinit_named(name) __in_section_unique_named(_NOINIT_SECTION_NAME, name)
18#define __irq_vector_table Z_GENERIC_SECTION(_IRQ_VECTOR_TABLE_SECTION_NAME)
19#define __sw_isr_table Z_GENERIC_SECTION(_SW_ISR_TABLE_SECTION_NAME)
20
21#if defined(CONFIG_ARM)
22#define __kinetis_flash_config_section __in_section_unique(_KINETIS_FLASH_CONFIG_SECTION_NAME)
23#define __ti_ccfg_section Z_GENERIC_SECTION(_TI_CCFG_SECTION_NAME)
24#define __ccm_data_section Z_GENERIC_SECTION(_CCM_DATA_SECTION_NAME)
25#define __ccm_bss_section Z_GENERIC_SECTION(_CCM_BSS_SECTION_NAME)
26#define __ccm_noinit_section Z_GENERIC_SECTION(_CCM_NOINIT_SECTION_NAME)
27#define __itcm_section Z_GENERIC_SECTION(_ITCM_SECTION_NAME)
28#define __dtcm_data_section Z_GENERIC_SECTION(_DTCM_DATA_SECTION_NAME)
29#define __dtcm_bss_section Z_GENERIC_SECTION(_DTCM_BSS_SECTION_NAME)
30#define __dtcm_noinit_section Z_GENERIC_SECTION(_DTCM_NOINIT_SECTION_NAME)
31#define __imx_boot_conf_section Z_GENERIC_SECTION(_IMX_BOOT_CONF_SECTION_NAME)
32#define __imx_boot_data_section Z_GENERIC_SECTION(_IMX_BOOT_DATA_SECTION_NAME)
33#define __imx_boot_ivt_section Z_GENERIC_SECTION(_IMX_BOOT_IVT_SECTION_NAME)
34#define __imx_boot_dcd_section Z_GENERIC_SECTION(_IMX_BOOT_DCD_SECTION_NAME)
35#define __stm32_sdram1_section Z_GENERIC_SECTION(_STM32_SDRAM1_SECTION_NAME)
36#define __stm32_sdram2_section Z_GENERIC_SECTION(_STM32_SDRAM2_SECTION_NAME)
37#define __stm32_backup_sram_section Z_GENERIC_SECTION(_STM32_BACKUP_SRAM_SECTION_NAME)
38#endif /* CONFIG_ARM */
39
40#if defined(CONFIG_NOCACHE_MEMORY)
41#define __nocache __in_section_unique(_NOCACHE_SECTION_NAME)
42#else
43#define __nocache
44#endif /* CONFIG_NOCACHE_MEMORY */
45
46#if defined(CONFIG_KERNEL_COHERENCE)
47#define __incoherent __in_section_unique(cached)
48#define __stackmem __incoherent
49#define __kstackmem __stackmem
50#else
51#define __incoherent
52#define __stackmem Z_GENERIC_SECTION(.user_stacks)
53#define __kstackmem __noinit
54#endif /* CONFIG_KERNEL_COHERENCE */
55
56#if defined(CONFIG_LINKER_USE_BOOT_SECTION)
57#define __boot_func Z_GENERIC_DOT_SECTION(BOOT_TEXT_SECTION_NAME)
58#define __boot_data Z_GENERIC_DOT_SECTION(BOOT_DATA_SECTION_NAME)
59#define __boot_rodata Z_GENERIC_DOT_SECTION(BOOT_RODATA_SECTION_NAME)
60#define __boot_bss Z_GENERIC_DOT_SECTION(BOOT_BSS_SECTION_NAME)
61#define __boot_noinit Z_GENERIC_DOT_SECTION(BOOT_NOINIT_SECTION_NAME)
62#else
63#define __boot_func
64#define __boot_data
65#define __boot_rodata
66#define __boot_bss
67#define __boot_noinit __noinit
68#endif /* CONFIG_LINKER_USE_BOOT_SECTION */
69
70#if defined(CONFIG_LINKER_USE_PINNED_SECTION)
71#define __pinned_func Z_GENERIC_DOT_SECTION(PINNED_TEXT_SECTION_NAME)
72#define __pinned_data Z_GENERIC_DOT_SECTION(PINNED_DATA_SECTION_NAME)
73#define __pinned_rodata Z_GENERIC_DOT_SECTION(PINNED_RODATA_SECTION_NAME)
74#define __pinned_bss Z_GENERIC_DOT_SECTION(PINNED_BSS_SECTION_NAME)
75#define __pinned_noinit Z_GENERIC_DOT_SECTION(PINNED_NOINIT_SECTION_NAME)
76#else
77#define __pinned_func
78#define __pinned_data
79#define __pinned_rodata
80#define __pinned_bss
81#define __pinned_noinit __noinit
82#endif /* CONFIG_LINKER_USE_PINNED_SECTION */
83
84#if defined(CONFIG_LINKER_USE_PINNED_SECTION)
85#define __isr __pinned_func
86#else
87#define __isr
88#endif
89
90#endif /* !_ASMLANGUAGE */
91
92#endif /* ZEPHYR_INCLUDE_LINKER_SECTION_TAGS_H_ */
Macros to abstract toolchain specific capabilities.