OF_CHILD(9)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

🌸 NAME 🌸

okay so bestie, this is the OF_CHILD(9) page from the Kernel Developer's Manual πŸ’– and it's all about OF_child, OF_parent, and OF_peer β€” navigate device tree energy, fr fr. no cap.

✨ SYNOPSIS ✨

first, include these headers, periodt:

#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>

then the function signatures, exactly like this:

phandle_t
OF_child(phandle_t node);

phandle_t
OF_parent(phandle_t node);

phandle_t
OF_peer(phandle_t node);

πŸ’… DESCRIPTION πŸ’…

  • OF_child() β€” returns the phandle value of the first child of node. zero is returned if there are no child nodes. slay.
  • OF_parent() β€” returns the phandle for the parent of node. zero is returned if node is the root node. obsessed.
  • OF_peer() β€” returns the phandle value of the next sibling of node. zero is returned if there is no sibling node. iconic.

🌈 EXAMPLES 🌈

example time, bestie β€” here's the loop exactly as the page gives it:

       phandle_t node, child;
        ...
       for (child = OF_child(node); child != 0; child = OF_peer(child) {
               ...
       }

πŸ¦‹ SEE ALSO πŸ¦‹

  • OF_finddevice(9) β€” the see-also reference on this page. go look at it when you're done here πŸ’…

πŸŽ€ AUTHORS πŸŽ€

This manual page was written by Oleksandr Tymoshenko <gonzo@FreeBSD.org>. give them their flowers πŸ’

xoxo, your Unix bestie πŸ’– β€” source/version: Debian, date: April 9, 2018, and this was the OF_CHILD(9) page. periodt ✨

πŸ“¦ where this page comes from