Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
cpu.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
10#ifndef ZEPHYR_INCLUDE_DEVICETREE_CPU_H_
11#define ZEPHYR_INCLUDE_DEVICETREE_CPU_H_
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17#include <zephyr/devicetree.h>
19
25
74#define DT_FOREACH_CPU(fn) DT_FOREACH_CHILD_VARGS(DT_PATH(cpus), DT_FOREACH_CPU_INTERNAL, fn)
75
103#define DT_FOREACH_CPU_SEP(fn, sep) \
104 DT_FOREACH_CHILD_VARGS(DT_PATH(cpus), DT_FOREACH_CPU_SEP_INTERNAL, fn, sep)
105
119#define DT_FOREACH_CPU_VARGS(fn, ...) \
120 DT_FOREACH_CHILD_VARGS(DT_PATH(cpus), DT_FOREACH_CPU_VARGS_INTERNAL, fn, __VA_ARGS__)
121
136#define DT_FOREACH_CPU_SEP_VARGS(fn, sep, ...) \
137 DT_FOREACH_CHILD_VARGS(DT_PATH(cpus), DT_FOREACH_CPU_SEP_VARGS_INTERNAL, fn, sep, \
138 __VA_ARGS__)
139
152#define DT_FOREACH_CPU_STATUS_OKAY(fn) \
153 DT_FOREACH_CHILD_VARGS(DT_PATH(cpus), DT_FOREACH_CPU_STATUS_OKAY_INTERNAL, fn)
154
170#define DT_FOREACH_CPU_STATUS_OKAY_SEP(fn, sep) \
171 DT_FOREACH_CHILD_VARGS(DT_PATH(cpus), DT_FOREACH_CPU_STATUS_OKAY_SEP_INTERNAL, fn, sep)
172
190#define DT_FOREACH_CPU_STATUS_OKAY_SEP_VARGS(fn, sep, ...) \
191 DT_FOREACH_CHILD_VARGS(DT_PATH(cpus), DT_FOREACH_CPU_STATUS_OKAY_SEP_VARGS_INTERNAL, fn, \
192 sep, __VA_ARGS__)
193
195#define DT_FOREACH_CPU_INTERNAL(node_id, fn) \
196 COND_CODE_1(DT_NODE_HAS_PROP(node_id, device_type), (fn(node_id)), ())
197
198#define DT_FOREACH_CPU_VARGS_INTERNAL(node_id, fn, ...) \
199 COND_CODE_1(DT_NODE_HAS_PROP(node_id, device_type), \
200 (fn(node_id, __VA_ARGS__)), ())
201
202#define DT_FOREACH_CPU_SEP_INTERNAL(node_id, fn, sep) \
203 COND_CODE_1(DT_NODE_HAS_PROP(node_id, device_type), \
204 (fn(node_id) DT_DEBRACKET_INTERNAL sep), ())
205
206#define DT_FOREACH_CPU_SEP_VARGS_INTERNAL(node_id, fn, sep, ...) \
207 COND_CODE_1(DT_NODE_HAS_PROP(node_id, device_type), \
208 (fn(node_id, __VA_ARGS__) DT_DEBRACKET_INTERNAL sep), ())
209
210#define DT_FOREACH_CPU_STATUS_OKAY_INTERNAL(node_id, fn) \
211 COND_CODE_1(DT_NODE_HAS_PROP(node_id, device_type), \
212 (COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(node_id), (fn(node_id)), ())), ())
213
214#define DT_FOREACH_CPU_STATUS_OKAY_SEP_INTERNAL(node_id, fn, sep) \
215 COND_CODE_1(DT_NODE_HAS_PROP(node_id, device_type), \
216 (COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(node_id), \
217 (fn(node_id) DT_DEBRACKET_INTERNAL sep), ())), \
218 ())
219
220#define DT_FOREACH_CPU_STATUS_OKAY_SEP_VARGS_INTERNAL(node_id, fn, sep, ...) \
221 COND_CODE_1(DT_NODE_HAS_PROP(node_id, device_type), \
222 (COND_CODE_1(DT_NODE_HAS_STATUS_OKAY(node_id), \
223 (fn(node_id, __VA_ARGS__) DT_DEBRACKET_INTERNAL sep), ())), \
224 ())
226
230
231#ifdef __cplusplus
232}
233#endif
234
235#endif /* ZEPHYR_INCLUDE_DEVICETREE_CPU_H_ */
Devicetree main header.
Macro utilities.