51 #define _COMPONENT ACPI_NAMESPACE
55 static
u8 acpi_ns_valid_path_separator(
char sep);
57 #ifdef ACPI_OBSOLETE_FUNCTIONS
115 return ((
u8) (prefix ==
'\\'));
130 static u8 acpi_ns_valid_path_separator(
char sep)
133 return ((
u8) (sep ==
'.'));
204 const char *next_external_char;
223 next_external_char++;
228 next_external_char++;
233 while (*next_external_char ==
'^') {
235 next_external_char++;
244 if (*next_external_char) {
246 for (i = 0; next_external_char[
i]; i++) {
247 if (acpi_ns_valid_path_separator(next_external_char[i])) {
285 internal_name[0] =
'\\';
287 if (num_segments <= 1) {
288 result = &internal_name[1];
289 }
else if (num_segments == 2) {
291 result = &internal_name[2];
294 internal_name[2] = (
char)num_segments;
295 result = &internal_name[3];
305 internal_name[
i] =
'^';
309 if (num_segments <= 1) {
310 result = &internal_name[
i];
311 }
else if (num_segments == 2) {
313 result = &internal_name[(acpi_size) i + 1];
317 result = &internal_name[(acpi_size) i + 2];
325 if (acpi_ns_valid_path_separator(*external_name) ||
326 (*external_name == 0)) {
342 if (!acpi_ns_valid_path_separator(*external_name) &&
343 (*external_name != 0)) {
359 "Returning [%p] (abs) \"\\%s\"\n",
360 internal_name, internal_name));
363 internal_name, internal_name));
393 if ((!external_name) || (*external_name == 0) || (!converted_name)) {
405 if (!internal_name) {
442 u32 * converted_name_length,
char **converted_name)
447 u32 prefix_length = 0;
453 if (!internal_name_length || !internal_name || !converted_name) {
459 switch (internal_name[0]) {
465 for (i = 0; i < internal_name_length; i++) {
466 if (internal_name[i] ==
'^') {
467 prefix_length = i + 1;
473 if (i == internal_name_length) {
487 if (prefix_length < internal_name_length) {
488 switch (internal_name[prefix_length]) {
493 names_index = prefix_length + 2;
495 internal_name[(acpi_size) prefix_length + 1];
502 names_index = prefix_length + 1;
518 names_index = prefix_length;
530 ((num_segments > 0) ? (num_segments - 1) : 0) + 1;
536 if (required_length > internal_name_length) {
544 if (!(*converted_name)) {
550 for (i = 0; i < prefix_length; i++) {
551 (*converted_name)[j++] = internal_name[
i];
554 if (num_segments > 0) {
557 (*converted_name)[j++] =
'.';
560 (*converted_name)[j++] = internal_name[names_index++];
561 (*converted_name)[j++] = internal_name[names_index++];
562 (*converted_name)[j++] = internal_name[names_index++];
563 (*converted_name)[j++] = internal_name[names_index++];
567 if (converted_name_length) {
568 *converted_name_length = (
u32) required_length;
710 *return_node = prefix_node;
733 scope_info.
scope.node = prefix_node;