nsutils.c (99146) | nsutils.c (99679) |
---|---|
1/****************************************************************************** 2 * 3 * Module Name: nsutils - Utilities for accessing ACPI namespace, accessing 4 * parents and siblings and Scope manipulation | 1/****************************************************************************** 2 * 3 * Module Name: nsutils - Utilities for accessing ACPI namespace, accessing 4 * parents and siblings and Scope manipulation |
5 * $Revision: 105 $ | 5 * $Revision: 110 $ |
6 * 7 *****************************************************************************/ 8 9/****************************************************************************** 10 * 11 * 1. Copyright Notice 12 * 13 * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp. --- 100 unchanged lines hidden (view full) --- 114 * such license, approval or letter. 115 * 116 *****************************************************************************/ 117 118#define __NSUTILS_C__ 119 120#include "acpi.h" 121#include "acnamesp.h" | 6 * 7 *****************************************************************************/ 8 9/****************************************************************************** 10 * 11 * 1. Copyright Notice 12 * 13 * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp. --- 100 unchanged lines hidden (view full) --- 114 * such license, approval or letter. 115 * 116 *****************************************************************************/ 117 118#define __NSUTILS_C__ 119 120#include "acpi.h" 121#include "acnamesp.h" |
122#include "acinterp.h" | |
123#include "amlcode.h" 124#include "actables.h" 125 126#define _COMPONENT ACPI_NAMESPACE 127 ACPI_MODULE_NAME ("nsutils") 128 129 130/******************************************************************************* --- 104 unchanged lines hidden (view full) --- 235 * 236 * RETURN: Status 237 * 238 * DESCRIPTION: Calculate the length of the internal (AML) namestring 239 * corresponding to the external (ASL) namestring. 240 * 241 ******************************************************************************/ 242 | 122#include "amlcode.h" 123#include "actables.h" 124 125#define _COMPONENT ACPI_NAMESPACE 126 ACPI_MODULE_NAME ("nsutils") 127 128 129/******************************************************************************* --- 104 unchanged lines hidden (view full) --- 234 * 235 * RETURN: Status 236 * 237 * DESCRIPTION: Calculate the length of the internal (AML) namestring 238 * corresponding to the external (ASL) namestring. 239 * 240 ******************************************************************************/ 241 |
243ACPI_STATUS | 242void |
244AcpiNsGetInternalNameLength ( 245 ACPI_NAMESTRING_INFO *Info) 246{ 247 NATIVE_CHAR *NextExternalChar; 248 UINT32 i; 249 250 251 ACPI_FUNCTION_ENTRY (); --- 47 unchanged lines hidden (view full) --- 299 } 300 } 301 } 302 303 Info->Length = (ACPI_NAME_SIZE * Info->NumSegments) + 304 4 + Info->NumCarats; 305 306 Info->NextExternalChar = NextExternalChar; | 243AcpiNsGetInternalNameLength ( 244 ACPI_NAMESTRING_INFO *Info) 245{ 246 NATIVE_CHAR *NextExternalChar; 247 UINT32 i; 248 249 250 ACPI_FUNCTION_ENTRY (); --- 47 unchanged lines hidden (view full) --- 298 } 299 } 300 } 301 302 Info->Length = (ACPI_NAME_SIZE * Info->NumSegments) + 303 4 + Info->NumCarats; 304 305 Info->NextExternalChar = NextExternalChar; |
307 308 return (AE_OK); | |
309} 310 311 312/******************************************************************************* 313 * 314 * FUNCTION: AcpiNsBuildInternalName 315 * 316 * PARAMETERS: Info - Info struct fully initialized --- 8 unchanged lines hidden (view full) --- 325ACPI_STATUS 326AcpiNsBuildInternalName ( 327 ACPI_NAMESTRING_INFO *Info) 328{ 329 UINT32 NumSegments = Info->NumSegments; 330 NATIVE_CHAR *InternalName = Info->InternalName; 331 NATIVE_CHAR *ExternalName = Info->NextExternalChar; 332 NATIVE_CHAR *Result = NULL; | 306} 307 308 309/******************************************************************************* 310 * 311 * FUNCTION: AcpiNsBuildInternalName 312 * 313 * PARAMETERS: Info - Info struct fully initialized --- 8 unchanged lines hidden (view full) --- 322ACPI_STATUS 323AcpiNsBuildInternalName ( 324 ACPI_NAMESTRING_INFO *Info) 325{ 326 UINT32 NumSegments = Info->NumSegments; 327 NATIVE_CHAR *InternalName = Info->InternalName; 328 NATIVE_CHAR *ExternalName = Info->NextExternalChar; 329 NATIVE_CHAR *Result = NULL; |
333 UINT32 i; | 330 NATIVE_UINT i; |
334 335 336 ACPI_FUNCTION_TRACE ("NsBuildInternalName"); 337 338 339 /* Setup the correct prefixes, counts, and pointers */ 340 341 if (Info->FullyQualified) --- 60 unchanged lines hidden (view full) --- 402 /* Pad the segment with underscore(s) if segment is short */ 403 404 Result[i] = '_'; 405 } 406 else 407 { 408 /* Convert the character to uppercase and save it */ 409 | 331 332 333 ACPI_FUNCTION_TRACE ("NsBuildInternalName"); 334 335 336 /* Setup the correct prefixes, counts, and pointers */ 337 338 if (Info->FullyQualified) --- 60 unchanged lines hidden (view full) --- 399 /* Pad the segment with underscore(s) if segment is short */ 400 401 Result[i] = '_'; 402 } 403 else 404 { 405 /* Convert the character to uppercase and save it */ 406 |
410 Result[i] = (char) ACPI_TOUPPER (*ExternalName); | 407 Result[i] = (char) ACPI_TOUPPER ((int) *ExternalName); |
411 ExternalName++; 412 } 413 } 414 415 /* Now we must have a path separator, or the pathname is bad */ 416 417 if (!AcpiNsValidPathSeparator (*ExternalName) && 418 (*ExternalName != 0)) --- 106 unchanged lines hidden (view full) --- 525 526ACPI_STATUS 527AcpiNsExternalizeName ( 528 UINT32 InternalNameLength, 529 char *InternalName, 530 UINT32 *ConvertedNameLength, 531 char **ConvertedName) 532{ | 408 ExternalName++; 409 } 410 } 411 412 /* Now we must have a path separator, or the pathname is bad */ 413 414 if (!AcpiNsValidPathSeparator (*ExternalName) && 415 (*ExternalName != 0)) --- 106 unchanged lines hidden (view full) --- 522 523ACPI_STATUS 524AcpiNsExternalizeName ( 525 UINT32 InternalNameLength, 526 char *InternalName, 527 UINT32 *ConvertedNameLength, 528 char **ConvertedName) 529{ |
533 UINT32 PrefixLength = 0; 534 UINT32 NamesIndex = 0; 535 UINT32 NumSegments = 0; 536 UINT32 i = 0; 537 UINT32 j = 0; 538 UINT32 RequiredLength; | 530 NATIVE_UINT_MIN32 PrefixLength = 0; 531 NATIVE_UINT_MIN32 NamesIndex = 0; 532 NATIVE_UINT_MIN32 NumSegments = 0; 533 NATIVE_UINT_MIN32 i = 0; 534 NATIVE_UINT_MIN32 j = 0; 535 NATIVE_UINT_MIN32 RequiredLength; |
539 540 541 ACPI_FUNCTION_TRACE ("NsExternalizeName"); 542 543 544 if (!InternalNameLength || 545 !InternalName || 546 !ConvertedName) --- 20 unchanged lines hidden (view full) --- 567 } 568 569 if (i == InternalNameLength) 570 { 571 PrefixLength = i; 572 } 573 574 break; | 536 537 538 ACPI_FUNCTION_TRACE ("NsExternalizeName"); 539 540 541 if (!InternalNameLength || 542 !InternalName || 543 !ConvertedName) --- 20 unchanged lines hidden (view full) --- 564 } 565 566 if (i == InternalNameLength) 567 { 568 PrefixLength = i; 569 } 570 571 break; |
572 573 default: 574 break; |
|
575 } 576 577 /* 578 * Check for object names. Note that there could be 0-255 of these 579 * 4-byte elements. 580 */ 581 if (PrefixLength < InternalNameLength) 582 { --- 80 unchanged lines hidden (view full) --- 663 (*ConvertedName)[j++] = InternalName[NamesIndex++]; 664 (*ConvertedName)[j++] = InternalName[NamesIndex++]; 665 (*ConvertedName)[j++] = InternalName[NamesIndex++]; 666 } 667 } 668 669 if (ConvertedNameLength) 670 { | 575 } 576 577 /* 578 * Check for object names. Note that there could be 0-255 of these 579 * 4-byte elements. 580 */ 581 if (PrefixLength < InternalNameLength) 582 { --- 80 unchanged lines hidden (view full) --- 663 (*ConvertedName)[j++] = InternalName[NamesIndex++]; 664 (*ConvertedName)[j++] = InternalName[NamesIndex++]; 665 (*ConvertedName)[j++] = InternalName[NamesIndex++]; 666 } 667 } 668 669 if (ConvertedNameLength) 670 { |
671 *ConvertedNameLength = RequiredLength; | 671 *ConvertedNameLength = (UINT32) RequiredLength; |
672 } 673 674 return_ACPI_STATUS (AE_OK); 675} 676 677 678/******************************************************************************* 679 * --- 278 unchanged lines hidden (view full) --- 958 if (ChildNode) 959 { 960 /* Valid entry. Get the parent Node */ 961 962 ParentNode = AcpiNsGetParentNode (ChildNode); 963 if (ParentNode) 964 { 965 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Parent of %p [%4.4s] is %p [%4.4s]\n", | 672 } 673 674 return_ACPI_STATUS (AE_OK); 675} 676 677 678/******************************************************************************* 679 * --- 278 unchanged lines hidden (view full) --- 958 if (ChildNode) 959 { 960 /* Valid entry. Get the parent Node */ 961 962 ParentNode = AcpiNsGetParentNode (ChildNode); 963 if (ParentNode) 964 { 965 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Parent of %p [%4.4s] is %p [%4.4s]\n", |
966 ChildNode, (char *) &ChildNode->Name, 967 ParentNode, (char *) &ParentNode->Name)); | 966 ChildNode, ChildNode->Name.Ascii, 967 ParentNode, ParentNode->Name.Ascii)); |
968 969 if (ParentNode->Name.Integer) 970 { | 968 969 if (ParentNode->Name.Integer) 970 { |
971 return_VALUE (ParentNode->Name.Integer); | 971 return_VALUE ((ACPI_NAME) ParentNode->Name.Integer); |
972 } 973 } 974 975 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "unable to find parent of %p (%4.4s)\n", | 972 } 973 } 974 975 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "unable to find parent of %p (%4.4s)\n", |
976 ChildNode, (char *) &ChildNode->Name)); | 976 ChildNode, ChildNode->Name.Ascii)); |
977 } 978 979 return_VALUE (ACPI_UNKNOWN_NAME); 980} 981 982 983#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER) 984 --- 112 unchanged lines hidden --- | 977 } 978 979 return_VALUE (ACPI_UNKNOWN_NAME); 980} 981 982 983#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER) 984 --- 112 unchanged lines hidden --- |