提交 fc583411 编写于 作者: S Scott Wood 提交者: Paul Mackerras

[POWERPC] bootwrapper: Add ft_find_device_rel().

Add a function to look up a relative, rather than absolute, path name.
Signed-off-by: NScott Wood <scottwood@freescale.com>
Acked-by: NMark A. Greer <mgreer@mvista.com>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
上级 5adeef52
...@@ -654,6 +654,19 @@ void *ft_find_device(struct ft_cxt *cxt, const char *srch_path) ...@@ -654,6 +654,19 @@ void *ft_find_device(struct ft_cxt *cxt, const char *srch_path)
return ft_get_phandle(cxt, node); return ft_get_phandle(cxt, node);
} }
void *ft_find_device_rel(struct ft_cxt *cxt, const void *top,
const char *srch_path)
{
char *node;
node = ft_node_ph2node(cxt, top);
if (node == NULL)
return NULL;
node = ft_find_descendent(cxt, node, srch_path);
return ft_get_phandle(cxt, node);
}
void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path) void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path)
{ {
struct ft_atom atom; struct ft_atom atom;
......
...@@ -97,6 +97,8 @@ int ft_add_rsvmap(struct ft_cxt *cxt, u64 physaddr, u64 size); ...@@ -97,6 +97,8 @@ int ft_add_rsvmap(struct ft_cxt *cxt, u64 physaddr, u64 size);
void ft_dump_blob(const void *bphp); void ft_dump_blob(const void *bphp);
void ft_merge_blob(struct ft_cxt *cxt, void *blob); void ft_merge_blob(struct ft_cxt *cxt, void *blob);
void *ft_find_device(struct ft_cxt *cxt, const char *srch_path); void *ft_find_device(struct ft_cxt *cxt, const char *srch_path);
void *ft_find_device_rel(struct ft_cxt *cxt, const void *top,
const char *srch_path);
void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path); void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path);
int ft_get_prop(struct ft_cxt *cxt, const void *phandle, const char *propname, int ft_get_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
void *buf, const unsigned int buflen); void *buf, const unsigned int buflen);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册