|
Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
|
Macros | |
| #define | DT_FOREACH_CPU(fn) |
Invokes fn for each CPU node in the devicetree's "/cpus" node. | |
| #define | DT_FOREACH_CPU_SEP(fn, sep) |
Invokes fn for each CPU node in the devicetree's "/cpus" node, with a separator. | |
| #define | DT_FOREACH_CPU_VARGS(fn, ...) |
Invokes fn for each CPU node in the devicetree's "/cpus" node, with multiple arguments. | |
| #define | DT_FOREACH_CPU_SEP_VARGS(fn, sep, ...) |
Invokes fn for each CPU node in the devicetree's "/cpus" node, with a separator and multiple arguments. | |
| #define | DT_FOREACH_CPU_STATUS_OKAY(fn) |
Invokes fn for each CPU node in the devicetree's "/cpus" node whose status is "okay". | |
| #define | DT_FOREACH_CPU_STATUS_OKAY_SEP(fn, sep) |
Invokes fn for each CPU node in the devicetree's "/cpus" node whose status is "okay", with a separator. | |
| #define | DT_FOREACH_CPU_STATUS_OKAY_SEP_VARGS(fn, sep, ...) |
Invokes fn for each CPU node in the devicetree's "/cpus" node whose status is "okay", with a separator and multiple arguments. | |
| #define DT_FOREACH_CPU | ( | fn | ) |
#include <zephyr/devicetree/cpu.h>
Invokes fn for each CPU node in the devicetree's "/cpus" node.
The macro fn must take one parameter, which will be the node identifier of a "/cpus/cpu@N" node. The list is determined at build time by the Python devicetree tooling (edt.cpus) using a structural check: direct children of "/cpus" whose name prefix is "cpu". Children of "/cpus" that do not match (e.g. "power-states") are excluded.
Example devicetree fragment:
Example usage:
This expands to:
Notice that "power-states" is excluded.
| fn | macro to invoke |
| #define DT_FOREACH_CPU_SEP | ( | fn, | |
| sep ) |
#include <zephyr/devicetree/cpu.h>
Invokes fn for each CPU node in the devicetree's "/cpus" node, with a separator.
sep is placed after each invocation of fn, not between invocations. This means the expansion has a trailing sep, which is convenient for initializers since a trailing comma is legal.
Example usage:
| fn | macro to invoke |
| sep | Separator (e.g. comma or semicolon) placed after each invocation of fn. Must be in parentheses; this is required to enable providing a comma as separator. |
| #define DT_FOREACH_CPU_SEP_VARGS | ( | fn, | |
| sep, | |||
| ... ) |
#include <zephyr/devicetree/cpu.h>
Invokes fn for each CPU node in the devicetree's "/cpus" node, with a separator and multiple arguments.
| fn | macro to invoke |
| sep | Separator (e.g. comma or semicolon) placed after each invocation of fn. Must be in parentheses; this is required to enable providing a comma as separator. |
| ... | variable number of arguments to pass to fn |
| #define DT_FOREACH_CPU_STATUS_OKAY | ( | fn | ) |
#include <zephyr/devicetree/cpu.h>
Invokes fn for each CPU node in the devicetree's "/cpus" node whose status is "okay".
| fn | macro to invoke |
| #define DT_FOREACH_CPU_STATUS_OKAY_SEP | ( | fn, | |
| sep ) |
#include <zephyr/devicetree/cpu.h>
Invokes fn for each CPU node in the devicetree's "/cpus" node whose status is "okay", with a separator.
| fn | macro to invoke |
| sep | Separator (e.g. comma or semicolon) placed after each invocation of fn. Must be in parentheses; this is required to enable providing a comma as separator. |
| #define DT_FOREACH_CPU_STATUS_OKAY_SEP_VARGS | ( | fn, | |
| sep, | |||
| ... ) |
#include <zephyr/devicetree/cpu.h>
Invokes fn for each CPU node in the devicetree's "/cpus" node whose status is "okay", with a separator and multiple arguments.
| fn | macro to invoke |
| sep | Separator (e.g. comma or semicolon) placed after each invocation of fn. Must be in parentheses; this is required to enable providing a comma as separator. |
| ... | variable number of arguments to pass to fn |
| #define DT_FOREACH_CPU_VARGS | ( | fn, | |
| ... ) |
#include <zephyr/devicetree/cpu.h>
Invokes fn for each CPU node in the devicetree's "/cpus" node, with multiple arguments.
The macro fn takes multiple arguments. The first should be the node identifier for the "/cpus" child node. The remaining are passed-in by the caller.
| fn | macro to invoke |
| ... | variable number of arguments to pass to fn |