Changeset 45b26dad in mainline for kernel/genarch/src/ofw/ofw_tree.c


Ignore:
Timestamp:
2006-09-26T12:59:28Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b44939b
Parents:
6ff1f1e
Message:

sparc64 work:

  • Loader now starts all processors.
  • Kernel halts all but the bootstrup processor for now.
  • Read clock-frequency from the respective processor node in the device tree
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/ofw/ofw_tree.c

    r6ff1f1e r45b26dad  
    9898 * @return NULL if there is no such child or pointer to the matching child node.
    9999 */
    100 static ofw_tree_node_t *ofw_tree_find_child(ofw_tree_node_t *node, const char *name)
     100ofw_tree_node_t *ofw_tree_find_child(ofw_tree_node_t *node, const char *name)
    101101{
    102102        ofw_tree_node_t *cur;
     
    125125}
    126126
     127/** Lookup first child of given device type.
     128 *
     129 * @param node Node whose child is being looked up.
     130 * @param name Device type of the child being looked up.
     131 *
     132 * @return NULL if there is no such child or pointer to the matching child node.
     133 */
     134ofw_tree_node_t *ofw_tree_find_child_by_device_type(ofw_tree_node_t *node, const char *name)
     135{
     136        ofw_tree_node_t *cur;
     137        ofw_tree_property_t *prop;
     138       
     139        for (cur = node->child; cur; cur = cur->peer) {
     140                prop = ofw_tree_getprop(cur, "device_type");
     141                if (!prop || !prop->value)
     142                        continue;
     143                if (strcmp(prop->value, name) == 0)
     144                        return cur;
     145        }
     146                       
     147        return NULL;
     148}
     149
     150/** Lookup first peer of given device type.
     151 *
     152 * @param node Node whose peer is being looked up.
     153 * @param name Device type of the child being looked up.
     154 *
     155 * @return NULL if there is no such child or pointer to the matching child node.
     156 */
     157ofw_tree_node_t *ofw_tree_find_peer_by_device_type(ofw_tree_node_t *node, const char *name)
     158{
     159        ofw_tree_node_t *cur;
     160        ofw_tree_property_t *prop;
     161       
     162        for (cur = node->peer; cur; cur = cur->peer) {
     163                prop = ofw_tree_getprop(cur, "device_type");
     164                if (!prop || !prop->value)
     165                        continue;
     166                if (strcmp(prop->value, name) == 0)
     167                        return cur;
     168        }
     169                       
     170        return NULL;
     171}
     172
     173
    127174/** Lookup OpenFirmware node by its path.
    128175 *
Note: See TracChangeset for help on using the changeset viewer.