class PropertyDecoder

Defined at line 686 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h

Forward declaration of PropertyDecoder, see below.

Public Methods

fit::result<PathResolveError, ResolvedPath> ResolvePath (std::string_view maybe_aliased_path)

On success, returns a |ResolvedPath| that contains the resolved aliases prefix and the suffix.

On failure, when an aliased path is met, the returned value is true if the caller should try

later (e.g. aliases node has not been found yet) or false if the aliases node was found, but

the alias was not.

Defined at line 139 of file ../../zircon/kernel/lib/devicetree/devicetree.cc

fit::result<PathResolveError, ResolvedPath> ResolvePath (std::string_view maybe_aliased_path)

On success, returns a |ResolvedPath| that contains the resolved aliases prefix and the suffix.

On failure, when an aliased path is met, the returned value is true if the caller should try

later (e.g. aliases node has not been found yet) or false if the aliases node was found, but

the alias was not.

Defined at line 139 of file ../../zircon/kernel/lib/devicetree/devicetree.cc

std::optional<uint64_t> TranslateAddress (uint64_t address)

Translate |address| from this node's view to the root's view of the address.

Each bus translation is commonly defined by |ranges| property. Lack of this property

means no translation is possible or some other means of translation needs to happen.

This method will recursively translate address into parent's bus until it meets a node without

a |ranges| property. Root node is not allowed to have a |ranges| property.

Defined at line 175 of file ../../zircon/kernel/lib/devicetree/devicetree.cc

std::optional<uint64_t> TranslateAddress (uint64_t address)

Translate |address| from this node's view to the root's view of the address.

Each bus translation is commonly defined by |ranges| property. Lack of this property

means no translation is possible or some other means of translation needs to happen.

This method will recursively translate address into parent's bus until it meets a node without

a |ranges| property. Root node is not allowed to have a |ranges| property.

Defined at line 175 of file ../../zircon/kernel/lib/devicetree/devicetree.cc

void PropertyDecoder ()

Defined at line 696 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h

void PropertyDecoder (const PropertyDecoder & )

Defined at line 697 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h

void PropertyDecoder (PropertyDecoder && )

Defined at line 698 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h

void PropertyDecoder (PropertyDecoder * parent, Properties properties, const std::optional<Properties> & aliases)

Defined at line 699 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h

void PropertyDecoder (PropertyDecoder * parent, Properties properties, const std::optional<Properties> & aliases)

Defined at line 699 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h

void PropertyDecoder (PropertyDecoder * parent, Properties properties)

Defined at line 705 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h

void PropertyDecoder (Properties properties)

Defined at line 709 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h

PropertyDecoder * parent ()

Returns the decoder of the current node's parent if any.

Root node will return |nullptr|.

Defined at line 714 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h

template <typename... PropertyNames>
std::array<std::optional<PropertyValue>, sizeof...(PropertyNames)> FindProperties (PropertyNames &&... property_names)

Attempts to find a list of unique property names in a single iteration of the available

properties. If the property is not found, and |std::nullopt| is returned in the respective

location.

E.g.:

PropertyDecoder decoder(...);

auto [name, foo, bar, other_foo] = decoder.FindProperties("name", "foo", "bar", "other_foo");

if (name.has_value()) ....

Defined at line 726 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h

template <typename... PropertyNames>
std::array<std::optional<PropertyValue>, sizeof...(PropertyNames)> FindProperties (PropertyNames &&... property_names)

Attempts to find a list of unique property names in a single iteration of the available

properties. If the property is not found, and |std::nullopt| is returned in the respective

location.

E.g.:

PropertyDecoder decoder(...);

auto [name, foo, bar, other_foo] = decoder.FindProperties("name", "foo", "bar", "other_foo");

if (name.has_value()) ....

Defined at line 726 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h

template <typename... PropertyNames>
std::array<std::optional<PropertyValue>, sizeof...(PropertyNames)> FindProperties (PropertyNames &&... property_names)

Attempts to find a list of unique property names in a single iteration of the available

properties. If the property is not found, and |std::nullopt| is returned in the respective

location.

E.g.:

PropertyDecoder decoder(...);

auto [name, foo, bar, other_foo] = decoder.FindProperties("name", "foo", "bar", "other_foo");

if (name.has_value()) ....

Defined at line 726 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h

template <typename... PropertyNames>
std::array<std::optional<PropertyValue>, sizeof...(PropertyNames)> FindProperties (PropertyNames &&... property_names)

Attempts to find a list of unique property names in a single iteration of the available

properties. If the property is not found, and |std::nullopt| is returned in the respective

location.

E.g.:

PropertyDecoder decoder(...);

auto [name, foo, bar, other_foo] = decoder.FindProperties("name", "foo", "bar", "other_foo");

if (name.has_value()) ....

Defined at line 726 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h

std::optional<PropertyValue> FindProperty (std::string_view name)

Defined at line 732 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h

std::optional<PropertyValue> FindProperty (std::string_view name)

Defined at line 732 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h

template <auto PropertyValue::* ValueDecoder, typename... Args>
auto FindAndDecodeProperty (std::string_view name, Args &&... args)

Performs property lookup and decoding, using the provided |PropertyValue::*| method pointer.

Defined at line 738 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h

template <auto PropertyValue::* ValueDecoder, typename... Args>
auto FindAndDecodeProperty (std::string_view name, Args &&... args)

Performs property lookup and decoding, using the provided |PropertyValue::*| method pointer.

Defined at line 738 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h

const Properties & properties ()

Underlying |Properties| object.

Defined at line 757 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h

std::optional<uint32_t> num_address_cells ()

Cached special '#' properties.

Defined at line 760 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h

std::optional<uint32_t> num_size_cells ()

Defined at line 763 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h

std::optional<uint32_t> num_interrupt_cells ()

Defined at line 766 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h

std::optional<StatusProperty> status ()

Defined at line 769 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h

bool is_status_ok ()

Defined at line 772 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h

Enumerations

enum PathResolveError
Name Value
kBadAlias 0
kNoAliases 1

Possible errors when resolving a path.

Defined at line 689 of file ../../zircon/kernel/lib/devicetree/include/lib/devicetree/devicetree.h