class Devicetree
Defined at line 888 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h
Represents a devicetree. This class does not dynamically allocate
memory and is appropriate for use in all low-level environments.
Public Methods
void Devicetree (ByteView fdt)
Consumes a view representing the range of memory the flattened devicetree
is expected to take up, its beginning pointing to that of the binary data
and its size giving an upper bound on the size that the data is permitted
to occupy.
It is okay to pass a view size of SIZE_MAX if an upper bound on the size
is not known; only up to the size encoded in the devicetree header will
be dereferenced.
Defined at line 247 of file ../../zircon/kernel/lib/devicetree/devicetree.cc
void Devicetree (ByteView fdt)
Consumes a view representing the range of memory the flattened devicetree
is expected to take up, its beginning pointing to that of the binary data
and its size giving an upper bound on the size that the data is permitted
to occupy.
It is okay to pass a view size of SIZE_MAX if an upper bound on the size
is not known; only up to the size encoded in the devicetree header will
be dereferenced.
Defined at line 247 of file ../../zircon/kernel/lib/devicetree/devicetree.cc
void Devicetree (ByteView fdt)
Consumes a view representing the range of memory the flattened devicetree
is expected to take up, its beginning pointing to that of the binary data
and its size giving an upper bound on the size that the data is permitted
to occupy.
It is okay to pass a view size of SIZE_MAX if an upper bound on the size
is not known; only up to the size encoded in the devicetree header will
be dereferenced.
Defined at line 247 of file ../../zircon/kernel/lib/devicetree/devicetree.cc
void Devicetree (ByteView fdt)
Consumes a view representing the range of memory the flattened devicetree
is expected to take up, its beginning pointing to that of the binary data
and its size giving an upper bound on the size that the data is permitted
to occupy.
It is okay to pass a view size of SIZE_MAX if an upper bound on the size
is not known; only up to the size encoded in the devicetree header will
be dereferenced.
Defined at line 247 of file ../../zircon/kernel/lib/devicetree/devicetree.cc
void Devicetree ()
Defined at line 929 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h
void Devicetree (const Devicetree & other)
Defined at line 940 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h
void Devicetree (std::span<const std::byte> fdt)
Defined at line 941 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h
void Devicetree (std::span<const std::byte> fdt)
Defined at line 941 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h
void Devicetree (std::span<const std::byte> fdt)
Defined at line 941 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h
void Devicetree (std::span<const std::byte> fdt)
Defined at line 941 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h
Devicetree & operator= (const Devicetree & rhs)
Defined at line 944 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h
ByteView fdt ()
Defined at line 946 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h
size_t size_bytes ()
The size in bytes of the flattened devicetree blob.
Defined at line 949 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h
template <typename Visitor>
void Walk (Visitor && visitor)
Walk provides a means of walking a devicetree. It purposefully avoids
reliance on specifying a 'walker' by means of inheritance so as to avoid
vtables, which are not permitted in the phys environment. A WalkCallback
here is an object callable with the signature of
`(const NodePath
&
, Properties) -> bool`
and is called depth-first at every node for which no ancestor node
returned false. That is, if a walker returns false at a given node, then
the subtree rooted there and its member nodes are said to be "pruned" and
the walker will not be called on them.
There are two flavors of this method:
Pre-Order Traversal Only: A single visitor is supplied, and will be called
on every node following a pre order traversal.
Pre-Order and Post-Order Traversal: A pair of visitors are supplied,
each callback is called once per visited node. The Pre-Order callback
is called before visiting the offspring(Pre-Order Traversal) and the
Post-Order callback is called after visiting a node's offspring.
This method will only have one instantiation in practice (in any
conceivable context), so the templating should not result in undue bloat.
TODO: If boot shims start using multiple walks, refactor this to move the
logic into a non-template function and use a function pointer callback,
with this templated wrapper calling that with a captureless lambda to call
the templated walker.
Defined at line 979 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h
template <typename PreOrderVisitor, typename PostOrderVisitor>
void Walk (PreOrderVisitor && pre_order_visitor, PostOrderVisitor && post_order_visitor)
Defined at line 985 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h
MemoryReservations memory_reservations ()
Defined at line 989 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h