Changeset 71232af in mainline
- Timestamp:
- 2012-03-02T15:13:36Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- efb8d15
- Parents:
- de3db94a
- Location:
- kernel/genarch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/include/ofw/ofw_tree.h
rde3db94a r71232af 67 67 68 68 extern void ofw_tree_init(ofw_tree_node_t *); 69 extern void ofw_tree_print(void);70 69 extern void ofw_sysinfo_map(void); 71 70 -
kernel/genarch/src/ofw/ofw_tree.c
rde3db94a r71232af 320 320 } 321 321 322 /** Print OpenFirmware device subtree rooted in a node.323 *324 * Child nodes are processed recursively and peer nodes are processed325 * iteratively in order to avoid stack overflow.326 *327 * @param node Root of the subtree.328 * @param path Current path, NULL for the very root of the entire tree.329 *330 */331 static void ofw_tree_node_print(ofw_tree_node_t *node, const char *path)332 {333 char *cur_path = (char *) malloc(PATH_MAX_LEN, 0);334 ofw_tree_node_t *cur;335 336 for (cur = node; cur; cur = cur->peer) {337 if ((cur->parent) && (path)) {338 snprintf(cur_path, PATH_MAX_LEN, "%s/%s", path, cur->da_name);339 printf("%s\n", cur_path);340 } else {341 snprintf(cur_path, PATH_MAX_LEN, "%s", cur->da_name);342 printf("/\n");343 }344 345 if (cur->child)346 ofw_tree_node_print(cur->child, cur_path);347 }348 349 free(cur_path);350 }351 352 /** Print the structure of the OpenFirmware device tree. */353 void ofw_tree_print(void)354 {355 ofw_tree_node_print(ofw_root, NULL);356 }357 358 322 /** Map OpenFirmware device subtree rooted in a node into sysinfo. 359 323 *
Note:
See TracChangeset
for help on using the changeset viewer.