Deleted Added
sdiff udiff text old ( 99146 ) new ( 99679 )
full compact
1/******************************************************************************
2 *
3 * Module Name: nsutils - Utilities for accessing ACPI namespace, accessing
4 * parents and siblings and Scope manipulation
5 * $Revision: 105 $
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
243ACPI_STATUS
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;
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;
333 UINT32 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
410 Result[i] = (char) ACPI_TOUPPER (*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{
533 UINT32 PrefixLength = 0;
534 UINT32 NamesIndex = 0;
535 UINT32 NumSegments = 0;
536 UINT32 i = 0;
537 UINT32 j = 0;
538 UINT32 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;
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;
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));
968
969 if (ParentNode->Name.Integer)
970 {
971 return_VALUE (ParentNode->Name.Integer);
972 }
973 }
974
975 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "unable to find parent of %p (%4.4s)\n",
976 ChildNode, (char *) &ChildNode->Name));
977 }
978
979 return_VALUE (ACPI_UNKNOWN_NAME);
980}
981
982
983#if defined(ACPI_DEBUG) || defined(ENABLE_DEBUGGER)
984

--- 112 unchanged lines hidden ---