diff options
Diffstat (limited to 'source/compiler/aslload.c')
| -rw-r--r-- | source/compiler/aslload.c | 79 | 
1 files changed, 4 insertions, 75 deletions
diff --git a/source/compiler/aslload.c b/source/compiler/aslload.c index a57ba5e09bfd..95fea9cd0670 100644 --- a/source/compiler/aslload.c +++ b/source/compiler/aslload.c @@ -321,8 +321,7 @@ LdLoadFieldElements (                      return (Status);                  }                  else if (Status == AE_ALREADY_EXISTS && -                    (Node->Flags & ANOBJ_IS_EXTERNAL) && -                    Node->OwnerId != WalkState->OwnerId) +                    (Node->Flags & ANOBJ_IS_EXTERNAL))                  {                      Node->Type = (UINT8) ACPI_TYPE_LOCAL_REGION_FIELD;                  } @@ -474,7 +473,6 @@ LdNamespace1Begin (      ACPI_PARSE_OBJECT       *Arg;      UINT32                  i;      BOOLEAN                 ForceNewScope = FALSE; -    ACPI_OWNER_ID           OwnerId = 0;      const ACPI_OPCODE_INFO  *OpInfo;      ACPI_PARSE_OBJECT       *ParentOp; @@ -485,23 +483,6 @@ LdNamespace1Begin (      ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op %p [%s]\n",          Op, Op->Asl.ParseOpName)); -    if (Op->Asl.ParseOpcode == PARSEOP_DEFINITION_BLOCK) -    { -        /* -         * Allocate an OwnerId for this block. This helps identify the owners -         * of each namespace node. This is used in determining whether if -         * certain external declarations cause redefinition errors. -         */ -        Status = AcpiUtAllocateOwnerId (&OwnerId); -        WalkState->OwnerId = OwnerId; -        if (ACPI_FAILURE (Status)) -        { -            AslCoreSubsystemError (Op, Status, -                "Failure to allocate owner ID to this definition block.", FALSE); -            return_ACPI_STATUS (Status); -        } -    } -      /*       * We are only interested in opcodes that have an associated name       * (or multiple names) @@ -877,9 +858,7 @@ LdNamespace1Begin (              {                  /*                   * Allow one create on an object or segment that was -                 * previously declared External only if WalkState->OwnerId and -                 * Node->OwnerId are different (meaning that the current WalkState -                 * and the Node are in different tables). +                 * previously declared External                   */                  Node->Flags &= ~ANOBJ_IS_EXTERNAL;                  Node->Type = (UINT8) ObjectType; @@ -896,18 +875,6 @@ LdNamespace1Begin (                  }                  Status = AE_OK; - -                if (Node->OwnerId == WalkState->OwnerId && -                    !(Node->Flags & IMPLICIT_EXTERNAL)) -                { -                    AslDualParseOpError (ASL_WARNING, ASL_MSG_EXTERN_COLLISION, Op, -                        Op->Asl.ExternalName, ASL_MSG_EXTERN_FOUND_HERE, Node->Op, -                        Node->Op->Asl.ExternalName); -                } -                if (Node->Flags & IMPLICIT_EXTERNAL) -                { -                    Node->Flags &= ~IMPLICIT_EXTERNAL; -                }              }              else if (!(Node->Flags & ANOBJ_IS_EXTERNAL) &&                       (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL)) @@ -915,53 +882,15 @@ LdNamespace1Begin (                  /*                   * Allow externals in same scope as the definition of the                   * actual object. Similar to C. Allows multiple definition -                 * blocks that refer to each other in the same file. However, -                 * do not allow name declaration and an external declaration -                 * within the same table. This is considered a re-declaration. +                 * blocks that refer to each other in the same file.                   */                  Status = AE_OK; - -                if (Node->OwnerId == WalkState->OwnerId) -                { -                    AslDualParseOpError (ASL_WARNING, ASL_MSG_EXTERN_COLLISION, Op, -                        Op->Asl.ExternalName, ASL_MSG_EXTERN_FOUND_HERE, Node->Op, -                        Node->Op->Asl.ExternalName); -                }              }              else if ((Node->Flags & ANOBJ_IS_EXTERNAL) &&                       (Op->Asl.ParseOpcode == PARSEOP_EXTERNAL) &&                       (ObjectType == ACPI_TYPE_ANY))              { -                /* -                 * Allow update of externals of unknown type. -                 * In the case that multiple definition blocks are being -                 * parsed, updating the OwnerId allows enables subsequent calls -                 * of this method to understand which table the most recent -                 * external declaration was seen. Without this OwnerId update, -                 * code like the following is allowed to compile: -                 * -                 * DefinitionBlock("externtest.aml", "DSDT", 0x02, "Intel", "Many", 0x00000001) -                 * { -                 *     External(ERRS,methodobj) -                 *     Method (MAIN) -                 *     { -                 *         Name(NUM2, 0) -                 *         ERRS(1,2,3) -                 *     } -                 * } -                 * -                 * DefinitionBlock("externtest.aml", "SSDT", 0x02, "Intel", "Many", 0x00000001) -                 * { -                 *     if (0) -                 *     { -                 *         External(ERRS,methodobj) -                 *     } -                 *     Method (ERRS,3) -                 *     {} -                 * -                 * } -                 */ -                Node->OwnerId = WalkState->OwnerId; +                /* Allow update of externals of unknown type. */                  if (AcpiNsOpensScope (ActualObjectType))                  {  | 
