• Home
  • Raw
  • Download

Lines Matching full: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 *omit_node_if_unused(struct node *node) in omit_node_if_unused() argument
139 node->omit_if_unused = 1; in omit_node_if_unused()
141 return node; in omit_node_if_unused()
144 struct node *reference_node(struct node *node) in reference_node() argument
146 node->is_referenced = 1; in reference_node()
148 return node; in reference_node()
151 struct node *merge_nodes(struct node *old_node, struct node *new_node) in merge_nodes()
154 struct node *new_child, *old_child; in merge_nodes()
159 /* Add new node labels to old node */ in merge_nodes()
163 /* Move properties from the new node to the old node. If there in merge_nodes()
192 /* if no collision occurred, add property to the old node. */ in merge_nodes()
197 /* Move the override child nodes into the primary node. If in merge_nodes()
200 /* Pop the child node off the list */ in merge_nodes()
221 /* if no collision occurred, add child to the old node. */ in merge_nodes()
226 /* The new node contents are now merged into the old node. Free in merge_nodes()
227 * the new node. */ in merge_nodes()
233 struct node * add_orphan_node(struct node *dt, struct node *new_node, char *ref) in add_orphan_node()
236 struct node *node; in add_orphan_node() local
255 node = build_node(p, new_node); in add_orphan_node()
256 name_node(node, name); in add_orphan_node()
258 add_child(dt, node); in add_orphan_node()
262 struct node *chain_node(struct node *first, struct node *list) in chain_node()
270 void add_property(struct node *node, struct property *prop) in add_property() argument
276 p = &node->proplist; in add_property()
283 void delete_property_by_name(struct node *node, char *name) in delete_property_by_name() argument
285 struct property *prop = node->proplist; in delete_property_by_name()
302 void add_child(struct node *parent, struct node *child) in add_child()
304 struct node **p; in add_child()
316 void delete_node_by_name(struct node *parent, char *name) in delete_node_by_name()
318 struct node *node = parent->children; in delete_node_by_name() local
320 while (node) { in delete_node_by_name()
321 if (streq(node->name, name)) { in delete_node_by_name()
322 delete_node(node); in delete_node_by_name()
325 node = node->next_sibling; in delete_node_by_name()
329 void delete_node(struct node *node) in delete_node() argument
332 struct node *child; in delete_node()
334 node->deleted = 1; in delete_node()
335 for_each_child(node, child) in delete_node()
337 for_each_property(node, prop) in delete_node()
339 delete_labels(&node->labels); in delete_node()
342 void append_to_property(struct node *node, in append_to_property() argument
348 p = get_property(node, name); in append_to_property()
355 add_property(node, p); in append_to_property()
400 struct node *tree, uint32_t boot_cpuid_phys) in build_dt_info()
417 const char *get_unitname(struct node *node) in get_unitname() argument
419 if (node->name[node->basenamelen] == '\0') in get_unitname()
422 return node->name + node->basenamelen + 1; in get_unitname()
425 struct property *get_property(struct node *node, const char *propname) in get_property() argument
429 for_each_property(node, prop) in get_property()
448 struct property *get_property_by_label(struct node *tree, const char *label, in get_property_by_label()
449 struct node **node) in get_property_by_label() argument
452 struct node *c; in get_property_by_label()
454 *node = tree; in get_property_by_label()
465 prop = get_property_by_label(c, label, node); in get_property_by_label()
470 *node = NULL; in get_property_by_label()
474 struct marker *get_marker_label(struct node *tree, const char *label, in get_marker_label()
475 struct node **node, struct property **prop) in get_marker_label() argument
479 struct node *c; in get_marker_label()
481 *node = tree; in get_marker_label()
492 m = get_marker_label(c, label, node, prop); in get_marker_label()
498 *node = NULL; in get_marker_label()
502 struct node *get_subnode(struct node *node, const char *nodename) in get_subnode() argument
504 struct node *child; in get_subnode()
506 for_each_child(node, child) in get_subnode()
513 struct node *get_node_by_path(struct node *tree, const char *path) in get_node_by_path()
516 struct node *child; in get_node_by_path()
540 struct node *get_node_by_label(struct node *tree, const char *label) in get_node_by_label()
542 struct node *child, *node; in get_node_by_label() local
552 node = get_node_by_label(child, label); in get_node_by_label()
553 if (node) in get_node_by_label()
554 return node; in get_node_by_label()
560 struct node *get_node_by_phandle(struct node *tree, cell_t phandle) in get_node_by_phandle()
562 struct node *child, *node; in get_node_by_phandle() local
576 node = get_node_by_phandle(child, phandle); in get_node_by_phandle()
577 if (node) in get_node_by_phandle()
578 return node; in get_node_by_phandle()
584 struct node *get_node_by_ref(struct node *tree, const char *ref) in get_node_by_ref()
594 cell_t get_node_phandle(struct node *root, struct node *node) in get_node_phandle() argument
598 if ((node->phandle != 0) && (node->phandle != -1)) in get_node_phandle()
599 return node->phandle; in get_node_phandle()
604 node->phandle = phandle; in get_node_phandle()
606 if (!get_property(node, "linux,phandle") in get_node_phandle()
608 add_property(node, in get_node_phandle()
612 if (!get_property(node, "phandle") in get_node_phandle()
614 add_property(node, in get_node_phandle()
618 /* If the node *does* have a phandle property, we must in get_node_phandle()
622 return node->phandle; in get_node_phandle()
625 uint32_t guess_boot_cpuid(struct node *tree) in guess_boot_cpuid()
627 struct node *cpus, *bootcpu; in guess_boot_cpuid()
643 /* FIXME: Sanity check node? */ in guess_boot_cpuid()
707 static void sort_properties(struct node *node) in sort_properties() argument
712 for_each_property_withdel(node, prop) in sort_properties()
720 for_each_property_withdel(node, prop) in sort_properties()
725 node->proplist = tbl[0]; in sort_properties()
735 const struct node *a, *b; in cmp_subnode()
737 a = *((const struct node * const *)ax); in cmp_subnode()
738 b = *((const struct node * const *)bx); in cmp_subnode()
743 static void sort_subnodes(struct node *node) in sort_subnodes() argument
746 struct node *subnode, **tbl; in sort_subnodes()
748 for_each_child_withdel(node, subnode) in sort_subnodes()
756 for_each_child_withdel(node, subnode) in sort_subnodes()
761 node->children = tbl[0]; in sort_subnodes()
769 static void sort_node(struct node *node) in sort_node() argument
771 struct node *c; in sort_node()
773 sort_properties(node); in sort_node()
774 sort_subnodes(node); in sort_node()
775 for_each_child_withdel(node, c) in sort_node()
786 static struct node *build_and_name_child_node(struct node *parent, char *name) in build_and_name_child_node()
788 struct node *node; in build_and_name_child_node() local
790 node = build_node(NULL, NULL); in build_and_name_child_node()
791 name_node(node, xstrdup(name)); in build_and_name_child_node()
792 add_child(parent, node); in build_and_name_child_node()
794 return node; in build_and_name_child_node()
797 static struct node *build_root_node(struct node *dt, char *name) in build_root_node()
799 struct node *an; in build_root_node()
806 die("Could not build root node /%s\n", name); in build_root_node()
811 static bool any_label_tree(struct dt_info *dti, struct node *node) in any_label_tree() argument
813 struct node *c; in any_label_tree()
815 if (node->labels) in any_label_tree()
818 for_each_child(node, c) in any_label_tree()
826 struct node *an, struct node *node, in generate_label_tree_internal() argument
829 struct node *dt = dti->dt; in generate_label_tree_internal()
830 struct node *c; in generate_label_tree_internal()
835 if (node->labels) { in generate_label_tree_internal()
837 /* now add the label in the node */ in generate_label_tree_internal()
838 for_each_label(node->labels, l) { in generate_label_tree_internal()
851 data_copy_mem(node->fullpath, in generate_label_tree_internal()
852 strlen(node->fullpath) + 1)); in generate_label_tree_internal()
856 /* force allocation of a phandle for this node */ in generate_label_tree_internal()
858 (void)get_node_phandle(dt, node); in generate_label_tree_internal()
861 for_each_child(node, c) in generate_label_tree_internal()
865 static bool any_fixup_tree(struct dt_info *dti, struct node *node) in any_fixup_tree() argument
867 struct node *c; in any_fixup_tree()
871 for_each_property(node, prop) { in any_fixup_tree()
879 for_each_child(node, c) { in any_fixup_tree()
887 static void add_fixup_entry(struct dt_info *dti, struct node *fn, in add_fixup_entry()
888 struct node *node, struct property *prop, in add_fixup_entry() argument
897 if (strchr(node->fullpath, ':') || strchr(prop->name, ':')) in add_fixup_entry()
901 node->fullpath, prop->name, m->offset); in add_fixup_entry()
908 struct node *fn, in generate_fixups_tree_internal()
909 struct node *node) in generate_fixups_tree_internal() argument
911 struct node *dt = dti->dt; in generate_fixups_tree_internal()
912 struct node *c; in generate_fixups_tree_internal()
915 struct node *refnode; in generate_fixups_tree_internal()
917 for_each_property(node, prop) { in generate_fixups_tree_internal()
922 add_fixup_entry(dti, fn, node, prop, m); in generate_fixups_tree_internal()
926 for_each_child(node, c) in generate_fixups_tree_internal()
930 static bool any_local_fixup_tree(struct dt_info *dti, struct node *node) in any_local_fixup_tree() argument
932 struct node *c; in any_local_fixup_tree()
936 for_each_property(node, prop) { in any_local_fixup_tree()
944 for_each_child(node, c) { in any_local_fixup_tree()
953 struct node *lfn, struct node *node, in add_local_fixup_entry() argument
955 struct node *refnode) in add_local_fixup_entry()
957 struct node *wn, *nwn; /* local fixup node, walk node, new */ in add_local_fixup_entry()
964 for (wn = node; wn; wn = wn->parent) in add_local_fixup_entry()
971 for (wn = node, i = depth - 1; wn; wn = wn->parent, i--) in add_local_fixup_entry()
976 /* if no node exists, create it */ in add_local_fixup_entry()
989 struct node *lfn, in generate_local_fixups_tree_internal()
990 struct node *node) in generate_local_fixups_tree_internal() argument
992 struct node *dt = dti->dt; in generate_local_fixups_tree_internal()
993 struct node *c; in generate_local_fixups_tree_internal()
996 struct node *refnode; in generate_local_fixups_tree_internal()
998 for_each_property(node, prop) { in generate_local_fixups_tree_internal()
1003 add_local_fixup_entry(dti, lfn, node, prop, m, refnode); in generate_local_fixups_tree_internal()
1007 for_each_child(node, c) in generate_local_fixups_tree_internal()