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
►
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
►
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
►
internal
►
__assert.h
►
atomic.h
►
atomic_arch.h
►
atomic_builtin.h
►
atomic_c.h
►
atomic_types.h
►
barrier.h
barrier_builtin.h
►
base64.h
►
bitarray.h
►
byteorder.h
►
cbprintf.h
cbprintf_cxx.h
►
cbprintf_enums.h
►
cbprintf_internal.h
►
check.h
►
crc.h
►
device_mmio.h
►
dlist.h
errno_private.h
►
fdtable.h
►
hash_function.h
►
hash_map.h
►
hash_map_api.h
►
hash_map_cxx.h
►
hash_map_oa_lp.h
►
hash_map_sc.h
►
heap_listener.h
►
iterable_sections.h
►
kobject.h
►
libc-hooks.h
►
linear_range.h
list_gen.h
►
math_extras.h
►
math_extras_impl.h
►
mem_blocks.h
►
mem_manage.h
►
mem_stats.h
►
mpsc_lockfree.h
►
mpsc_packet.h
►
mpsc_pbuf.h
►
multi_heap.h
►
mutex.h
►
notify.h
►
onoff.h
►
p4wq.h
►
poweroff.h
►
printk-hooks.h
►
printk.h
►
rb.h
►
reboot.h
►
ring_buffer.h
►
sem.h
►
sflist.h
►
slist.h
►
speculation.h
►
spsc_lockfree.h
►
spsc_pbuf.h
►
sys_heap.h
►
sys_io.h
►
time_units.h
►
timeutil.h
►
util.h
►
util_internal.h
util_internal_is_eq.h
util_internal_util_dec.h
util_internal_util_inc.h
util_internal_util_x2.h
util_listify.h
util_loops.h
►
util_macro.h
►
uuid.h
►
winstream.h
►
task_wdt
►
timing
►
toolchain
►
tracing
►
usb
►
usb_c
►
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
iterable_sections.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2020, Intel Corporation
3
* Copyright (C) 2023, Nordic Semiconductor ASA
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
#ifndef INCLUDE_ZEPHYR_SYS_ITERABLE_SECTIONS_H_
8
#define INCLUDE_ZEPHYR_SYS_ITERABLE_SECTIONS_H_
9
10
#include <
zephyr/sys/__assert.h
>
11
#include <
zephyr/toolchain.h
>
12
13
#ifdef __cplusplus
14
extern
"C"
{
15
#endif
16
42
#define TYPE_SECTION_ITERABLE(type, varname, secname, section_postfix) \
43
Z_DECL_ALIGN(type) varname \
44
__in_section(_##secname, static, _CONCAT(section_postfix, _)) __used __noasan
42
#define TYPE_SECTION_ITERABLE(type, varname, secname, section_postfix) \
…
45
55
#define TYPE_SECTION_START(secname) _CONCAT(_##secname, _list_start)
56
65
#define TYPE_SECTION_END(secname) _CONCAT(_##secname, _list_end)
66
78
#define TYPE_SECTION_START_EXTERN(type, secname) \
79
extern type TYPE_SECTION_START(secname)[]
78
#define TYPE_SECTION_START_EXTERN(type, secname) \
…
80
92
#define TYPE_SECTION_END_EXTERN(type, secname) \
93
extern type TYPE_SECTION_END(secname)[]
92
#define TYPE_SECTION_END_EXTERN(type, secname) \
…
94
105
#define TYPE_SECTION_FOREACH(type, secname, iterator) \
106
TYPE_SECTION_START_EXTERN(type, secname); \
107
TYPE_SECTION_END_EXTERN(type, secname); \
108
for (type * iterator = TYPE_SECTION_START(secname); ({ \
109
__ASSERT(iterator <= TYPE_SECTION_END(secname),\
110
"unexpected list end location"); \
111
iterator < TYPE_SECTION_END(secname); \
112
}); \
113
iterator++)
105
#define TYPE_SECTION_FOREACH(type, secname, iterator) \
…
114
125
#define TYPE_SECTION_GET(type, secname, i, dst) do { \
126
TYPE_SECTION_START_EXTERN(type, secname); \
127
*(dst) = &TYPE_SECTION_START(secname)[i]; \
128
} while (0)
125
#define TYPE_SECTION_GET(type, secname, i, dst) do { \
…
129
137
#define TYPE_SECTION_COUNT(type, secname, dst) do { \
138
TYPE_SECTION_START_EXTERN(type, secname); \
139
TYPE_SECTION_END_EXTERN(type, secname); \
140
*(dst) = ((uintptr_t)TYPE_SECTION_END(secname) - \
141
(uintptr_t)TYPE_SECTION_START(secname)) / sizeof(type); \
142
} while (0)
137
#define TYPE_SECTION_COUNT(type, secname, dst) do { \
…
143
149
#define STRUCT_SECTION_START(struct_type) \
150
TYPE_SECTION_START(struct_type)
149
#define STRUCT_SECTION_START(struct_type) \
…
151
159
#define STRUCT_SECTION_START_EXTERN(struct_type) \
160
TYPE_SECTION_START_EXTERN(struct struct_type, struct_type)
159
#define STRUCT_SECTION_START_EXTERN(struct_type) \
…
161
167
#define STRUCT_SECTION_END(struct_type) \
168
TYPE_SECTION_END(struct_type)
167
#define STRUCT_SECTION_END(struct_type) \
…
169
177
#define STRUCT_SECTION_END_EXTERN(struct_type) \
178
TYPE_SECTION_END_EXTERN(struct struct_type, struct_type)
177
#define STRUCT_SECTION_END_EXTERN(struct_type) \
…
179
188
#define STRUCT_SECTION_ITERABLE_ALTERNATE(secname, struct_type, varname) \
189
TYPE_SECTION_ITERABLE(struct struct_type, varname, secname, varname)
188
#define STRUCT_SECTION_ITERABLE_ALTERNATE(secname, struct_type, varname) \
…
190
197
#define STRUCT_SECTION_ITERABLE_ARRAY_ALTERNATE(secname, struct_type, varname, \
198
size) \
199
TYPE_SECTION_ITERABLE(struct struct_type, varname[size], secname, \
200
varname)
201
216
#define STRUCT_SECTION_ITERABLE(struct_type, varname) \
217
STRUCT_SECTION_ITERABLE_ALTERNATE(struct_type, struct_type, varname)
216
#define STRUCT_SECTION_ITERABLE(struct_type, varname) \
…
218
224
#define STRUCT_SECTION_ITERABLE_ARRAY(struct_type, varname, size) \
225
STRUCT_SECTION_ITERABLE_ARRAY_ALTERNATE(struct_type, struct_type, \
226
varname, size)
224
#define STRUCT_SECTION_ITERABLE_ARRAY(struct_type, varname, size) \
…
227
234
#define STRUCT_SECTION_ITERABLE_NAMED(struct_type, name, varname) \
235
TYPE_SECTION_ITERABLE(struct struct_type, varname, struct_type, name)
234
#define STRUCT_SECTION_ITERABLE_NAMED(struct_type, name, varname) \
…
236
244
#define STRUCT_SECTION_ITERABLE_NAMED_ALTERNATE(struct_type, secname, name, varname) \
245
TYPE_SECTION_ITERABLE(struct struct_type, varname, secname, name)
244
#define STRUCT_SECTION_ITERABLE_NAMED_ALTERNATE(struct_type, secname, name, varname) \
…
246
257
#define STRUCT_SECTION_FOREACH_ALTERNATE(secname, struct_type, iterator) \
258
TYPE_SECTION_FOREACH(struct struct_type, secname, iterator)
257
#define STRUCT_SECTION_FOREACH_ALTERNATE(secname, struct_type, iterator) \
…
259
270
#define STRUCT_SECTION_FOREACH(struct_type, iterator) \
271
STRUCT_SECTION_FOREACH_ALTERNATE(struct_type, struct_type, iterator)
270
#define STRUCT_SECTION_FOREACH(struct_type, iterator) \
…
272
282
#define STRUCT_SECTION_GET(struct_type, i, dst) \
283
TYPE_SECTION_GET(struct struct_type, struct_type, i, dst)
282
#define STRUCT_SECTION_GET(struct_type, i, dst) \
…
284
291
#define STRUCT_SECTION_COUNT(struct_type, dst) \
292
TYPE_SECTION_COUNT(struct struct_type, struct_type, dst);
291
#define STRUCT_SECTION_COUNT(struct_type, dst) \
…
293
296
/* end of struct_section_apis */
297
298
#ifdef __cplusplus
299
}
300
#endif
301
302
#endif
/* INCLUDE_ZEPHYR_SYS_ITERABLE_SECTIONS_H_ */
__assert.h
toolchain.h
Macros to abstract toolchain specific capabilities.
zephyr
sys
iterable_sections.h
Generated on Tue Apr 29 2025 12:05:52 for Zephyr API Documentation by
1.12.0