gfdt_get_phandle()

Get the phandle for virtual device

Synopsis:

#include <qvm/firmware.h>
unsigned gfdt_get_phandle(const vdev_t *vdp,
                          int *node)

Arguments:

vdp
The virtual device to get the handle for.
node
A pointer to a node offset. For more information, see the function description.

Library:

Provided by qvm; no external library is required.

Description:

The FDT routines use offsets into the tree to represent the element being handled (e.g., node or property). In some cases, asking for the phandle of the vdev requires the qvm process to add a new property to the FDT. When a property is added, all the node or property offsets following the location where the property was added are shifted down in the FDT. If the node offset is past this new point, the routine adjusts it appropriately so that it refers to the same node as it did before gfdt_get_phandle() was called.

Returns:

The vdev's phandle value.