Lines Matching refs:node

100 struct node *build_node(struct property *proplist, struct node *children)  in build_node()
102 struct node *new = xmalloc(sizeof(*new)); in build_node()
103 struct node *child; in build_node()
117 struct node *build_node_delete(void) in build_node_delete()
119 struct node *new = xmalloc(sizeof(*new)); in build_node_delete()
128 struct node *name_node(struct node *node, char *name) in name_node() argument
130 assert(node->name == NULL); in name_node()
132 node->name = name; in name_node()
134 return node; in name_node()
137 struct node *merge_nodes(struct node *old_node, struct node *new_node) in merge_nodes()
140 struct node *new_child, *old_child; in merge_nodes()
219 struct node *chain_node(struct node *first, struct node *list) in chain_node()
227 void add_property(struct node *node, struct property *prop) in add_property() argument
233 p = &node->proplist; in add_property()
240 void delete_property_by_name(struct node *node, char *name) in delete_property_by_name() argument
242 struct property *prop = node->proplist; in delete_property_by_name()
259 void add_child(struct node *parent, struct node *child) in add_child()
261 struct node **p; in add_child()
273 void delete_node_by_name(struct node *parent, char *name) in delete_node_by_name()
275 struct node *node = parent->children; in delete_node_by_name() local
277 while (node) { in delete_node_by_name()
278 if (!strcmp(node->name, name)) { in delete_node_by_name()
279 delete_node(node); in delete_node_by_name()
282 node = node->next_sibling; in delete_node_by_name()
286 void delete_node(struct node *node) in delete_node() argument
289 struct node *child; in delete_node()
291 node->deleted = 1; in delete_node()
292 for_each_child(node, child) in delete_node()
294 for_each_property(node, prop) in delete_node()
296 delete_labels(&node->labels); in delete_node()
339 struct node *tree, uint32_t boot_cpuid_phys) in build_boot_info()
355 const char *get_unitname(struct node *node) in get_unitname() argument
357 if (node->name[node->basenamelen] == '\0') in get_unitname()
360 return node->name + node->basenamelen + 1; in get_unitname()
363 struct property *get_property(struct node *node, const char *propname) in get_property() argument
367 for_each_property(node, prop) in get_property()
380 struct property *get_property_by_label(struct node *tree, const char *label, in get_property_by_label()
381 struct node **node) in get_property_by_label() argument
384 struct node *c; in get_property_by_label()
386 *node = tree; in get_property_by_label()
397 prop = get_property_by_label(c, label, node); in get_property_by_label()
402 *node = NULL; in get_property_by_label()
406 struct marker *get_marker_label(struct node *tree, const char *label, in get_marker_label()
407 struct node **node, struct property **prop) in get_marker_label() argument
411 struct node *c; in get_marker_label()
413 *node = tree; in get_marker_label()
424 m = get_marker_label(c, label, node, prop); in get_marker_label()
430 *node = NULL; in get_marker_label()
434 struct node *get_subnode(struct node *node, const char *nodename) in get_subnode() argument
436 struct node *child; in get_subnode()
438 for_each_child(node, child) in get_subnode()
445 struct node *get_node_by_path(struct node *tree, const char *path) in get_node_by_path()
448 struct node *child; in get_node_by_path()
471 struct node *get_node_by_label(struct node *tree, const char *label) in get_node_by_label()
473 struct node *child, *node; in get_node_by_label() local
483 node = get_node_by_label(child, label); in get_node_by_label()
484 if (node) in get_node_by_label()
485 return node; in get_node_by_label()
491 struct node *get_node_by_phandle(struct node *tree, cell_t phandle) in get_node_by_phandle()
493 struct node *child, *node; in get_node_by_phandle() local
504 node = get_node_by_phandle(child, phandle); in get_node_by_phandle()
505 if (node) in get_node_by_phandle()
506 return node; in get_node_by_phandle()
512 struct node *get_node_by_ref(struct node *tree, const char *ref) in get_node_by_ref()
520 cell_t get_node_phandle(struct node *root, struct node *node) in get_node_phandle() argument
524 if ((node->phandle != 0) && (node->phandle != -1)) in get_node_phandle()
525 return node->phandle; in get_node_phandle()
530 node->phandle = phandle; in get_node_phandle()
532 if (!get_property(node, "linux,phandle") in get_node_phandle()
534 add_property(node, in get_node_phandle()
538 if (!get_property(node, "phandle") in get_node_phandle()
540 add_property(node, in get_node_phandle()
548 return node->phandle; in get_node_phandle()
551 uint32_t guess_boot_cpuid(struct node *tree) in guess_boot_cpuid()
553 struct node *cpus, *bootcpu; in guess_boot_cpuid()
633 static void sort_properties(struct node *node) in sort_properties() argument
638 for_each_property_withdel(node, prop) in sort_properties()
646 for_each_property_withdel(node, prop) in sort_properties()
651 node->proplist = tbl[0]; in sort_properties()
661 const struct node *a, *b; in cmp_subnode()
663 a = *((const struct node * const *)ax); in cmp_subnode()
664 b = *((const struct node * const *)bx); in cmp_subnode()
669 static void sort_subnodes(struct node *node) in sort_subnodes() argument
672 struct node *subnode, **tbl; in sort_subnodes()
674 for_each_child_withdel(node, subnode) in sort_subnodes()
682 for_each_child_withdel(node, subnode) in sort_subnodes()
687 node->children = tbl[0]; in sort_subnodes()
695 static void sort_node(struct node *node) in sort_node() argument
697 struct node *c; in sort_node()
699 sort_properties(node); in sort_node()
700 sort_subnodes(node); in sort_node()
701 for_each_child_withdel(node, c) in sort_node()