|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
Macros | |
| #define | DT_FOREACH_CPU(fn) |
Invokes fn for each child of the devicetree's "/cpus" node whose device_type is "cpu". | |
| #define | DT_FOREACH_CPU_SEP(fn, sep) |
Invokes fn for each child of the devicetree's "/cpus" node whose device_type is "cpu", with a separator. | |
| #define | DT_FOREACH_CPU_VARGS(fn, ...) |
Invokes fn for each child of the devicetree's "/cpus" node whose device_type is "cpu", with multiple arguments. | |
| #define | DT_FOREACH_CPU_SEP_VARGS(fn, sep, ...) |
Invokes fn for each child of the devicetree's "/cpus" node whose device_type is "cpu", with a separator and multiple arguments. | |
| #define | DT_FOREACH_CPU_STATUS_OKAY(fn) |
Invokes fn for each child of the devicetree's "/cpus" node whose device_type is "cpu" and status is "okay". | |
| #define | DT_FOREACH_CPU_STATUS_OKAY_SEP(fn, sep) |
Invokes fn for each child of the devicetree's "/cpus" node whose device_type is "cpu" and status is "okay", with a separator. | |
| #define | DT_FOREACH_CPU_STATUS_OKAY_SEP_VARGS(fn, sep, ...) |
Invokes fn for each child of the devicetree's "/cpus" node whose device_type is "cpu" and status is "okay", with a separator and multiple arguments. | |
| #define DT_FOREACH_CPU | ( | fn | ) |
#include <cpu.h>
Invokes fn for each child of the devicetree's "/cpus" node whose device_type is "cpu".
The macro fn must take one parameter, which will be the node identifier of a "/cpus" child node with device_type = "cpu". Children of "/cpus" that do not have device_type = "cpu" are skipped.
Example devicetree fragment:
Example usage:
This expands to:
Notice that "power-states" is skipped, since its device_type is not "cpu".
| fn | macro to invoke |
| #define DT_FOREACH_CPU_SEP | ( | fn, | |
| sep ) |
#include <cpu.h>
Invokes fn for each child of the devicetree's "/cpus" node whose device_type is "cpu", with a separator.
The macro fn must take one parameter, which will be the node identifier of a "/cpus" child node with device_type = "cpu". Children of "/cpus" that do not have device_type = "cpu" are skipped.
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 <cpu.h>
Invokes fn for each child of the devicetree's "/cpus" node whose device_type is "cpu", with a separator and multiple arguments.
The macro fn takes multiple arguments. The remaining are passed-in by the caller.
| 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 <cpu.h>
Invokes fn for each child of the devicetree's "/cpus" node whose device_type is "cpu" and status is "okay".
This macro iterates through children of the "/cpus" node in the same order as they appear in the final devicetree, but children whose status is not okay are also skipped.
| fn | macro to invoke |
| #define DT_FOREACH_CPU_STATUS_OKAY_SEP | ( | fn, | |
| sep ) |
#include <cpu.h>
Invokes fn for each child of the devicetree's "/cpus" node whose device_type is "cpu" and status is "okay", with a separator.
This macro iterates through children of the "/cpus" node in the same order as they appear in the final devicetree, but children whose status is not okay are also skipped.
| 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 <cpu.h>
Invokes fn for each child of the devicetree's "/cpus" node whose device_type is "cpu" and status is "okay", with a separator and multiple arguments.
This macro iterates through children of the "/cpus" node in the same order as they appear in the final devicetree, but children whose status is not okay are also skipped.
| 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 <cpu.h>
Invokes fn for each child of the devicetree's "/cpus" node whose device_type is "cpu", 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 |