Lines Matching refs:spec
72 name_specifier *spec)
99 strcpy (spec->buf, hw_find_string_property (aliases, alias));
100 strcat (spec->buf, device_specifier + len);
104 strcpy (spec->buf, device_specifier);
109 strcpy (spec->buf, device_specifier);
113 if (strlen (spec->buf) >= sizeof (spec->buf))
117 chp = spec->buf;
124 spec->path = chp;
136 spec->value = chp;
139 if (spec->value[0] == '\0')
141 spec->property = NULL; /*not a property*/
142 spec->value = NULL;
144 else if (spec->value[0] == '>'
145 || spec->value[0] == '<')
147 /* an interrupt spec */
148 spec->property = NULL;
152 chp = strrchr (spec->path, '/');
155 spec->property = spec->path;
156 spec->path = strchr (spec->property, '\0');
161 spec->property = chp+1;
166 spec->name = NULL;
167 spec->family = NULL;
168 spec->unit = NULL;
169 spec->args = NULL;
170 spec->last_name = NULL;
171 spec->last_family = NULL;
172 spec->last_unit = NULL;
173 spec->last_args = NULL;
186 name_specifier *spec)
188 if (split_device_specifier (current, property_specifier, spec))
190 if (spec->property == NULL)
193 char *chp = strrchr (spec->path, '/');
196 spec->property = spec->path;
197 spec->path = strrchr (spec->property, '\0');;
202 spec->property = chp + 1;
216 split_device_name (name_specifier *spec)
220 spec->last_name = spec->name;
221 spec->last_family = spec->family;
222 spec->last_unit = spec->unit;
223 spec->last_args = spec->args;
225 if (spec->path[0] == '\0')
227 spec->name = NULL;
228 spec->family = NULL;
229 spec->unit = NULL;
230 spec->args = NULL;
233 /* break the current device spec from the path */
234 spec->name = spec->path;
235 chp = strchr (spec->name, '/');
237 spec->path = strchr (spec->name, '\0');
240 spec->path = chp+1;
244 if (spec->name[0] == '(')
246 chp = strchr (spec->name, ')');
249 spec->family = spec->name;
254 spec->family = spec->name + 1;
255 spec->name = chp + 1;
260 spec->family = spec->name;
263 chp = strchr (spec->name, '@');
266 spec->unit = NULL;
267 chp = spec->name;
273 spec->unit = chp;
278 spec->args = NULL;
282 spec->args = chp+1;
291 split_value (name_specifier *spec)
294 if (spec->value == NULL)
297 while (isspace (spec->value[0]))
298 spec->value++;
299 if (spec->value[0] == '\0')
301 spec->value = NULL;
304 token = spec->value;
306 while (spec->value[0] != '\0' && !isspace (spec->value[0]))
307 spec->value++;
309 if (spec->value[0] != '\0')
311 spec->value[0] = '\0';
312 spec->value++;
319 /* traverse the path specified by spec starting at current */
323 name_specifier *spec)
328 if (strncmp (spec->path, "/", strlen ("/")) == 0)
333 spec->path += strlen ("/");
335 else if (strncmp (spec->path, "./", strlen ("./")) == 0)
338 spec->path += strlen ("./");
340 else if (strncmp (spec->path, "../", strlen ("../")) == 0)
345 spec->path += strlen ("../");
347 else if (strcmp (spec->path, ".") == 0)
350 spec->path += strlen (".");
352 else if (strcmp (spec->path, "..") == 0)
357 spec->path += strlen ("..");
367 split_device_name (spec);
371 while (split_device_name (spec))
377 if (strcmp (spec->name, hw_name (child)) == 0)
379 if (spec->unit == NULL)
384 hw_unit_decode (current, spec->unit, &phys);
403 name_specifier *spec)
406 if (!split_device_specifier (current, device_specifier, spec))
410 current = split_find_device (current, spec);
413 if (spec->name != NULL)
421 spec->family,
422 spec->name,
423 spec->unit,
424 spec->args);
426 while (split_device_name (spec));
812 name_specifier spec;
820 current = split_fill_path (current, device_specifier, &spec);
822 /* is there an interrupt spec */
823 if (spec.property == NULL
824 && spec.value != NULL)
826 char *op = split_value (&spec);
831 char *my_port_name = split_value (&spec);
833 char *dest_port_name = split_value (&spec);
836 char *dest_hw_name = split_value (&spec);
857 hw_abort (current, "unreconised interrupt spec %s\n", spec.value);
863 if (spec.property != NULL)
865 if (strcmp (spec.value, "true") == 0)
866 hw_add_boolean_property (current, spec.property, 1);
867 else if (strcmp (spec.value, "false") == 0)
868 hw_add_boolean_property (current, spec.property, 0);
872 switch (spec.value[0])
877 parse_ihandle_property (current, spec.property, spec.value + 1);
884 char *curr = spec.value + 1;
895 hw_add_array_property (current, spec.property,
901 parse_string_property (current, spec.property, spec.value);
906 spec.value++;
907 property = hw_tree_find_property (current, spec.value);
909 hw_abort (current, "property %s not found\n", spec.value);
911 spec.property,
917 if (strcmp (spec.property, "reg") == 0
918 || strcmp (spec.property, "assigned-addresses") == 0
919 || strcmp (spec.property, "alternate-reg") == 0)
921 parse_reg_property (current, spec.property, spec.value);
923 else if (strcmp (spec.property, "ranges") == 0)
925 parse_ranges_property (current, spec.property, spec.value);
927 else if (isdigit (spec.value[0])
928 || (spec.value[0] == '-' && isdigit (spec.value[1]))
929 || (spec.value[0] == '+' && isdigit (spec.value[1])))
931 parse_integer_property (current, spec.property, spec.value);
934 parse_string_property (current, spec.property, spec.value);
1157 ihandle_runtime_property_spec spec;
1158 hw_find_ihandle_runtime_property (me, property->name, &spec);
1159 p->print (p->file, " *%s", spec.full_path);
1249 name_specifier spec;
1250 if (!split_device_specifier (root, device_specifier, &spec))
1252 me = split_find_device (root, &spec);
1253 if (spec.name != NULL)
1256 return device_create_instance (me, device_specifier, spec.last_args);
1265 name_specifier spec;
1268 split_device_specifier (root, path_to_device, &spec);
1269 if (spec.value != NULL)
1273 node = split_find_device (root, &spec);
1274 if (spec.name != NULL)
1285 name_specifier spec;
1286 if (!split_property_specifier (root, path_to_property, &spec))
1288 root = split_find_device (root, &spec);
1289 if (spec.name != NULL)
1291 return hw_find_property (root, spec.property);
1298 name_specifier spec;
1299 if (!split_property_specifier (root, path_to_property, &spec))
1301 root = split_find_device (root, &spec);
1302 if (spec.name != NULL)
1304 spec.name, path_to_property);
1305 return hw_find_boolean_property (root, spec.property);
1312 name_specifier spec;
1313 if (!split_property_specifier (root, path_to_property, &spec))
1315 root = split_find_device (root, &spec);
1316 if (spec.name != NULL)
1318 spec.name, path_to_property);
1319 return hw_find_integer_property (root, spec.property);
1328 name_specifier spec;
1329 if (!split_property_specifier (root, path_to_property, &spec))
1331 root = split_find_device (root, &spec);
1332 if (spec.name != NULL)
1334 spec.name, path_to_property);
1335 return hw_find_ihandle_property (root, spec.property);
1343 name_specifier spec;
1344 if (!split_property_specifier (root, path_to_property, &spec))
1346 root = split_find_device (root, &spec);
1347 if (spec.name != NULL)
1349 spec.name, path_to_property);
1350 return hw_find_string_property (root, spec.property);