diff options
Diffstat (limited to 'source/components/namespace')
| -rw-r--r-- | source/components/namespace/nsaccess.c | 19 | ||||
| -rw-r--r-- | source/components/namespace/nsarguments.c | 22 | ||||
| -rw-r--r-- | source/components/namespace/nsinit.c | 14 | ||||
| -rw-r--r-- | source/components/namespace/nsnames.c | 9 | ||||
| -rw-r--r-- | source/components/namespace/nsprepkg.c | 2 | 
5 files changed, 57 insertions, 9 deletions
diff --git a/source/components/namespace/nsaccess.c b/source/components/namespace/nsaccess.c index 89d766b4bdd3..0ae1fbdd0875 100644 --- a/source/components/namespace/nsaccess.c +++ b/source/components/namespace/nsaccess.c @@ -410,6 +410,7 @@ AcpiNsLookup (  {      ACPI_STATUS             Status;      char                    *Path = Pathname; +    char                    *ExternalPath;      ACPI_NAMESPACE_NODE     *PrefixNode;      ACPI_NAMESPACE_NODE     *CurrentNode = NULL;      ACPI_NAMESPACE_NODE     *ThisNode = NULL; @@ -556,11 +557,21 @@ AcpiNsLookup (                  ThisNode = ThisNode->Parent;                  if (!ThisNode)                  { -                    /* Current scope has no parent scope */ +                    /* +                     * Current scope has no parent scope. Externalize +                     * the internal path for error message. +                     */ +                    Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Pathname, +                        NULL, &ExternalPath); +                    if (ACPI_SUCCESS (Status)) +                    { +                        ACPI_ERROR ((AE_INFO, +                            "%s: Path has too many parent prefixes (^)", +                            ExternalPath)); + +                        ACPI_FREE (ExternalPath); +                    } -                    ACPI_ERROR ((AE_INFO, -                        "%s: Path has too many parent prefixes (^) " -                        "- reached beyond root node", Pathname));                      return_ACPI_STATUS (AE_NOT_FOUND);                  }              } diff --git a/source/components/namespace/nsarguments.c b/source/components/namespace/nsarguments.c index 0412672aee85..0a7fa3d9de78 100644 --- a/source/components/namespace/nsarguments.c +++ b/source/components/namespace/nsarguments.c @@ -183,9 +183,14 @@ AcpiNsCheckArgumentTypes (      UINT32                      i; -    /* If not a predefined name, cannot typecheck args */ - -    if (!Info->Predefined) +    /* +     * If not a predefined name, cannot typecheck args, because +     * we have no idea what argument types are expected. +     * Also, ignore typecheck if warnings/errors if this method +     * has already been evaluated at least once -- in order +     * to suppress repetitive messages. +     */ +    if (!Info->Predefined || (Info->Node->Flags & ANOBJ_EVALUATED))      {          return;      } @@ -207,6 +212,10 @@ AcpiNsCheckArgumentTypes (                  "Found [%s], ACPI requires [%s]", (i + 1),                  AcpiUtGetTypeName (UserArgType),                  AcpiUtGetTypeName (ArgType))); + +            /* Prevent any additional typechecking for this method */ + +            Info->Node->Flags |= ANOBJ_EVALUATED;          }      }  } @@ -238,7 +247,7 @@ AcpiNsCheckAcpiCompliance (      UINT32                      RequiredParamCount; -    if (!Predefined) +    if (!Predefined || (Node->Flags & ANOBJ_EVALUATED))      {          return;      } @@ -332,6 +341,11 @@ AcpiNsCheckArgumentCount (      UINT32                      RequiredParamCount; +    if (Node->Flags & ANOBJ_EVALUATED) +    { +        return; +    } +      if (!Predefined)      {          /* diff --git a/source/components/namespace/nsinit.c b/source/components/namespace/nsinit.c index d4286bf80656..2786e24c926e 100644 --- a/source/components/namespace/nsinit.c +++ b/source/components/namespace/nsinit.c @@ -535,6 +535,20 @@ AcpiNsInitOneObject (          Info->PackageInit++;          Status = AcpiDsGetPackageArguments (ObjDesc); +        if (ACPI_FAILURE (Status)) +        { +            break; +        } + +        /* +         * Resolve all named references in package objects (and all +         * sub-packages). This action has been deferred until the entire +         * namespace has been loaded, in order to support external and +         * forward references from individual package elements (05/2017). +         */ +        Status = AcpiUtWalkPackageTree (ObjDesc, NULL, +            AcpiDsInitPackageElement, NULL); +        ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;          break;      default: diff --git a/source/components/namespace/nsnames.c b/source/components/namespace/nsnames.c index f68fbc1ed547..fb74c44c3395 100644 --- a/source/components/namespace/nsnames.c +++ b/source/components/namespace/nsnames.c @@ -208,8 +208,15 @@ AcpiNsGetPathnameLength (      ACPI_SIZE               Size; -    ACPI_FUNCTION_ENTRY (); +    /* Validate the Node */ +    if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED) +    { +        ACPI_ERROR ((AE_INFO, +            "Invalid/cached reference target node: %p, descriptor type %d", +            Node, ACPI_GET_DESCRIPTOR_TYPE (Node))); +        return (0); +    }      Size = AcpiNsBuildNormalizedPath (Node, NULL, 0, FALSE);      return (Size); diff --git a/source/components/namespace/nsprepkg.c b/source/components/namespace/nsprepkg.c index 848568173529..6ad53d61c263 100644 --- a/source/components/namespace/nsprepkg.c +++ b/source/components/namespace/nsprepkg.c @@ -722,6 +722,8 @@ AcpiNsCheckPackageList (          default: /* Should not get here, type was validated by caller */ +            ACPI_ERROR ((AE_INFO, "Invalid Package type: %X", +                Package->RetInfo.Type));              return (AE_AML_INTERNAL);          }  | 
