sections.h
1/*
2 * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef _PICO_PLATFORM_SECTION_MACROS_H
8#define _PICO_PLATFORM_SECTION_MACROS_H
9
10#ifndef __ASSEMBLER__
11
24#ifndef __after_data
25#define __after_data(group) __attribute__((section(".after_data." group)))
26#endif
27
40#ifndef __not_in_flash
41#define __not_in_flash(group) __attribute__((section(".time_critical." group)))
42#endif
43
59#ifndef __scratch_x
60#define __scratch_x(group) __attribute__((section(".scratch_x." group)))
61#endif
62
78#ifndef __scratch_y
79#define __scratch_y(group) __attribute__((section(".scratch_y." group)))
80#endif
81
97#ifndef __uninitialized_ram
98#define __uninitialized_ram(group) __attribute__((section(".uninitialized_data." #group))) group
99#endif
100
113#ifndef __in_flash
114#define __in_flash(group) __attribute__((section(".flashdata." group)))
115#endif
116
131#ifndef __not_in_flash_func
132#define __not_in_flash_func(func_name) __not_in_flash(__STRING(func_name)) func_name
133#endif
134
152#ifndef __time_critical_func
153#define __time_critical_func(func_name) __not_in_flash_func(func_name)
154#endif
155
168#ifndef __no_inline_not_in_flash_func
169#define __no_inline_not_in_flash_func(func_name) __noinline __not_in_flash_func(func_name)
170#endif
171
172#else
173
174#ifndef RAM_SECTION_NAME
175#define RAM_SECTION_NAME(x) .time_critical.##x
176#endif
177
178#ifndef SECTION_NAME
179#define SECTION_NAME(x) .text.##x
180#endif
181
182#endif // !__ASSEMBLER__
183
184#endif
185