[PATCH 10/18] bootwrapper: Add ft_find_device_rel().

Scott Wood scottwood at freescale.com
Wed Jan 31 07:25:46 EST 2007


Segher Boessenkool wrote:
>> +void *ft_find_device_rel(struct ft_cxt *cxt, const void *top,
>> +                         const char *srch_path)
>> +{
>> +    char *node;
>> +
>> +    node = ft_node_ph2node(cxt, top);
> 
> 
> Huh -- are phandles a pointer?  Why not just a u32?

I can't speak for whoever designed the interface, but I'd rather keep it 
as a pointer -- it provides more flexibility to the implementation.  For 
example, if the device tree were to be maintained as a normal 
pointer-based tree, and flattened only when finalize() is called, then a 
pointer would be a natural handle to export (which wouldn't fit into a 
u32 on 64-bit platforms, unless you make assumptions about where 
bootwrapper data is located).

The downside, of course, is that it's easier to get phandles and 
internal pointers mixed up.

-Scott



More information about the Linuxppc-dev mailing list