Changeset 25a76ab8 in mainline for boot/genarch/src/ofw_tree.c
- Timestamp:
- 2010-05-08T07:53:23Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 051bc69a
- Parents:
- 6c39a907 (diff), 1317380 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
boot/genarch/src/ofw_tree.c
r6c39a907 r25a76ab8 27 27 */ 28 28 29 #include < ofw_tree.h>30 #include < ofw.h>31 #include < ofwarch.h>32 #include <type s.h>33 #include <str ing.h>29 #include <genarch/ofw_tree.h> 30 #include <genarch/ofw.h> 31 #include <arch/ofw.h> 32 #include <typedefs.h> 33 #include <str.h> 34 34 #include <balloc.h> 35 #include <asm.h>36 35 #include <memstr.h> 37 36 37 static char path[OFW_TREE_PATH_MAX_LEN + 1]; 38 static char name[OFW_TREE_PROPERTY_MAX_NAMELEN]; 39 static char name2[OFW_TREE_PROPERTY_MAX_NAMELEN]; 40 38 41 static ofw_tree_node_t *ofw_tree_node_alloc(void) 39 42 { … … 41 44 } 42 45 43 static ofw_tree_property_t *ofw_tree_properties_alloc( unsignedcount)46 static ofw_tree_property_t *ofw_tree_properties_alloc(size_t count) 44 47 { 45 48 return balloc(count * sizeof(ofw_tree_property_t), … … 59 62 * behind the requested memory. 60 63 */ 61 char *addr = balloc(size + 1, size);64 char *addr = balloc(size + 1, 4); 62 65 if (addr) 63 66 addr[size] = '\0'; … … 99 102 * Get the disambigued name. 100 103 */ 101 static char path[OFW_TREE_PATH_MAX_LEN + 1];102 104 size_t len = ofw_package_to_path(current, path, OFW_TREE_PATH_MAX_LEN); 103 if (len == -1)105 if (len == (size_t) -1) 104 106 return; 105 107 … … 107 109 108 110 /* Find last slash */ 109 int i;110 for (i = len - 1; (i >= 0) && (path[i] != '/'); i--);111 size_t i; 112 for (i = len; (i > 0) && (path[i - 1] != '/'); i--); 111 113 112 114 /* Do not include the slash */ 113 i++;114 115 len -= i; 115 116 … … 127 128 */ 128 129 phandle child = ofw_get_child_node(current); 129 if ((child != 0) && (child != -1)) {130 if ((child != 0) && (child != (phandle) -1)) { 130 131 ofw_tree_node_t *child_node = ofw_tree_node_alloc(); 131 132 if (child_node) { … … 140 141 * Count properties. 141 142 */ 142 static char name[OFW_TREE_PROPERTY_MAX_NAMELEN];143 static char name2[OFW_TREE_PROPERTY_MAX_NAMELEN];144 143 name[0] = '\0'; 145 144 while (ofw_next_property(current, name, name2) == 1) { … … 188 187 current_node->property = (ofw_tree_property_t *) balloc_rebase(property); 189 188 190 191 189 /* 192 190 * Iteratively process the next peer node. … … 197 195 */ 198 196 phandle peer = ofw_get_peer_node(current); 199 if ((peer != 0) && (peer != -1)) {197 if ((peer != 0) && (peer != (phandle) -1)) { 200 198 ofw_tree_node_t *peer_node = ofw_tree_node_alloc(); 201 199 if (peer_node) { … … 234 232 */ 235 233 phandle ssm_node = ofw_find_device("/ssm@0,0"); 236 if (ssm_node != -1) {234 if (ssm_node != (phandle) -1) { 237 235 ofw_tree_node_t *ssm = ofw_tree_node_alloc(); 238 236 if (ssm) {
Note:
See TracChangeset
for help on using the changeset viewer.