• Home
  • Raw
  • Download

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 void add_orphan_node(struct node *dt, struct node *new_node, char *ref) in add_orphan_node()
222 struct node *node; in add_orphan_node() local
235 node = build_node(p, new_node); in add_orphan_node()
236 name_node(node, name); in add_orphan_node()
238 add_child(dt, node); in add_orphan_node()
241 struct node *chain_node(struct node *first, struct node *list) in chain_node()
249 void add_property(struct node *node, struct property *prop) in add_property() argument
255 p = &node->proplist; in add_property()
262 void delete_property_by_name(struct node *node, char *name) in delete_property_by_name() argument
264 struct property *prop = node->proplist; in delete_property_by_name()
281 void add_child(struct node *parent, struct node *child) in add_child()
283 struct node **p; in add_child()
295 void delete_node_by_name(struct node *parent, char *name) in delete_node_by_name()
297 struct node *node = parent->children; in delete_node_by_name() local
299 while (node) { in delete_node_by_name()
300 if (streq(node->name, name)) { in delete_node_by_name()
301 delete_node(node); in delete_node_by_name()
304 node = node->next_sibling; in delete_node_by_name()
308 void delete_node(struct node *node) in delete_node() argument
311 struct node *child; in delete_node()
313 node->deleted = 1; in delete_node()
314 for_each_child(node, child) in delete_node()
316 for_each_property(node, prop) in delete_node()
318 delete_labels(&node->labels); in delete_node()
321 void append_to_property(struct node *node, in append_to_property() argument
327 p = get_property(node, name); in append_to_property()
334 add_property(node, p); in append_to_property()
379 struct node *tree, uint32_t boot_cpuid_phys) in build_dt_info()
396 const char *get_unitname(struct node *node) in get_unitname() argument
398 if (node->name[node->basenamelen] == '\0') in get_unitname()
401 return node->name + node->basenamelen + 1; in get_unitname()
404 struct property *get_property(struct node *node, const char *propname) in get_property() argument
408 for_each_property(node, prop) in get_property()
421 struct property *get_property_by_label(struct node *tree, const char *label, in get_property_by_label()
422 struct node **node) in get_property_by_label() argument
425 struct node *c; in get_property_by_label()
427 *node = tree; in get_property_by_label()
438 prop = get_property_by_label(c, label, node); in get_property_by_label()
443 *node = NULL; in get_property_by_label()
447 struct marker *get_marker_label(struct node *tree, const char *label, in get_marker_label()
448 struct node **node, struct property **prop) in get_marker_label() argument
452 struct node *c; in get_marker_label()
454 *node = tree; in get_marker_label()
465 m = get_marker_label(c, label, node, prop); in get_marker_label()
471 *node = NULL; in get_marker_label()
475 struct node *get_subnode(struct node *node, const char *nodename) in get_subnode() argument
477 struct node *child; in get_subnode()
479 for_each_child(node, child) in get_subnode()
486 struct node *get_node_by_path(struct node *tree, const char *path) in get_node_by_path()
489 struct node *child; in get_node_by_path()
512 struct node *get_node_by_label(struct node *tree, const char *label) in get_node_by_label()
514 struct node *child, *node; in get_node_by_label() local
524 node = get_node_by_label(child, label); in get_node_by_label()
525 if (node) in get_node_by_label()
526 return node; in get_node_by_label()
532 struct node *get_node_by_phandle(struct node *tree, cell_t phandle) in get_node_by_phandle()
534 struct node *child, *node; in get_node_by_phandle() local
545 node = get_node_by_phandle(child, phandle); in get_node_by_phandle()
546 if (node) in get_node_by_phandle()
547 return node; in get_node_by_phandle()
553 struct node *get_node_by_ref(struct node *tree, const char *ref) in get_node_by_ref()
563 cell_t get_node_phandle(struct node *root, struct node *node) in get_node_phandle() argument
567 if ((node->phandle != 0) && (node->phandle != -1)) in get_node_phandle()
568 return node->phandle; in get_node_phandle()
573 node->phandle = phandle; in get_node_phandle()
575 if (!get_property(node, "linux,phandle") in get_node_phandle()
577 add_property(node, in get_node_phandle()
581 if (!get_property(node, "phandle") in get_node_phandle()
583 add_property(node, in get_node_phandle()
591 return node->phandle; in get_node_phandle()
594 uint32_t guess_boot_cpuid(struct node *tree) in guess_boot_cpuid()
596 struct node *cpus, *bootcpu; in guess_boot_cpuid()
676 static void sort_properties(struct node *node) in sort_properties() argument
681 for_each_property_withdel(node, prop) in sort_properties()
689 for_each_property_withdel(node, prop) in sort_properties()
694 node->proplist = tbl[0]; in sort_properties()
704 const struct node *a, *b; in cmp_subnode()
706 a = *((const struct node * const *)ax); in cmp_subnode()
707 b = *((const struct node * const *)bx); in cmp_subnode()
712 static void sort_subnodes(struct node *node) in sort_subnodes() argument
715 struct node *subnode, **tbl; in sort_subnodes()
717 for_each_child_withdel(node, subnode) in sort_subnodes()
725 for_each_child_withdel(node, subnode) in sort_subnodes()
730 node->children = tbl[0]; in sort_subnodes()
738 static void sort_node(struct node *node) in sort_node() argument
740 struct node *c; in sort_node()
742 sort_properties(node); in sort_node()
743 sort_subnodes(node); in sort_node()
744 for_each_child_withdel(node, c) in sort_node()
755 static struct node *build_and_name_child_node(struct node *parent, char *name) in build_and_name_child_node()
757 struct node *node; in build_and_name_child_node() local
759 node = build_node(NULL, NULL); in build_and_name_child_node()
760 name_node(node, xstrdup(name)); in build_and_name_child_node()
761 add_child(parent, node); in build_and_name_child_node()
763 return node; in build_and_name_child_node()
766 static struct node *build_root_node(struct node *dt, char *name) in build_root_node()
768 struct node *an; in build_root_node()
780 static bool any_label_tree(struct dt_info *dti, struct node *node) in any_label_tree() argument
782 struct node *c; in any_label_tree()
784 if (node->labels) in any_label_tree()
787 for_each_child(node, c) in any_label_tree()
795 struct node *an, struct node *node, in generate_label_tree_internal() argument
798 struct node *dt = dti->dt; in generate_label_tree_internal()
799 struct node *c; in generate_label_tree_internal()
804 if (node->labels) { in generate_label_tree_internal()
807 for_each_label(node->labels, l) { in generate_label_tree_internal()
820 data_copy_mem(node->fullpath, in generate_label_tree_internal()
821 strlen(node->fullpath) + 1)); in generate_label_tree_internal()
827 (void)get_node_phandle(dt, node); in generate_label_tree_internal()
830 for_each_child(node, c) in generate_label_tree_internal()
834 static bool any_fixup_tree(struct dt_info *dti, struct node *node) in any_fixup_tree() argument
836 struct node *c; in any_fixup_tree()
840 for_each_property(node, prop) { in any_fixup_tree()
848 for_each_child(node, c) { in any_fixup_tree()
856 static void add_fixup_entry(struct dt_info *dti, struct node *fn, in add_fixup_entry()
857 struct node *node, struct property *prop, in add_fixup_entry() argument
866 if (strchr(node->fullpath, ':') || strchr(prop->name, ':')) in add_fixup_entry()
870 node->fullpath, prop->name, m->offset); in add_fixup_entry()
877 struct node *fn, in generate_fixups_tree_internal()
878 struct node *node) in generate_fixups_tree_internal() argument
880 struct node *dt = dti->dt; in generate_fixups_tree_internal()
881 struct node *c; in generate_fixups_tree_internal()
884 struct node *refnode; in generate_fixups_tree_internal()
886 for_each_property(node, prop) { in generate_fixups_tree_internal()
891 add_fixup_entry(dti, fn, node, prop, m); in generate_fixups_tree_internal()
895 for_each_child(node, c) in generate_fixups_tree_internal()
899 static bool any_local_fixup_tree(struct dt_info *dti, struct node *node) in any_local_fixup_tree() argument
901 struct node *c; in any_local_fixup_tree()
905 for_each_property(node, prop) { in any_local_fixup_tree()
913 for_each_child(node, c) { in any_local_fixup_tree()
922 struct node *lfn, struct node *node, in add_local_fixup_entry() argument
924 struct node *refnode) in add_local_fixup_entry()
926 struct node *wn, *nwn; /* local fixup node, walk node, new */ in add_local_fixup_entry()
933 for (wn = node; wn; wn = wn->parent) in add_local_fixup_entry()
940 for (wn = node, i = depth - 1; wn; wn = wn->parent, i--) in add_local_fixup_entry()
958 struct node *lfn, in generate_local_fixups_tree_internal()
959 struct node *node) in generate_local_fixups_tree_internal() argument
961 struct node *dt = dti->dt; in generate_local_fixups_tree_internal()
962 struct node *c; in generate_local_fixups_tree_internal()
965 struct node *refnode; in generate_local_fixups_tree_internal()
967 for_each_property(node, prop) { in generate_local_fixups_tree_internal()
972 add_local_fixup_entry(dti, lfn, node, prop, m, refnode); in generate_local_fixups_tree_internal()
976 for_each_child(node, c) in generate_local_fixups_tree_internal()