FreeBSD/sys/dev/ofw/ofw_fdt.c
/*
 * Device tree functions.
 *
 * We use the offset from fdtp to the node as the 'phandle' in OF interface.
 *
 * phandle is a u32 value, therefore we cannot use the pointer to node as
 * phandle in 64 bit. We also do not use the usual fdt offset as phandle,
 * as it can be 0, and the OF interface has special meaning for phandle 0.
 */
Device tree functions.
We use the offset from fdtp to the node as the 'phandle' in OF interface.

phandle is a u32 value, therefore we cannot use the pointer to node as
phandle in 64 bit. We also do not use the usual fdt offset as phandle,
as it can be 0, and the OF interface has special meaning for phandle 0.
Device tree functions . We use the offset from fdtp to the node as the ' phandle ' in OF interface . phandle is a u32 value therefore we cannot use the pointer to node as phandle in 64 bit . We also do not use the usual fdt offset as phandle as it can be 0 and the OF interface has special meaning for phandle 0 .
static phandle_t
fdt_offset_phandle(int offset)
{
	if (offset < 0)
		return (0);
	return ((phandle_t)offset + fdt_off_dt_struct(fdtp));
}
static phandle_t fdt_offset_phandle ( int offset ) { if ( offset < 0 ) return ( 0 ) ; return ( ( phandle_t ) offset + fdt_off_dt_struct ( fdtp ) ) ; }
Device tree functions.
Device tree functions .