Lines Matching refs:node
77 struct node *build_node(struct property *proplist, struct node *children) in build_node()
79 struct node *new = xmalloc(sizeof(*new)); in build_node()
80 struct node *child; in build_node()
94 struct node *name_node(struct node *node, char *name) in name_node() argument
96 assert(node->name == NULL); in name_node()
98 node->name = name; in name_node()
100 return node; in name_node()
103 struct node *merge_nodes(struct node *old_node, struct node *new_node) in merge_nodes()
106 struct node *new_child, *old_child; in merge_nodes()
170 struct node *chain_node(struct node *first, struct node *list) in chain_node()
178 void add_property(struct node *node, struct property *prop) in add_property() argument
184 p = &node->proplist; in add_property()
191 void add_child(struct node *parent, struct node *child) in add_child()
193 struct node **p; in add_child()
245 struct node *tree, uint32_t boot_cpuid_phys) in build_boot_info()
261 const char *get_unitname(struct node *node) in get_unitname() argument
263 if (node->name[node->basenamelen] == '\0') in get_unitname()
266 return node->name + node->basenamelen + 1; in get_unitname()
269 struct property *get_property(struct node *node, const char *propname) in get_property() argument
273 for_each_property(node, prop) in get_property()
286 struct property *get_property_by_label(struct node *tree, const char *label, in get_property_by_label()
287 struct node **node) in get_property_by_label() argument
290 struct node *c; in get_property_by_label()
292 *node = tree; in get_property_by_label()
303 prop = get_property_by_label(c, label, node); in get_property_by_label()
308 *node = NULL; in get_property_by_label()
312 struct marker *get_marker_label(struct node *tree, const char *label, in get_marker_label()
313 struct node **node, struct property **prop) in get_marker_label() argument
317 struct node *c; in get_marker_label()
319 *node = tree; in get_marker_label()
330 m = get_marker_label(c, label, node, prop); in get_marker_label()
336 *node = NULL; in get_marker_label()
340 struct node *get_subnode(struct node *node, const char *nodename) in get_subnode() argument
342 struct node *child; in get_subnode()
344 for_each_child(node, child) in get_subnode()
351 struct node *get_node_by_path(struct node *tree, const char *path) in get_node_by_path()
354 struct node *child; in get_node_by_path()
374 struct node *get_node_by_label(struct node *tree, const char *label) in get_node_by_label()
376 struct node *child, *node; in get_node_by_label() local
386 node = get_node_by_label(child, label); in get_node_by_label()
387 if (node) in get_node_by_label()
388 return node; in get_node_by_label()
394 struct node *get_node_by_phandle(struct node *tree, cell_t phandle) in get_node_by_phandle()
396 struct node *child, *node; in get_node_by_phandle() local
404 node = get_node_by_phandle(child, phandle); in get_node_by_phandle()
405 if (node) in get_node_by_phandle()
406 return node; in get_node_by_phandle()
412 struct node *get_node_by_ref(struct node *tree, const char *ref) in get_node_by_ref()
420 cell_t get_node_phandle(struct node *root, struct node *node) in get_node_phandle() argument
424 if ((node->phandle != 0) && (node->phandle != -1)) in get_node_phandle()
425 return node->phandle; in get_node_phandle()
430 node->phandle = phandle; in get_node_phandle()
432 if (!get_property(node, "linux,phandle") in get_node_phandle()
434 add_property(node, in get_node_phandle()
438 if (!get_property(node, "phandle") in get_node_phandle()
440 add_property(node, in get_node_phandle()
448 return node->phandle; in get_node_phandle()
451 uint32_t guess_boot_cpuid(struct node *tree) in guess_boot_cpuid()
453 struct node *cpus, *bootcpu; in guess_boot_cpuid()
533 static void sort_properties(struct node *node) in sort_properties() argument
538 for_each_property(node, prop) in sort_properties()
546 for_each_property(node, prop) in sort_properties()
551 node->proplist = tbl[0]; in sort_properties()
561 const struct node *a, *b; in cmp_subnode()
563 a = *((const struct node * const *)ax); in cmp_subnode()
564 b = *((const struct node * const *)bx); in cmp_subnode()
569 static void sort_subnodes(struct node *node) in sort_subnodes() argument
572 struct node *subnode, **tbl; in sort_subnodes()
574 for_each_child(node, subnode) in sort_subnodes()
582 for_each_child(node, subnode) in sort_subnodes()
587 node->children = tbl[0]; in sort_subnodes()
595 static void sort_node(struct node *node) in sort_node() argument
597 struct node *c; in sort_node()
599 sort_properties(node); in sort_node()
600 sort_subnodes(node); in sort_node()
601 for_each_child(node, c) in sort_node()