Zephyr API Documentation
4.1.99
A Scalable Open Source RTOS
4.1.99
Toggle main menu visibility
Main Page
Related Pages
Topics
Data Structures
Data Structures
Data Structure Index
Data Fields
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Enumerator
Files
File List
Globals
All
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
$
a
b
c
d
f
g
h
i
k
l
m
n
o
p
r
s
t
u
x
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Macros
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
▼
Zephyr API Documentation
►
Introduction
Deprecated List
►
Topics
►
Data Structures
▼
Files
▼
File List
►
doc
►
kernel
►
lib
►
modules
►
subsys
▼
zephyr
►
acpi
►
app_memory
►
arch
►
audio
►
bluetooth
►
canbus
►
console
►
crypto
►
data
►
debug
►
devicetree
►
dfu
►
display
►
drivers
►
dsp
►
dt-bindings
►
fs
►
input
►
internal
►
ipc
►
kernel
▼
linker
►
devicetree_regions.h
►
iterable_sections.h
►
linker-defs.h
linker-devnull.h
►
linker-tool-gcc.h
►
linker-tool-lld.h
►
linker-tool-mwdt.h
linker-tool.h
section_tags.h
sections.h
►
utils.h
►
llext
►
logging
►
lorawan
►
math
►
mem_mgmt
►
mgmt
►
misc
►
modbus
►
modem
►
multi_heap
►
net
►
platform
►
pm
►
pmci
►
portability
►
posix
►
psa
►
random
►
retention
►
rtio
►
sd
►
sensing
►
settings
►
shell
►
sip_svc
►
stats
►
storage
►
sys
►
task_wdt
►
timing
►
toolchain
►
tracing
►
usb
►
usb_c
►
video
►
virtio
►
xen
►
zbus
►
zvfs
►
bindesc.h
►
cache.h
►
device.h
►
devicetree.h
►
fatal.h
►
fatal_types.h
►
init.h
►
irq.h
►
irq_multilevel.h
►
irq_nextlevel.h
►
irq_offload.h
►
kernel.h
kernel_includes.h
►
kernel_structs.h
►
kernel_version.h
►
net_buf.h
►
shared_irq.h
►
smf.h
►
spinlock.h
►
sw_isr_table.h
►
sys_clock.h
►
syscall.h
►
toolchain.h
types.h
►
Globals
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
Loading...
Searching...
No Matches
devicetree_regions.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2021, Commonwealth Scientific and Industrial Research
3
* Organisation (CSIRO) ABN 41 687 119 230.
4
*
5
* SPDX-License-Identifier: Apache-2.0
6
*
7
* Generate memory regions from devicetree nodes.
8
*/
9
10
#ifndef ZEPHYR_INCLUDE_LINKER_DEVICETREE_REGIONS_H_
11
#define ZEPHYR_INCLUDE_LINKER_DEVICETREE_REGIONS_H_
12
13
#include <
zephyr/devicetree.h
>
14
#include <
zephyr/sys/util.h
>
15
#include <
zephyr/toolchain.h
>
16
48
#define LINKER_DT_NODE_REGION_NAME_TOKEN(node_id) \
49
DT_STRING_TOKEN(node_id, zephyr_memory_region)
48
#define LINKER_DT_NODE_REGION_NAME_TOKEN(node_id) \
…
50
82
#define LINKER_DT_NODE_REGION_NAME(node_id) \
83
STRINGIFY(LINKER_DT_NODE_REGION_NAME_TOKEN(node_id))
82
#define LINKER_DT_NODE_REGION_NAME(node_id) \
…
84
85
#define _DT_MEMORY_REGION_FLAGS_TOKEN(n) DT_STRING_TOKEN(n, zephyr_memory_region_flags)
86
#define _DT_MEMORY_REGION_FLAGS_UNQUOTED(n) DT_STRING_UNQUOTED(n, zephyr_memory_region_flags)
87
88
#define _LINKER_L_PAREN (
89
#define _LINKER_R_PAREN )
90
#define _LINKER_ENCLOSE_PAREN(x) _LINKER_L_PAREN x _LINKER_R_PAREN
91
92
#define _LINKER_IS_EMPTY_TOKEN_ 1
93
#define _LINKER_IS_EMPTY_TOKEN_EXPAND(x) _LINKER_IS_EMPTY_TOKEN_##x
94
#define _LINKER_IS_EMPTY_TOKEN(x) _LINKER_IS_EMPTY_TOKEN_EXPAND(x)
95
136
#define LINKER_DT_NODE_REGION_FLAGS(node_id) \
137
COND_CODE_1(DT_NODE_HAS_PROP(node_id, zephyr_memory_region_flags), \
138
(COND_CODE_1(_LINKER_IS_EMPTY_TOKEN(_DT_MEMORY_REGION_FLAGS_TOKEN(node_id)), \
139
(), \
140
(_LINKER_ENCLOSE_PAREN( \
141
_DT_MEMORY_REGION_FLAGS_UNQUOTED(node_id)) \
142
))), \
143
(_LINKER_ENCLOSE_PAREN(rw)))
136
#define LINKER_DT_NODE_REGION_FLAGS(node_id) \
…
144
147
#define _DT_COMPATIBLE zephyr_memory_region
148
149
#define _DT_SECTION_PREFIX(node_id) UTIL_CAT(__, LINKER_DT_NODE_REGION_NAME_TOKEN(node_id))
150
#define _DT_SECTION_START(node_id) UTIL_CAT(_DT_SECTION_PREFIX(node_id), _start)
151
#define _DT_SECTION_END(node_id) UTIL_CAT(_DT_SECTION_PREFIX(node_id), _end)
152
#define _DT_SECTION_SIZE(node_id) UTIL_CAT(_DT_SECTION_PREFIX(node_id), _size)
153
#define _DT_SECTION_LOAD(node_id) UTIL_CAT(_DT_SECTION_PREFIX(node_id), _load_start)
154
178
#define _REGION_DECLARE(node_id) \
179
LINKER_DT_NODE_REGION_NAME_TOKEN(node_id) \
180
LINKER_DT_NODE_REGION_FLAGS(node_id) \
181
: ORIGIN = DT_REG_ADDR(node_id), \
182
LENGTH = DT_REG_SIZE(node_id)
183
214
/* clang-format off */
215
#define _SECTION_DECLARE(node_id) \
216
LINKER_DT_NODE_REGION_NAME_TOKEN(node_id) (NOLOAD) : \
217
{ \
218
_DT_SECTION_START(node_id) = .; \
219
KEEP(*(LINKER_DT_NODE_REGION_NAME_TOKEN(node_id))) \
220
KEEP(*(LINKER_DT_NODE_REGION_NAME_TOKEN(node_id).*)) \
221
_DT_SECTION_END(node_id) = .; \
222
} > LINKER_DT_NODE_REGION_NAME_TOKEN(node_id) \
223
_DT_SECTION_SIZE(node_id) = _DT_SECTION_END(node_id) - _DT_SECTION_START(node_id); \
224
_DT_SECTION_LOAD(node_id) = LOADADDR(LINKER_DT_NODE_REGION_NAME_TOKEN(node_id));
225
/* clang-format on */
226
237
#define LINKER_DT_REGIONS() \
238
DT_FOREACH_STATUS_OKAY(_DT_COMPATIBLE, _REGION_DECLARE)
237
#define LINKER_DT_REGIONS() \
…
239
244
#define LINKER_DT_SECTIONS() \
245
DT_FOREACH_STATUS_OKAY(_DT_COMPATIBLE, _SECTION_DECLARE)
244
#define LINKER_DT_SECTIONS() \
…
246
247
#endif
/* ZEPHYR_INCLUDE_LINKER_DEVICETREE_REGIONS_H_ */
devicetree.h
Devicetree main header.
util.h
Misc utilities.
toolchain.h
Macros to abstract toolchain specific capabilities.
zephyr
linker
devicetree_regions.h
Generated on Fri Jun 6 2025 09:05:57 for Zephyr API Documentation by
1.12.0