Deleted Added
full compact
4c4
< * $Revision: 1.95 $
---
> * $Revision: 1.103 $
12c12
< * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
---
> * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp.
169a170,175
> static ACPI_STATUS
> LkIsObjectUsed (
> ACPI_HANDLE ObjHandle,
> UINT32 Level,
> void *Context,
> void **ReturnValue);
170a177
>
199,201c206,208
< Gbl_NumNamespaceObjects, Level, (Level * 3), " ",
< &Node->Name,
< AcpiUtGetTypeName (Node->Type));
---
> Gbl_NumNamespaceObjects, Level, (Level * 3), " ",
> &Node->Name,
> AcpiUtGetTypeName (Node->Type));
214c221
< (ObjDesc->Common.Descriptor == ACPI_DESC_TYPE_OPERAND))
---
> (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_OPERAND))
361c368
< if (Op->Asl.ParseOpcode == PARSEOP_INTEGER)
---
> if (Op && (Op->Asl.ParseOpcode == PARSEOP_INTEGER))
377a385,407
> case ACPI_TYPE_LOCAL_RESOURCE:
>
> FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
> " [Desc Offset 0x%.4X Bytes]", Node->Value);
> break;
>
>
> case ACPI_TYPE_LOCAL_RESOURCE_FIELD:
>
> if (Node->Flags & 0x80)
> {
> FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
> " [Field Offset 0x%.4X Bits 0x%.4X Bytes]",
> Node->Value, Node->Value / 8);
> }
> else
> {
> FlPrintFile (ASL_FILE_NAMESPACE_OUTPUT,
> " [Field Offset 0x%.4X Bytes]", Node->Value);
> }
> break;
>
>
388a419,427
> void
> LsSetupNsList (void * Handle)
> {
>
> Gbl_NsOutputFlag = TRUE;
> Gbl_Files[ASL_FILE_NAMESPACE_OUTPUT].Handle = Handle;
> }
>
>
414a454,455
> Gbl_NumNamespaceObjects = 0;
>
500a542,688
> * FUNCTION: LkGetNameOp
> *
> * PARAMETERS: Op - Current Op
> *
> * RETURN: NameOp associated with the input op
> *
> * DESCRIPTION: Find the name declaration op associated with the operator
> *
> ******************************************************************************/
>
> ACPI_PARSE_OBJECT *
> LkGetNameOp (
> ACPI_PARSE_OBJECT *Op)
> {
> const ACPI_OPCODE_INFO *OpInfo;
> ACPI_PARSE_OBJECT *NameOp = Op;
>
>
> OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode);
>
>
> /* Get the NamePath from the appropriate place */
>
> if (OpInfo->Flags & AML_NAMED)
> {
> /* For nearly all NAMED operators, the name reference is the first child */
>
> NameOp = Op->Asl.Child;
> if (Op->Asl.AmlOpcode == AML_ALIAS_OP)
> {
> /*
> * ALIAS is the only oddball opcode, the name declaration
> * (alias name) is the second operand
> */
> NameOp = Op->Asl.Child->Asl.Next;
> }
> }
> else if (OpInfo->Flags & AML_CREATE)
> {
> /* Name must appear as the last parameter */
>
> NameOp = Op->Asl.Child;
> while (!(NameOp->Asl.CompileFlags & NODE_IS_NAME_DECLARATION))
> {
> NameOp = NameOp->Asl.Next;
> }
> }
>
> return (NameOp);
> }
>
>
> /*******************************************************************************
> *
> * FUNCTION: LkIsObjectUsed
> *
> * PARAMETERS: ACPI_WALK_CALLBACK
> *
> * RETURN: Status
> *
> * DESCRIPTION: Check for an unreferenced namespace object and emit a warning.
> * We have to be careful, because some types and names are
> * typically or always unreferenced, we don't want to issue
> * excessive warnings.
> *
> ******************************************************************************/
>
> static ACPI_STATUS
> LkIsObjectUsed (
> ACPI_HANDLE ObjHandle,
> UINT32 Level,
> void *Context,
> void **ReturnValue)
> {
> ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
>
>
> /* Referenced flag is set during the namespace xref */
>
> if (Node->Flags & ANOBJ_IS_REFERENCED)
> {
> return (AE_OK);
> }
>
> /*
> * Ignore names that start with an underscore,
> * these are the reserved ACPI names and are typically not referenced,
> * they are called by the host OS.
> */
> if (Node->Name.Ascii[0] == '_')
> {
> return (AE_OK);
> }
>
> /* There are some types that are typically not referenced, ignore them */
>
> switch (Node->Type)
> {
> case ACPI_TYPE_DEVICE:
> case ACPI_TYPE_PROCESSOR:
> case ACPI_TYPE_POWER:
> case ACPI_TYPE_LOCAL_RESOURCE:
> return (AE_OK);
>
> default:
> break;
> }
>
> /* All others are valid unreferenced namespace objects */
>
> if (Node->Op)
> {
> AslError (ASL_WARNING2, ASL_MSG_NOT_REFERENCED, LkGetNameOp (Node->Op), NULL);
> }
> return (AE_OK);
> }
>
>
> /*******************************************************************************
> *
> * FUNCTION: LkFindUnreferencedObjects
> *
> * PARAMETERS: None
> *
> * RETURN: None
> *
> * DESCRIPTION: Namespace walk to find objects that are not referenced in any
> * way. Must be called after the namespace has been cross
> * referenced.
> *
> ******************************************************************************/
>
> void
> LkFindUnreferencedObjects (
> void)
> {
>
> /* Walk entire namespace from the supplied root */
>
> (void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,
> ACPI_UINT32_MAX, FALSE, LkIsObjectUsed,
> NULL, NULL);
> }
>
>
> /*******************************************************************************
> *
644c832
< ACPI_FUNCTION_TRACE_PTR ("LkNamespaceLocateBegin", Op);
---
> ACPI_FUNCTION_TRACE_PTR (LkNamespaceLocateBegin, Op);
691c879
< /* For all NAMED operators, the name reference is the first child */
---
> /* For nearly all NAMED operators, the name reference is the first child */
732c920
< Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
---
> Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
805a994,1003
> /* Check for a reference vs. name declaration */
>
> if (!(OpInfo->Flags & AML_NAMED) &&
> !(OpInfo->Flags & AML_CREATE))
> {
> /* This node has been referenced, mark it for reference check */
>
> Node->Flags |= ANOBJ_IS_REFERENCED;
> }
>
811,812c1009,1010
< * Dereference an alias. (A name reference that is an alias.)
< * Aliases are not nested; The alias always points to the final object
---
> * 1) Dereference an alias (A name reference that is an alias)
> * Aliases are not nested, the alias always points to the final object
825c1023
< /* Who in turn points back to original target alias node */
---
> /* That in turn points back to original target alias node */
831,835c1029,1030
< else
< {
< AslError (ASL_ERROR, ASL_MSG_COMPILER_INTERNAL, Op,
< "Missing alias link");
< }
---
>
> /* Else - forward reference to alias, will be resolved later */
838c1033
< /* 1) Check for a reference to a resource descriptor */
---
> /* 2) Check for a reference to a resource descriptor */
840c1035
< else if ((Node->Type == ACPI_TYPE_LOCAL_RESOURCE_FIELD) ||
---
> if ((Node->Type == ACPI_TYPE_LOCAL_RESOURCE_FIELD) ||
913c1108
< /* 2) Check for a method invocation */
---
> /* 3) Check for a method invocation */
999c1194
< /* 3) Check for an ASL Field definition */
---
> /* 4) Check for an ASL Field definition */
1140c1335
< ACPI_FUNCTION_TRACE ("LkNamespaceLocateEnd");
---
> ACPI_FUNCTION_TRACE (LkNamespaceLocateEnd);