[ACPICA]
authorThomas Faber <thomas.faber@reactos.org>
Thu, 1 Jun 2017 10:54:48 +0000 (10:54 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Thu, 1 Jun 2017 10:54:48 +0000 (10:54 +0000)
- Update to version 20170531
CORE-13348 #resolve

svn path=/trunk/; revision=74729

53 files changed:
reactos/drivers/bus/acpi/acpica/dispatcher/dsargs.c
reactos/drivers/bus/acpi/acpica/dispatcher/dsdebug.c
reactos/drivers/bus/acpi/acpica/dispatcher/dsmethod.c
reactos/drivers/bus/acpi/acpica/dispatcher/dsopcode.c
reactos/drivers/bus/acpi/acpica/dispatcher/dspkginit.c [new file with mode: 0644]
reactos/drivers/bus/acpi/acpica/dispatcher/dsutils.c
reactos/drivers/bus/acpi/acpica/dispatcher/dswexec.c
reactos/drivers/bus/acpi/acpica/dispatcher/dswload.c
reactos/drivers/bus/acpi/acpica/dispatcher/dswload2.c
reactos/drivers/bus/acpi/acpica/events/evxfevnt.c
reactos/drivers/bus/acpi/acpica/executer/exdebug.c
reactos/drivers/bus/acpi/acpica/executer/exdump.c
reactos/drivers/bus/acpi/acpica/executer/exoparg1.c
reactos/drivers/bus/acpi/acpica/executer/exresolv.c
reactos/drivers/bus/acpi/acpica/include/acapps.h
reactos/drivers/bus/acpi/acpica/include/acdisasm.h
reactos/drivers/bus/acpi/acpica/include/acglobal.h
reactos/drivers/bus/acpi/acpica/include/aclocal.h
reactos/drivers/bus/acpi/acpica/include/acopcode.h
reactos/drivers/bus/acpi/acpica/include/acpixf.h
reactos/drivers/bus/acpi/acpica/include/acpredef.h
reactos/drivers/bus/acpi/acpica/include/acresrc.h
reactos/drivers/bus/acpi/acpica/include/acrestyp.h
reactos/drivers/bus/acpi/acpica/include/actbl1.h
reactos/drivers/bus/acpi/acpica/include/actbl2.h
reactos/drivers/bus/acpi/acpica/include/actbl3.h
reactos/drivers/bus/acpi/acpica/include/actypes.h
reactos/drivers/bus/acpi/acpica/include/acutils.h
reactos/drivers/bus/acpi/acpica/include/acuuid.h
reactos/drivers/bus/acpi/acpica/include/amlcode.h
reactos/drivers/bus/acpi/acpica/include/amlresrc.h
reactos/drivers/bus/acpi/acpica/include/platform/acgcc.h
reactos/drivers/bus/acpi/acpica/include/platform/acintel.h
reactos/drivers/bus/acpi/acpica/namespace/nsaccess.c
reactos/drivers/bus/acpi/acpica/namespace/nsnames.c
reactos/drivers/bus/acpi/acpica/namespace/nsutils.c
reactos/drivers/bus/acpi/acpica/namespace/nsxfeval.c
reactos/drivers/bus/acpi/acpica/parser/psobject.c
reactos/drivers/bus/acpi/acpica/parser/psopcode.c
reactos/drivers/bus/acpi/acpica/parser/psparse.c
reactos/drivers/bus/acpi/acpica/resources/rscalc.c
reactos/drivers/bus/acpi/acpica/resources/rsdump.c
reactos/drivers/bus/acpi/acpica/resources/rsdumpinfo.c
reactos/drivers/bus/acpi/acpica/resources/rsinfo.c
reactos/drivers/bus/acpi/acpica/resources/rsmisc.c
reactos/drivers/bus/acpi/acpica/resources/rsserial.c
reactos/drivers/bus/acpi/acpica/tables/tbfadt.c
reactos/drivers/bus/acpi/acpica/tables/tbutils.c
reactos/drivers/bus/acpi/acpica/utilities/utdecode.c
reactos/drivers/bus/acpi/acpica/utilities/utownerid.c
reactos/drivers/bus/acpi/acpica/utilities/utresdecode.c [new file with mode: 0644]
reactos/drivers/bus/acpi/acpica/utilities/utresrc.c
reactos/drivers/bus/acpi/acpica/utilities/utxfmutex.c

index 2d09460..714facf 100644 (file)
@@ -89,7 +89,7 @@ AcpiDsExecuteArguments (
     ACPI_WALK_STATE         *WalkState;
 
 
-    ACPI_FUNCTION_TRACE (DsExecuteArguments);
+    ACPI_FUNCTION_TRACE_PTR (DsExecuteArguments, AmlStart);
 
 
     /* Allocate a new parser op to be the root of the parsed tree */
@@ -366,7 +366,8 @@ AcpiDsGetPackageArguments (
         return_ACPI_STATUS (AE_AML_INTERNAL);
     }
 
-    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Package Arg Init\n"));
+    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Package Argument Init, AML Ptr: %p\n",
+        ObjDesc->Package.AmlStart));
 
     /* Execute the AML code for the TermArg arguments */
 
index d97a34a..c70f7d6 100644 (file)
@@ -212,6 +212,7 @@ AcpiDsDumpMethodStack (
                 Op->Common.Next = NULL;
 
 #ifdef ACPI_DISASSEMBLER
+                AcpiOsPrintf ("Failed at ");
                 AcpiDmDisassemble (NextWalkState, Op, ACPI_UINT32_MAX);
 #endif
                 Op->Common.Next = Next;
index b2f382b..c3dfa39 100644 (file)
@@ -225,6 +225,7 @@ AcpiDsMethodError (
     ACPI_WALK_STATE         *WalkState)
 {
     UINT32                  AmlOffset;
+    ACPI_NAME               Name = 0;
 
 
     ACPI_FUNCTION_ENTRY ();
@@ -253,9 +254,16 @@ AcpiDsMethodError (
         AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->Aml,
             WalkState->ParserState.AmlStart);
 
-        Status = AcpiGbl_ExceptionHandler (Status,
-            WalkState->MethodNode ?
-                WalkState->MethodNode->Name.Integer : 0,
+        if (WalkState->MethodNode)
+        {
+            Name = WalkState->MethodNode->Name.Integer;
+        }
+        else if (WalkState->DeferredNode)
+        {
+            Name = WalkState->DeferredNode->Name.Integer;
+        }
+
+        Status = AcpiGbl_ExceptionHandler (Status, Name,
             WalkState->Opcode, AmlOffset, NULL);
         AcpiExEnterInterpreter ();
     }
index ceb0dab..83b5cce 100644 (file)
@@ -245,10 +245,9 @@ AcpiDsInitBufferField (
         (8 * (UINT32) BufferDesc->Buffer.Length))
     {
         ACPI_ERROR ((AE_INFO,
-            "Field [%4.4s] at %u exceeds Buffer [%4.4s] size %u (bits)",
-            AcpiUtGetNodeName (ResultDesc),
-            BitOffset + BitCount,
-            AcpiUtGetNodeName (BufferDesc->Buffer.Node),
+            "Field [%4.4s] at bit offset/length %u/%u "
+            "exceeds size of target Buffer (%u bits)",
+            AcpiUtGetNodeName (ResultDesc), BitOffset, BitCount,
             8 * (UINT32) BufferDesc->Buffer.Length));
         Status = AE_AML_BUFFER_LIMIT;
         goto Cleanup;
diff --git a/reactos/drivers/bus/acpi/acpica/dispatcher/dspkginit.c b/reactos/drivers/bus/acpi/acpica/dispatcher/dspkginit.c
new file mode 100644 (file)
index 0000000..5763255
--- /dev/null
@@ -0,0 +1,530 @@
+/******************************************************************************
+ *
+ * Module Name: dspkginit - Completion of deferred package initialization
+ *
+ *****************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2017, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *    substantially similar to the "NO WARRANTY" disclaimer below
+ *    ("Disclaimer") and any redistribution must be conditioned upon
+ *    including a substantially similar Disclaimer requirement for further
+ *    binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ *    of any contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include "acpi.h"
+#include "accommon.h"
+#include "acnamesp.h"
+#include "amlcode.h"
+#include "acdispat.h"
+#include "acinterp.h"
+
+
+#define _COMPONENT          ACPI_NAMESPACE
+        ACPI_MODULE_NAME    ("dspkginit")
+
+
+/* Local prototypes */
+
+static void
+AcpiDsResolvePackageElement (
+    ACPI_OPERAND_OBJECT     **Element);
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDsBuildInternalPackageObj
+ *
+ * PARAMETERS:  WalkState       - Current walk state
+ *              Op              - Parser object to be translated
+ *              ElementCount    - Number of elements in the package - this is
+ *                                the NumElements argument to Package()
+ *              ObjDescPtr      - Where the ACPI internal object is returned
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Translate a parser Op package object to the equivalent
+ *              namespace object
+ *
+ * NOTE: The number of elements in the package will be always be the NumElements
+ * count, regardless of the number of elements in the package list. If
+ * NumElements is smaller, only that many package list elements are used.
+ * if NumElements is larger, the Package object is padded out with
+ * objects of type Uninitialized (as per ACPI spec.)
+ *
+ * Even though the ASL compilers do not allow NumElements to be smaller
+ * than the Package list length (for the fixed length package opcode), some
+ * BIOS code modifies the AML on the fly to adjust the NumElements, and
+ * this code compensates for that. This also provides compatibility with
+ * other AML interpreters.
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiDsBuildInternalPackageObj (
+    ACPI_WALK_STATE         *WalkState,
+    ACPI_PARSE_OBJECT       *Op,
+    UINT32                  ElementCount,
+    ACPI_OPERAND_OBJECT     **ObjDescPtr)
+{
+    ACPI_PARSE_OBJECT       *Arg;
+    ACPI_PARSE_OBJECT       *Parent;
+    ACPI_OPERAND_OBJECT     *ObjDesc = NULL;
+    ACPI_STATUS             Status = AE_OK;
+    UINT16                  Index;
+    UINT16                  ReferenceCount;
+    UINT32                  i;
+
+
+    ACPI_FUNCTION_TRACE (DsBuildInternalPackageObj);
+
+
+    /* Find the parent of a possibly nested package */
+
+    Parent = Op->Common.Parent;
+    while ((Parent->Common.AmlOpcode == AML_PACKAGE_OP) ||
+           (Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP))
+    {
+        Parent = Parent->Common.Parent;
+    }
+
+    /*
+     * If we are evaluating a Named package object of the form:
+     *      Name (xxxx, Package)
+     * the package object already exists, otherwise it must be created.
+     */
+    ObjDesc = *ObjDescPtr;
+    if (!ObjDesc)
+    {
+        ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_PACKAGE);
+        *ObjDescPtr = ObjDesc;
+        if (!ObjDesc)
+        {
+            return_ACPI_STATUS (AE_NO_MEMORY);
+        }
+
+printf ("****DS: BuildPkg - Create package object %p\n", ObjDesc);
+
+        ObjDesc->Package.Node = Parent->Common.Node;
+    }
+
+//
+printf ("****DS: BuildPkg, from DsEvalDataObjectOperands - Valid: %X, Pass %u, %p\n",
+    ObjDesc->Package.Flags & AOPOBJ_DATA_VALID,
+    WalkState->PassNumber, ObjDesc);
+
+// just in case
+if (ObjDesc->Package.Flags & AOPOBJ_DATA_VALID)
+{
+    return_ACPI_STATUS (AE_OK);
+}
+
+    /*
+     * Allocate the element array (array of pointers to the individual
+     * objects) based on the NumElements parameter. Add an extra pointer slot
+     * so that the list is always null terminated.
+     */
+    ObjDesc->Package.Elements = ACPI_ALLOCATE_ZEROED (
+        ((ACPI_SIZE) ElementCount + 1) * sizeof (void *));
+
+    if (!ObjDesc->Package.Elements)
+    {
+        AcpiUtDeleteObjectDesc (ObjDesc);
+        return_ACPI_STATUS (AE_NO_MEMORY);
+    }
+
+    ObjDesc->Package.Count = ElementCount;
+
+    /*
+     * Initialize the elements of the package, up to the NumElements count.
+     * Package is automatically padded with uninitialized (NULL) elements
+     * if NumElements is greater than the package list length. Likewise,
+     * Package is truncated if NumElements is less than the list length.
+     */
+    Arg = Op->Common.Value.Arg;
+    Arg = Arg->Common.Next;
+
+    if (Arg)
+    {
+        printf ("****DS: Mark package evaluated\n");
+        ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
+    }
+
+    for (i = 0; Arg && (i < ElementCount); i++)
+    {
+printf ("****DS: Eval package element\n");
+
+        if (Arg->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP)
+        {
+// Maybe this is just temp code:
+/*
+if (!Arg->Common.Node)
+{
+    printf ("****DS: No attached NS node\n");
+    return_ACPI_STATUS (AE_AML_INTERNAL);
+}
+else  */         if (Arg->Common.Node->Type == ACPI_TYPE_METHOD)
+            {
+
+                /*
+                 * A method reference "looks" to the parser to be a method
+                 * invocation, so we special case it here
+                 */
+                Arg->Common.AmlOpcode = AML_INT_NAMEPATH_OP;
+                Status = AcpiDsBuildInternalObject (
+                    WalkState, Arg, &ObjDesc->Package.Elements[i]);
+            }
+            else
+            {
+                /* This package element is already built, just get it */
+
+                ObjDesc->Package.Elements[i] =
+                    ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node);
+            }
+        }
+        else
+        {
+            Status = AcpiDsBuildInternalObject (
+                WalkState, Arg, &ObjDesc->Package.Elements[i]);
+            if (Status == AE_NOT_FOUND)
+            {
+// remove or fix
+                ACPI_ERROR ((AE_INFO, "%-48s", "****DS namepath not found"));
+            }
+
+            /*
+             * Initialize this package element. This function handles the
+             * resolution of named references within the package.
+             */
+            AcpiDsInitPackageElement (0, ObjDesc->Package.Elements[i],
+                NULL, &ObjDesc->Package.Elements[i]);
+        }
+
+        if (*ObjDescPtr)
+        {
+            /* Existing package, get existing reference count */
+
+            ReferenceCount = (*ObjDescPtr)->Common.ReferenceCount;
+            if (ReferenceCount > 1)
+            {
+                /* Make new element ref count match original ref count */
+
+                for (Index = 0; Index < (ReferenceCount - 1); Index++)
+                {
+                    AcpiUtAddReference ((ObjDesc->Package.Elements[i]));
+                }
+            }
+        }
+
+        Arg = Arg->Common.Next;
+    }
+
+    /* Check for match between NumElements and actual length of PackageList */
+
+    if (Arg)
+    {
+        //ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
+
+
+        /*
+         * NumElements was exhausted, but there are remaining elements in the
+         * PackageList. Truncate the package to NumElements.
+         *
+         * Note: technically, this is an error, from ACPI spec: "It is an error
+         * for NumElements to be less than the number of elements in the
+         * PackageList". However, we just print a message and
+         * no exception is returned. This provides Windows compatibility. Some
+         * BIOSs will alter the NumElements on the fly, creating this type
+         * of ill-formed package object.
+         */
+        while (Arg)
+        {
+            /*
+             * We must delete any package elements that were created earlier
+             * and are not going to be used because of the package truncation.
+             */
+            if (Arg->Common.Node)
+            {
+                AcpiUtRemoveReference (
+                    ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Arg->Common.Node));
+                Arg->Common.Node = NULL;
+            }
+
+            /* Find out how many elements there really are */
+
+            i++;
+            Arg = Arg->Common.Next;
+        }
+
+        ACPI_INFO ((
+            "Actual Package length (%u) is larger than "
+            "NumElements field (%u), truncated",
+            i, ElementCount));
+    }
+    else if (i < ElementCount)
+    {
+        /*
+         * Arg list (elements) was exhausted, but we did not reach
+         * NumElements count.
+         *
+         * Note: this is not an error, the package is padded out
+         * with NULLs.
+         */
+        ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+            "Package List length (%u) smaller than NumElements "
+            "count (%u), padded with null elements\n",
+            i, ElementCount));
+    }
+
+    Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjDesc);
+    return_ACPI_STATUS (Status);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDsInitPackageElement
+ *
+ * PARAMETERS:  ACPI_PKG_CALLBACK
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Resolve a named reference element within a package object
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiDsInitPackageElement (
+    UINT8                   ObjectType,
+    ACPI_OPERAND_OBJECT     *SourceObject,
+    ACPI_GENERIC_STATE      *State,
+    void                    *Context)
+{
+    ACPI_OPERAND_OBJECT     **ElementPtr;
+
+
+    if (!SourceObject)
+    {
+        return (AE_OK);
+    }
+
+    /*
+     * The following code is a bit of a hack to workaround a (current)
+     * limitation of the ACPI_PKG_CALLBACK interface. We need a pointer
+     * to the location within the element array because a new object
+     * may be created and stored there.
+     */
+    if (Context)
+    {
+        /* A direct call was made to this function */
+
+        ElementPtr = (ACPI_OPERAND_OBJECT **) Context;
+    }
+    else
+    {
+        /* Call came from AcpiUtWalkPackageTree */
+
+        ElementPtr = State->Pkg.ThisTargetObj;
+    }
+
+    /* We are only interested in reference objects/elements */
+
+    if (SourceObject->Common.Type == ACPI_TYPE_LOCAL_REFERENCE)
+    {
+        /* Resolve the (named) reference to a namespace node */
+
+        AcpiDsResolvePackageElement (ElementPtr);
+    }
+    else if (SourceObject->Common.Type == ACPI_TYPE_PACKAGE)
+    {
+        SourceObject->Package.Flags |= AOPOBJ_DATA_VALID;
+    }
+
+    return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDsResolvePackageElement
+ *
+ * PARAMETERS:  ElementPtr          - Pointer to a reference object
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Resolve a package element that is a reference to a named
+ *              object.
+ *
+ ******************************************************************************/
+
+static void
+AcpiDsResolvePackageElement (
+    ACPI_OPERAND_OBJECT     **ElementPtr)
+{
+    ACPI_STATUS             Status;
+    ACPI_GENERIC_STATE      ScopeInfo;
+    ACPI_OPERAND_OBJECT     *Element = *ElementPtr;
+    ACPI_NAMESPACE_NODE     *ResolvedNode;
+    ACPI_OBJECT_TYPE        Type;
+
+
+    ACPI_FUNCTION_TRACE (DsResolvePackageElement);
+
+
+    /* Check if reference element is already resolved */
+
+    if (Element->Reference.Resolved)
+    {
+        return_VOID;
+    }
+
+    /* Element must be a reference object of correct type */
+
+    ScopeInfo.Scope.Node = Element->Reference.Node; /* Prefix node */
+
+    Status = AcpiNsLookup (&ScopeInfo,
+        (char *) Element->Reference.Aml,            /* Pointer to AML path */
+        ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS2,
+        ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
+        NULL, &ResolvedNode);
+
+    if (ACPI_FAILURE (Status))
+    {
+        ACPI_EXCEPTION ((AE_INFO, Status,
+            "Could not resolve package element"));
+        return_VOID;
+    }
+
+    else if (ResolvedNode->Type == ACPI_TYPE_ANY)
+    {
+        /* Named reference not resolved, return a NULL package element */
+
+        ACPI_ERROR ((AE_INFO,
+            "Could not resolve package element [%4.4s] in [%4.4s]",
+            ResolvedNode->Name.Ascii, ScopeInfo.Scope.Node->Name.Ascii));
+        *ElementPtr = NULL;
+        return_VOID;
+    }
+
+    else if (ResolvedNode->Flags & ANOBJ_TEMPORARY)
+    {
+        /*
+         * A temporary node found here indicates that the reference is
+         * to a node that was created within this method. We are not
+         * going to allow it (especially if the package is returned
+         * from the method) -- the temporary node will be deleted out
+         * from under the method. (05/2017).
+         */
+        ACPI_ERROR ((AE_INFO,
+            "Package element is a temporary name [%4.4s], "
+            "returning NULL element",
+            ResolvedNode->Name.Ascii));
+        *ElementPtr = NULL;
+        return_VOID;
+    }
+
+    /* Update the reference object */
+
+    Element->Reference.Resolved = TRUE;
+    Element->Reference.Node = ResolvedNode;
+    Type = Element->Reference.Node->Type;
+
+    /*
+     * Attempt to resolve the node to a value before we insert it into
+     * the package. If this is a reference to a common data type,
+     * resolve it immediately. According to the ACPI spec, package
+     * elements can only be "data objects" or method references.
+     * Attempt to resolve to an Integer, Buffer, String or Package.
+     * If cannot, return the named reference (for things like Devices,
+     * Methods, etc.) Buffer Fields and Fields will resolve to simple
+     * objects (int/buf/str/pkg).
+     *
+     * NOTE: References to things like Devices, Methods, Mutexes, etc.
+     * will remain as named references. This behavior is not described
+     * in the ACPI spec, but it appears to be an oversight.
+     */
+    Status = AcpiExResolveNodeToValue (&ResolvedNode, NULL);
+    if (ACPI_FAILURE (Status))
+    {
+        return_VOID;
+    }
+
+#if 0
+    /*
+     * Special handling for Alias objects. We need to setup the type
+     * and the Op->Common.Node to point to the Alias target. Note,
+     * Alias has at most one level of indirection internally.
+     */
+    Type = Op->Common.Node->Type;
+    if (Type == ACPI_TYPE_LOCAL_ALIAS)
+    {
+        Type = ObjDesc->Common.Type;
+        Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
+            Op->Common.Node->Object);
+    }
+#endif
+
+    switch (Type)
+    {
+    /*
+     * These object types are a result of named references, so we will
+     * leave them as reference objects. In other words, these types
+     * have no intrinsic "value".
+     */
+    case ACPI_TYPE_DEVICE:
+    case ACPI_TYPE_THERMAL:
+
+        /* TBD: This may not be necesssary */
+
+        AcpiUtAddReference (ResolvedNode->Object);
+        break;
+
+    case ACPI_TYPE_MUTEX:
+    case ACPI_TYPE_METHOD:
+    case ACPI_TYPE_POWER:
+    case ACPI_TYPE_PROCESSOR:
+    case ACPI_TYPE_EVENT:
+    case ACPI_TYPE_REGION:
+
+        break;
+
+    default:
+        /*
+         * For all other types - the node was resolved to an actual
+         * operand object with a value, return the object
+         */
+        *ElementPtr = (ACPI_OPERAND_OBJECT *) ResolvedNode;
+        break;
+    }
+
+    return_VOID;
+}
index f44fb9f..1b661a0 100644 (file)
@@ -683,12 +683,6 @@ AcpiDsCreateOperand (
         if ((OpInfo->Flags & AML_HAS_RETVAL) ||
             (Arg->Common.Flags & ACPI_PARSEOP_IN_STACK))
         {
-            ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
-                "Argument previously created, already stacked\n"));
-
-            AcpiDbDisplayArgumentObject (
-                WalkState->Operands [WalkState->NumOperands - 1], WalkState);
-
             /*
              * Use value that was already previously returned
              * by the evaluation of this argument
index 7d7022e..a5b5db8 100644 (file)
@@ -615,7 +615,8 @@ AcpiDsExecEndOp (
         case AML_TYPE_CREATE_OBJECT:
 
             ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
-                "Executing CreateObject (Buffer/Package) Op=%p\n", Op));
+                "Executing CreateObject (Buffer/Package) Op=%p AMLPtr=%p\n",
+                Op, Op->Named.Data));
 
             switch (Op->Common.Parent->Common.AmlOpcode)
             {
index 72124fc..e8fea37 100644 (file)
@@ -410,7 +410,7 @@ AcpiDsLoad1BeginOp (
     /* Initialize the op */
 
 #if (defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY))
-    Op->Named.Path = ACPI_CAST_PTR (UINT8, Path);
+    Op->Named.Path = Path;
 #endif
 
     if (Node)
@@ -450,6 +450,10 @@ AcpiDsLoad1EndOp (
     ACPI_OBJECT_TYPE        ObjectType;
     ACPI_STATUS             Status = AE_OK;
 
+#ifdef ACPI_ASL_COMPILER
+    UINT8                   ParamCount;
+#endif
+
 
     ACPI_FUNCTION_TRACE (DsLoad1EndOp);
 
@@ -534,6 +538,37 @@ AcpiDsLoad1EndOp (
         }
     }
 
+#ifdef ACPI_ASL_COMPILER
+    /*
+     * For external opcode, get the object type from the argument and
+     * get the parameter count from the argument's next.
+     */
+    if (AcpiGbl_DisasmFlag &&
+        Op->Common.Node &&
+        Op->Common.AmlOpcode == AML_EXTERNAL_OP)
+    {
+        /*
+         * Note, if this external is not a method
+         * Op->Common.Value.Arg->Common.Next->Common.Value.Integer == 0
+         * Therefore, ParamCount will be 0.
+         */
+        ParamCount = (UINT8) Op->Common.Value.Arg->Common.Next->Common.Value.Integer;
+        ObjectType = (UINT8) Op->Common.Value.Arg->Common.Value.Integer;
+        Op->Common.Node->Flags |= ANOBJ_IS_EXTERNAL;
+        Op->Common.Node->Type = (UINT8) ObjectType;
+
+        AcpiDmCreateSubobjectForExternal ((UINT8)ObjectType,
+            &Op->Common.Node, ParamCount);
+
+        /*
+         * Add the external to the external list because we may be
+         * emitting code based off of the items within the external list.
+         */
+        AcpiDmAddOpToExternalList (Op, Op->Named.Path, (UINT8)ObjectType, ParamCount,
+           ACPI_EXT_ORIGIN_FROM_OPCODE | ACPI_EXT_RESOLVED_REFERENCE);
+    }
+#endif
+
     /*
      * If we are executing a method, do not create any namespace objects
      * during the load phase, only during execution.
@@ -581,6 +616,7 @@ AcpiDsLoad1EndOp (
     /* Pop the scope stack (only if loading a table) */
 
     if (!WalkState->MethodNode &&
+        Op->Common.AmlOpcode != AML_EXTERNAL_OP &&
         AcpiNsOpensScope (ObjectType))
     {
         ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s): Popping scope for Op %p\n",
index 4985f20..c9a142f 100644 (file)
@@ -320,6 +320,24 @@ AcpiDsLoad2BeginOp (
             }
         }
 
+#ifdef ACPI_ASL_COMPILER
+
+        /*
+         * Do not open a scope for AML_EXTERNAL_OP
+         * AcpiNsLookup can open a new scope based on the object type
+         * of this op. AML_EXTERNAL_OP is a declaration rather than a
+         * definition. In the case that this external is a method object,
+         * AcpiNsLookup will open a new scope. However, an AML_EXTERNAL_OP
+         * associated with the ACPI_TYPE_METHOD is a declaration, rather than
+         * a definition. Flags is set to avoid opening a scope for any
+         * AML_EXTERNAL_OP.
+         */
+        if (WalkState->Opcode == AML_EXTERNAL_OP)
+        {
+            Flags |= ACPI_NS_DONT_OPEN_SCOPE;
+        }
+#endif
+
         /* Add new entry or lookup existing entry */
 
         Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
index 15b8007..7ced65c 100644 (file)
@@ -198,6 +198,13 @@ AcpiEnableEvent (
     ACPI_FUNCTION_TRACE (AcpiEnableEvent);
 
 
+    /* If Hardware Reduced flag is set, there are no fixed events */
+
+    if (AcpiGbl_ReducedHardware)
+    {
+        return_ACPI_STATUS (AE_OK);
+    }
+
     /* Decode the Fixed Event */
 
     if (Event > ACPI_EVENT_MAX)
@@ -264,6 +271,13 @@ AcpiDisableEvent (
     ACPI_FUNCTION_TRACE (AcpiDisableEvent);
 
 
+    /* If Hardware Reduced flag is set, there are no fixed events */
+
+    if (AcpiGbl_ReducedHardware)
+    {
+        return_ACPI_STATUS (AE_OK);
+    }
+
     /* Decode the Fixed Event */
 
     if (Event > ACPI_EVENT_MAX)
@@ -325,6 +339,13 @@ AcpiClearEvent (
     ACPI_FUNCTION_TRACE (AcpiClearEvent);
 
 
+    /* If Hardware Reduced flag is set, there are no fixed events */
+
+    if (AcpiGbl_ReducedHardware)
+    {
+        return_ACPI_STATUS (AE_OK);
+    }
+
     /* Decode the Fixed Event */
 
     if (Event > ACPI_EVENT_MAX)
index 635cad5..ea79566 100644 (file)
@@ -129,11 +129,11 @@ AcpiExDoDebugObject (
             Timer = ((UINT32) AcpiOsGetTimer () / 10);
             Timer &= 0x03FFFFFF;
 
-            AcpiOsPrintf ("[ACPI Debug T=0x%8.8X] %*s", Timer, Level, " ");
+            AcpiOsPrintf ("ACPI Debug: T=0x%8.8X %*s", Timer, Level, " ");
         }
         else
         {
-            AcpiOsPrintf ("[ACPI Debug] %*s", Level, " ");
+            AcpiOsPrintf ("ACPI Debug: %*s", Level, " ");
         }
     }
 
index 0120909..d869746 100644 (file)
@@ -667,12 +667,13 @@ AcpiExDumpOperand (
 
     if (Depth > 0)
     {
-        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%*s[%u] %p ",
-            Depth, " ", Depth, ObjDesc));
+        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%*s[%u] %p Refs=%u ",
+            Depth, " ", Depth, ObjDesc, ObjDesc->Common.ReferenceCount));
     }
     else
     {
-        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", ObjDesc));
+        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p Refs=%u ",
+            ObjDesc, ObjDesc->Common.ReferenceCount));
     }
 
     /* Decode object type */
@@ -710,8 +711,10 @@ AcpiExDumpOperand (
 
         case ACPI_REFCLASS_NAME:
 
-            AcpiOsPrintf ("- [%4.4s]\n",
-                ObjDesc->Reference.Node->Name.Ascii);
+            AcpiUtRepairName (ObjDesc->Reference.Node->Name.Ascii);
+            AcpiOsPrintf ("- [%4.4s] (Node %p)\n",
+                ObjDesc->Reference.Node->Name.Ascii,
+                ObjDesc->Reference.Node);
             break;
 
         case ACPI_REFCLASS_ARG:
@@ -1050,12 +1053,15 @@ AcpiExDumpReferenceObj (
             &RetBuf, TRUE);
         if (ACPI_FAILURE (Status))
         {
-            AcpiOsPrintf (" Could not convert name to pathname\n");
+            AcpiOsPrintf (" Could not convert name to pathname: %s\n",
+                AcpiFormatException (Status));
         }
         else
         {
-           AcpiOsPrintf ("%s\n", (char *) RetBuf.Pointer);
-           ACPI_FREE (RetBuf.Pointer);
+            AcpiOsPrintf ("%s: %s\n",
+                AcpiUtGetTypeName (ObjDesc->Reference.Node->Type),
+                (char *) RetBuf.Pointer);
+            ACPI_FREE (RetBuf.Pointer);
         }
     }
     else if (ObjDesc->Reference.Object)
@@ -1173,9 +1179,8 @@ AcpiExDumpPackageObj (
 
     case ACPI_TYPE_LOCAL_REFERENCE:
 
-        AcpiOsPrintf ("[Object Reference] Type [%s] %2.2X",
-            AcpiUtGetReferenceName (ObjDesc),
-            ObjDesc->Reference.Class);
+        AcpiOsPrintf ("[Object Reference] Class [%s]",
+            AcpiUtGetReferenceName (ObjDesc));
         AcpiExDumpReferenceObj (ObjDesc);
         break;
 
index b3323db..5c6b942 100644 (file)
@@ -851,7 +851,7 @@ AcpiExOpcode_1A_0T_1R (
         if (ACPI_GET_DESCRIPTOR_TYPE (Operand[0]) == ACPI_DESC_TYPE_NAMED)
         {
             TempDesc = AcpiNsGetAttachedObject (
-                           (ACPI_NAMESPACE_NODE *) Operand[0]);
+                (ACPI_NAMESPACE_NODE *) Operand[0]);
             if (TempDesc &&
                  ((TempDesc->Common.Type == ACPI_TYPE_STRING) ||
                   (TempDesc->Common.Type == ACPI_TYPE_LOCAL_REFERENCE)))
@@ -964,11 +964,27 @@ AcpiExOpcode_1A_0T_1R (
              * This is a DerefOf (ObjectReference)
              * Get the actual object from the Node (This is the dereference).
              * This case may only happen when a LocalX or ArgX is
-             * dereferenced above.
+             * dereferenced above, or for references to device and
+             * thermal objects.
              */
-            ReturnDesc = AcpiNsGetAttachedObject (
-                (ACPI_NAMESPACE_NODE *) Operand[0]);
-            AcpiUtAddReference (ReturnDesc);
+            switch (((ACPI_NAMESPACE_NODE *) Operand[0])->Type)
+            {
+            case ACPI_TYPE_DEVICE:
+            case ACPI_TYPE_THERMAL:
+
+                /* These types have no node subobject, return the NS node */
+
+                ReturnDesc = Operand[0];
+                break;
+
+            default:
+                /* For most types, get the object attached to the node */
+
+                ReturnDesc = AcpiNsGetAttachedObject (
+                    (ACPI_NAMESPACE_NODE *) Operand[0]);
+                AcpiUtAddReference (ReturnDesc);
+                break;
+            }
         }
         else
         {
index bbef5c1..fad97d1 100644 (file)
@@ -385,12 +385,26 @@ AcpiExResolveMultiple (
                 (ACPI_NAMESPACE_NODE *) ObjDesc);
         }
 
-        if (!ObjDesc)
+        switch (Type)
         {
-            ACPI_ERROR ((AE_INFO,
-                "[%4.4s] Node is unresolved or uninitialized",
-                AcpiUtGetNodeName (Node)));
-            return_ACPI_STATUS (AE_AML_UNINITIALIZED_NODE);
+        case ACPI_TYPE_DEVICE:
+        case ACPI_TYPE_THERMAL:
+
+            /* These types have no attached subobject */
+            break;
+
+        default:
+
+            /* All other types require a subobject */
+
+            if (!ObjDesc)
+            {
+                ACPI_ERROR ((AE_INFO,
+                    "[%4.4s] Node is unresolved or uninitialized",
+                    AcpiUtGetNodeName (Node)));
+                return_ACPI_STATUS (AE_AML_UNINITIALIZED_NODE);
+            }
+            break;
         }
         break;
 
index ebc1cfb..38afbf3 100644 (file)
@@ -186,7 +186,7 @@ AcpiDmFinishNamespaceLoad (
     ACPI_OWNER_ID           OwnerId);
 
 void
-AcpiDmConvertResourceIndexes (
+AcpiDmConvertParseObjects (
     ACPI_PARSE_OBJECT       *ParseTreeRoot,
     ACPI_NAMESPACE_NODE     *NamespaceRoot);
 
index b9b03d3..8d997c7 100644 (file)
@@ -99,6 +99,11 @@ typedef enum
     ACPI_DMT_FLAGS1,
     ACPI_DMT_FLAGS2,
     ACPI_DMT_FLAGS4,
+    ACPI_DMT_FLAGS4_0,
+    ACPI_DMT_FLAGS4_4,
+    ACPI_DMT_FLAGS4_8,
+    ACPI_DMT_FLAGS4_12,
+    ACPI_DMT_FLAGS16_16,
     ACPI_DMT_UINT8,
     ACPI_DMT_UINT16,
     ACPI_DMT_UINT24,
@@ -149,6 +154,7 @@ typedef enum
     ACPI_DMT_HEST,
     ACPI_DMT_HESTNTFY,
     ACPI_DMT_HESTNTYP,
+    ACPI_DMT_HMAT,
     ACPI_DMT_IORTMEM,
     ACPI_DMT_IVRS,
     ACPI_DMT_LPIT,
@@ -156,6 +162,7 @@ typedef enum
     ACPI_DMT_NFIT,
     ACPI_DMT_PCCT,
     ACPI_DMT_PMTT,
+    ACPI_DMT_PPTT,
     ACPI_DMT_SLIC,
     ACPI_DMT_SRAT,
 
@@ -304,12 +311,22 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHest7[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHest8[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHest9[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHest10[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHest11[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHestNotify[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHestBank[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHpet[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoLpitHdr[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoLpit0[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoLpit1[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHmat[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHmat0[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHmat1[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHmat1a[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHmat1b[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHmat1c[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHmat2[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHmat2a[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoHmatHdr[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoIort[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoIort0[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoIort0a[];
@@ -387,6 +404,13 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcctHdr[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcct0[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcct1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcct2[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcct3[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcct4[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPptt0[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPptt0a[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPptt1[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPptt2[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPpttHdr[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoRasf[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoRsdp1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoRsdp2[];
@@ -405,6 +429,7 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSrat0[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSrat1[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSrat2[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSrat3[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoSrat4[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoStao[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoStaoStr[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoTcpaHdr[];
@@ -421,6 +446,7 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoWddt[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoWdrt[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoWpbt[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoWpbt0[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoWsmt[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoXenv[];
 
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoGeneric[][2];
@@ -532,6 +558,10 @@ void
 AcpiDmDumpHest (
     ACPI_TABLE_HEADER       *Table);
 
+void
+AcpiDmDumpHmat (
+    ACPI_TABLE_HEADER       *Table);
+
 void
 AcpiDmDumpIort (
     ACPI_TABLE_HEADER       *Table);
@@ -576,6 +606,10 @@ void
 AcpiDmDumpPmtt (
     ACPI_TABLE_HEADER       *Table);
 
+void
+AcpiDmDumpPptt (
+    ACPI_TABLE_HEADER       *Table);
+
 UINT32
 AcpiDmDumpRsdp (
     ACPI_TABLE_HEADER       *Table);
@@ -651,10 +685,6 @@ AcpiDmDisassembleOneOp (
     ACPI_OP_WALK_INFO       *Info,
     ACPI_PARSE_OBJECT       *Op);
 
-BOOLEAN
-AcpiDmIsTempName (
-    ACPI_PARSE_OBJECT       *Op);
-
 UINT32
 AcpiDmListType (
     ACPI_PARSE_OBJECT       *Op);
@@ -779,6 +809,12 @@ AcpiDmAddOpToExternalList (
     UINT32                  Value,
     UINT16                  Flags);
 
+void
+AcpiDmCreateSubobjectForExternal (
+    UINT8                   Type,
+    ACPI_NAMESPACE_NODE     **Node,
+    UINT32                  Value);
+
 void
 AcpiDmAddNodeToExternalList (
     ACPI_NAMESPACE_NODE     *Node,
@@ -787,11 +823,17 @@ AcpiDmAddNodeToExternalList (
     UINT16                  Flags);
 
 void
-AcpiDmAddExternalsToNamespace (
+AcpiDmAddExternalListToNamespace (
     void);
 
+void
+AcpiDmAddOneExternalToNamespace (
+    char                    *Path,
+    UINT8                   Type,
+    UINT32                  Value);
+
 UINT32
-AcpiDmGetExternalMethodCount (
+AcpiDmGetUnresolvedExternalMethodCount (
     void);
 
 void
@@ -815,6 +857,11 @@ void
 AcpiDmGetExternalsFromFile (
     void);
 
+void
+AcpiDmMarkExternalConflict (
+    ACPI_NAMESPACE_NODE     *Node);
+
+
 /*
  * dmresrc
  */
@@ -939,6 +986,41 @@ AcpiDmGpioDescriptor (
     UINT32                  Length,
     UINT32                  Level);
 
+void
+AcpiDmPinFunctionDescriptor (
+    ACPI_OP_WALK_INFO       *Info,
+    AML_RESOURCE            *Resource,
+    UINT32                  Length,
+    UINT32                  Level);
+
+void
+AcpiDmPinConfigDescriptor (
+    ACPI_OP_WALK_INFO       *Info,
+    AML_RESOURCE            *Resource,
+    UINT32                  Length,
+    UINT32                  Level);
+
+void
+AcpiDmPinGroupDescriptor (
+    ACPI_OP_WALK_INFO       *Info,
+    AML_RESOURCE            *Resource,
+    UINT32                  Length,
+    UINT32                  Level);
+
+void
+AcpiDmPinGroupFunctionDescriptor (
+    ACPI_OP_WALK_INFO       *Info,
+    AML_RESOURCE            *Resource,
+    UINT32                  Length,
+    UINT32                  Level);
+
+void
+AcpiDmPinGroupConfigDescriptor (
+    ACPI_OP_WALK_INFO       *Info,
+    AML_RESOURCE            *Resource,
+    UINT32                  Length,
+    UINT32                  Level);
+
 void
 AcpiDmSerialBusDescriptor (
     ACPI_OP_WALK_INFO       *Info,
@@ -1060,6 +1142,17 @@ AcpiDmCloseOperator (
     ACPI_PARSE_OBJECT       *Op);
 
 
+/*
+ * dmtables
+ */
+ACPI_STATUS
+AcpiDmProcessSwitch (
+    ACPI_PARSE_OBJECT       *Op);
+
+void
+AcpiDmClearTempList(
+    void);
+
 /*
  * dmtables
  */
index 3dfbe42..aa66f90 100644 (file)
@@ -319,6 +319,7 @@ ACPI_INIT_GLOBAL (BOOLEAN,              AcpiGbl_ForceAmlDisassembly, FALSE);
 ACPI_INIT_GLOBAL (BOOLEAN,              AcpiGbl_DmOpt_Verbose, TRUE);
 ACPI_INIT_GLOBAL (BOOLEAN,              AcpiGbl_DmEmitExternalOpcodes, FALSE);
 ACPI_INIT_GLOBAL (BOOLEAN,              AcpiGbl_DoDisassemblerOptimizations, TRUE);
+ACPI_INIT_GLOBAL (ACPI_PARSE_OBJECT_LIST,   *AcpiGbl_TempListHead, NULL);
 
 ACPI_GLOBAL (BOOLEAN,                   AcpiGbl_DmOpt_Disasm);
 ACPI_GLOBAL (BOOLEAN,                   AcpiGbl_DmOpt_Listing);
@@ -372,6 +373,8 @@ ACPI_GLOBAL (const char,                *AcpiGbl_PldVerticalPositionList[]);
 ACPI_GLOBAL (const char,                *AcpiGbl_PldHorizontalPositionList[]);
 ACPI_GLOBAL (const char,                *AcpiGbl_PldShapeList[]);
 
+ACPI_INIT_GLOBAL (BOOLEAN,              AcpiGbl_DisasmFlag, FALSE);
+
 #endif
 
 /*
index 47c5f8f..21019ed 100644 (file)
@@ -1028,7 +1028,7 @@ typedef struct acpi_parse_obj_common
 typedef struct acpi_parse_obj_named
 {
     ACPI_PARSE_COMMON
-    UINT8                           *Path;
+    char                            *Path;
     UINT8                           *Data;          /* AML body or bytelist data */
     UINT32                          Length;         /* AML length */
     UINT32                          Name;           /* 4-byte name or zero if no name */
@@ -1336,8 +1336,13 @@ typedef struct acpi_port_info
 #define ACPI_RESOURCE_NAME_ADDRESS64            0x8A
 #define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64   0x8B
 #define ACPI_RESOURCE_NAME_GPIO                 0x8C
+#define ACPI_RESOURCE_NAME_PIN_FUNCTION         0x8D
 #define ACPI_RESOURCE_NAME_SERIAL_BUS           0x8E
-#define ACPI_RESOURCE_NAME_LARGE_MAX            0x8E
+#define ACPI_RESOURCE_NAME_PIN_CONFIG           0x8F
+#define ACPI_RESOURCE_NAME_PIN_GROUP            0x90
+#define ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION   0x91
+#define ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG     0x92
+#define ACPI_RESOURCE_NAME_LARGE_MAX            0x92
 
 
 /*****************************************************************************
@@ -1374,6 +1379,7 @@ typedef struct acpi_external_list
 #define ACPI_EXT_INTERNAL_PATH_ALLOCATED    0x04    /* Deallocate internal path on completion */
 #define ACPI_EXT_EXTERNAL_EMITTED           0x08    /* External() statement has been emitted */
 #define ACPI_EXT_ORIGIN_FROM_OPCODE         0x10    /* External came from a External() opcode */
+#define ACPI_EXT_CONFLICTING_DECLARATION    0x20    /* External has a conflicting declaration within AML */
 
 
 typedef struct acpi_external_file
@@ -1384,6 +1390,13 @@ typedef struct acpi_external_file
 } ACPI_EXTERNAL_FILE;
 
 
+typedef struct acpi_parse_object_list
+{
+    ACPI_PARSE_OBJECT               *Op;
+    struct acpi_parse_object_list   *Next;
+
+} ACPI_PARSE_OBJECT_LIST;
+
 /*****************************************************************************
  *
  * Debugger
index 336d146..ad8de5f 100644 (file)
 #define ARGP_DWORD_OP                   ARGP_LIST1 (ARGP_DWORDDATA)
 #define ARGP_ELSE_OP                    ARGP_LIST2 (ARGP_PKGLENGTH,  ARGP_TERMLIST)
 #define ARGP_EVENT_OP                   ARGP_LIST1 (ARGP_NAME)
-#define ARGP_EXTERNAL_OP                ARGP_LIST3 (ARGP_NAMESTRING, ARGP_BYTEDATA,      ARGP_BYTEDATA)
+#define ARGP_EXTERNAL_OP                ARGP_LIST3 (ARGP_NAME,       ARGP_BYTEDATA,      ARGP_BYTEDATA)
 #define ARGP_FATAL_OP                   ARGP_LIST3 (ARGP_BYTEDATA,   ARGP_DWORDDATA,     ARGP_TERMARG)
 #define ARGP_FIELD_OP                   ARGP_LIST4 (ARGP_PKGLENGTH,  ARGP_NAMESTRING,    ARGP_BYTEDATA,  ARGP_FIELDLIST)
 #define ARGP_FIND_SET_LEFT_BIT_OP       ARGP_LIST2 (ARGP_TERMARG,    ARGP_TARGET)
index 60ea725..526705e 100644 (file)
@@ -46,7 +46,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20170303
+#define ACPI_CA_VERSION                 0x20170531
 
 #include "acconfig.h"
 #include "actypes.h"
index bc89d72..08a08e1 100644 (file)
@@ -574,6 +574,9 @@ const ACPI_PREDEFINED_INFO          AcpiGbl_PredefinedMethods[] =
     {{"_HID",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING)}},
 
+    {{"_HMA",   METHOD_0ARGS,
+                METHOD_RETURNS (ACPI_RTYPE_BUFFER)}},
+
     {{"_HOT",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
 
@@ -618,6 +621,17 @@ const ACPI_PREDEFINED_INFO          AcpiGbl_PredefinedMethods[] =
                     PACKAGE_INFO (ACPI_PTYPE2_VAR_VAR, ACPI_RTYPE_INTEGER, 3,
                     ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER | ACPI_RTYPE_STRING, 10,0),
 
+    {{"_LSI",   METHOD_0ARGS,
+                METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}},
+                    PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3,0,0,0),
+
+    {{"_LSR",   METHOD_2ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER),
+                METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}},
+                    PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 1, ACPI_RTYPE_BUFFER, 1,0),
+
+    {{"_LSW",   METHOD_3ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_BUFFER),
+                METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
+
     {{"_MAT",   METHOD_0ARGS,
                 METHOD_RETURNS (ACPI_RTYPE_BUFFER)}},
 
index c2a013c..128ddca 100644 (file)
@@ -155,7 +155,9 @@ typedef enum
     ACPI_RSD_UINT16,
     ACPI_RSD_UINT32,
     ACPI_RSD_UINT64,
-    ACPI_RSD_WORDLIST
+    ACPI_RSD_WORDLIST,
+    ACPI_RSD_LABEL,
+    ACPI_RSD_SOURCE_LABEL,
 
 } ACPI_RSDUMP_OPCODES;
 
@@ -387,6 +389,11 @@ extern ACPI_RSCONVERT_INFO      AcpiRsConvertFixedDma[];
 extern ACPI_RSCONVERT_INFO      AcpiRsConvertI2cSerialBus[];
 extern ACPI_RSCONVERT_INFO      AcpiRsConvertSpiSerialBus[];
 extern ACPI_RSCONVERT_INFO      AcpiRsConvertUartSerialBus[];
+extern ACPI_RSCONVERT_INFO      AcpiRsConvertPinFunction[];
+extern ACPI_RSCONVERT_INFO      AcpiRsConvertPinConfig[];
+extern ACPI_RSCONVERT_INFO      AcpiRsConvertPinGroup[];
+extern ACPI_RSCONVERT_INFO      AcpiRsConvertPinGroupFunction[];
+extern ACPI_RSCONVERT_INFO      AcpiRsConvertPinGroupConfig[];
 
 /* These resources require separate get/set tables */
 
@@ -431,12 +438,17 @@ extern ACPI_RSDUMP_INFO         AcpiRsDumpExtAddress64[];
 extern ACPI_RSDUMP_INFO         AcpiRsDumpExtIrq[];
 extern ACPI_RSDUMP_INFO         AcpiRsDumpGenericReg[];
 extern ACPI_RSDUMP_INFO         AcpiRsDumpGpio[];
+extern ACPI_RSDUMP_INFO         AcpiRsDumpPinFunction[];
 extern ACPI_RSDUMP_INFO         AcpiRsDumpFixedDma[];
 extern ACPI_RSDUMP_INFO         AcpiRsDumpCommonSerialBus[];
 extern ACPI_RSDUMP_INFO         AcpiRsDumpI2cSerialBus[];
 extern ACPI_RSDUMP_INFO         AcpiRsDumpSpiSerialBus[];
 extern ACPI_RSDUMP_INFO         AcpiRsDumpUartSerialBus[];
 extern ACPI_RSDUMP_INFO         AcpiRsDumpGeneralFlags[];
+extern ACPI_RSDUMP_INFO         AcpiRsDumpPinConfig[];
+extern ACPI_RSDUMP_INFO         AcpiRsDumpPinGroup[];
+extern ACPI_RSDUMP_INFO         AcpiRsDumpPinGroupFunction[];
+extern ACPI_RSDUMP_INFO         AcpiRsDumpPinGroupConfig[];
 #endif
 
 #endif  /* __ACRESRC_H__ */
index 1c8f70c..cc41102 100644 (file)
@@ -327,6 +327,13 @@ typedef union acpi_resource_attribute
 
 } ACPI_RESOURCE_ATTRIBUTE;
 
+typedef struct acpi_resource_label
+{
+    UINT16                          StringLength;
+    char                            *StringPtr;
+
+} ACPI_RESOURCE_LABEL;
+
 typedef struct acpi_resource_source
 {
     UINT8                           Index;
@@ -617,6 +624,90 @@ typedef struct acpi_resource_uart_serialbus
 #define ACPI_UART_CLEAR_TO_SEND                 (1<<6)
 #define ACPI_UART_REQUEST_TO_SEND               (1<<7)
 
+typedef struct acpi_resource_pin_function
+{
+    UINT8                           RevisionId;
+    UINT8                           PinConfig;
+    UINT8                           Sharable;           /* For values, see Interrupt Attributes above */
+    UINT16                          FunctionNumber;
+    UINT16                          PinTableLength;
+    UINT16                          VendorLength;
+    ACPI_RESOURCE_SOURCE            ResourceSource;
+    UINT16                          *PinTable;
+    UINT8                           *VendorData;
+
+} ACPI_RESOURCE_PIN_FUNCTION;
+
+typedef struct acpi_resource_pin_config
+{
+    UINT8                           RevisionId;
+    UINT8                           ProducerConsumer;   /* For values, see Producer/Consumer above */
+    UINT8                           Sharable;           /* For values, see Interrupt Attributes above */
+    UINT8                           PinConfigType;
+    UINT32                          PinConfigValue;
+    UINT16                          PinTableLength;
+    UINT16                          VendorLength;
+    ACPI_RESOURCE_SOURCE            ResourceSource;
+    UINT16                          *PinTable;
+    UINT8                           *VendorData;
+
+} ACPI_RESOURCE_PIN_CONFIG;
+
+/* Values for PinConfigType field above */
+
+#define ACPI_PIN_CONFIG_DEFAULT                 0
+#define ACPI_PIN_CONFIG_BIAS_PULL_UP            1
+#define ACPI_PIN_CONFIG_BIAS_PULL_DOWN          2
+#define ACPI_PIN_CONFIG_BIAS_DEFAULT            3
+#define ACPI_PIN_CONFIG_BIAS_DISABLE            4
+#define ACPI_PIN_CONFIG_BIAS_HIGH_IMPEDANCE     5
+#define ACPI_PIN_CONFIG_BIAS_BUS_HOLD           6
+#define ACPI_PIN_CONFIG_DRIVE_OPEN_DRAIN        7
+#define ACPI_PIN_CONFIG_DRIVE_OPEN_SOURCE       8
+#define ACPI_PIN_CONFIG_DRIVE_PUSH_PULL         9
+#define ACPI_PIN_CONFIG_DRIVE_STRENGTH          10
+#define ACPI_PIN_CONFIG_SLEW_RATE               11
+#define ACPI_PIN_CONFIG_INPUT_DEBOUNCE          12
+#define ACPI_PIN_CONFIG_INPUT_SCHMITT_TRIGGER   13
+
+typedef struct acpi_resource_pin_group
+{
+    UINT8                           RevisionId;
+    UINT8                           ProducerConsumer;   /* For values, see Producer/Consumer above */
+    UINT16                          PinTableLength;
+    UINT16                          VendorLength;
+    UINT16                          *PinTable;
+    ACPI_RESOURCE_LABEL             ResourceLabel;
+    UINT8                           *VendorData;
+
+} ACPI_RESOURCE_PIN_GROUP;
+
+typedef struct acpi_resource_pin_group_function
+{
+    UINT8                           RevisionId;
+    UINT8                           ProducerConsumer;   /* For values, see Producer/Consumer above */
+    UINT8                           Sharable;           /* For values, see Interrupt Attributes above */
+    UINT16                          FunctionNumber;
+    UINT16                          VendorLength;
+    ACPI_RESOURCE_SOURCE            ResourceSource;
+    ACPI_RESOURCE_LABEL             ResourceSourceLabel;
+    UINT8                           *VendorData;
+
+} ACPI_RESOURCE_PIN_GROUP_FUNCTION;
+
+typedef struct acpi_resource_pin_group_config
+{
+    UINT8                           RevisionId;
+    UINT8                           ProducerConsumer;   /* For values, see Producer/Consumer above */
+    UINT8                           Sharable;           /* For values, see Interrupt Attributes above */
+    UINT8                           PinConfigType;      /* For values, see PinConfigType above */
+    UINT32                          PinConfigValue;
+    UINT16                          VendorLength;
+    ACPI_RESOURCE_SOURCE            ResourceSource;
+    ACPI_RESOURCE_LABEL             ResourceSourceLabel;
+    UINT8                           *VendorData;
+
+} ACPI_RESOURCE_PIN_GROUP_CONFIG;
 
 /* ACPI_RESOURCE_TYPEs */
 
@@ -640,7 +731,12 @@ typedef struct acpi_resource_uart_serialbus
 #define ACPI_RESOURCE_TYPE_GPIO                 17  /* ACPI 5.0 */
 #define ACPI_RESOURCE_TYPE_FIXED_DMA            18  /* ACPI 5.0 */
 #define ACPI_RESOURCE_TYPE_SERIAL_BUS           19  /* ACPI 5.0 */
-#define ACPI_RESOURCE_TYPE_MAX                  19
+#define ACPI_RESOURCE_TYPE_PIN_FUNCTION         20  /* ACPI 6.2 */
+#define ACPI_RESOURCE_TYPE_PIN_CONFIG           21  /* ACPI 6.2 */
+#define ACPI_RESOURCE_TYPE_PIN_GROUP            22  /* ACPI 6.2 */
+#define ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION   23  /* ACPI 6.2 */
+#define ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG     24  /* ACPI 6.2 */
+#define ACPI_RESOURCE_TYPE_MAX                  24
 
 /* Master union for resource descriptors */
 
@@ -669,6 +765,11 @@ typedef union acpi_resource_data
     ACPI_RESOURCE_SPI_SERIALBUS             SpiSerialBus;
     ACPI_RESOURCE_UART_SERIALBUS            UartSerialBus;
     ACPI_RESOURCE_COMMON_SERIALBUS          CommonSerialBus;
+    ACPI_RESOURCE_PIN_FUNCTION              PinFunction;
+    ACPI_RESOURCE_PIN_CONFIG                PinConfig;
+    ACPI_RESOURCE_PIN_GROUP                 PinGroup;
+    ACPI_RESOURCE_PIN_GROUP_FUNCTION        PinGroupFunction;
+    ACPI_RESOURCE_PIN_GROUP_CONFIG          PinGroupConfig;
 
     /* Common fields */
 
index c27f499..bd60167 100644 (file)
 #define ACPI_SIG_ECDT           "ECDT"      /* Embedded Controller Boot Resources Table */
 #define ACPI_SIG_EINJ           "EINJ"      /* Error Injection table */
 #define ACPI_SIG_ERST           "ERST"      /* Error Record Serialization Table */
+#define ACPI_SIG_HMAT           "HMAT"      /* Heterogeneous Memory Attributes Table */
 #define ACPI_SIG_HEST           "HEST"      /* Hardware Error Source Table */
 #define ACPI_SIG_MADT           "APIC"      /* Multiple APIC Description Table */
 #define ACPI_SIG_MSCT           "MSCT"      /* Maximum System Characteristics Table */
+#define ACPI_SIG_PPTT           "PPTT"      /* Processor Properties Topology Table */
 #define ACPI_SIG_SBST           "SBST"      /* Smart Battery Specification Table */
 #define ACPI_SIG_SLIT           "SLIT"      /* System Locality Distance Information Table */
 #define ACPI_SIG_SRAT           "SRAT"      /* System Resource Affinity Table */
@@ -492,7 +494,8 @@ enum AcpiHestTypes
     ACPI_HEST_TYPE_AER_BRIDGE           = 8,
     ACPI_HEST_TYPE_GENERIC_ERROR        = 9,
     ACPI_HEST_TYPE_GENERIC_ERROR_V2     = 10,
-    ACPI_HEST_TYPE_RESERVED             = 11    /* 11 and greater are reserved */
+    ACPI_HEST_TYPE_IA32_DEFERRED_CHECK  = 11,
+    ACPI_HEST_TYPE_RESERVED             = 12    /* 12 and greater are reserved */
 };
 
 
@@ -544,6 +547,7 @@ typedef struct acpi_hest_aer_common
 
 #define ACPI_HEST_FIRMWARE_FIRST        (1)
 #define ACPI_HEST_GLOBAL                (1<<1)
+#define ACPI_HEST_GHES_ASSIST           (1<<2)
 
 /*
  * Macros to access the bus/segment numbers in Bus field above:
@@ -574,18 +578,19 @@ typedef struct acpi_hest_notify
 
 enum AcpiHestNotifyTypes
 {
-    ACPI_HEST_NOTIFY_POLLED     = 0,
-    ACPI_HEST_NOTIFY_EXTERNAL   = 1,
-    ACPI_HEST_NOTIFY_LOCAL      = 2,
-    ACPI_HEST_NOTIFY_SCI        = 3,
-    ACPI_HEST_NOTIFY_NMI        = 4,
-    ACPI_HEST_NOTIFY_CMCI       = 5,    /* ACPI 5.0 */
-    ACPI_HEST_NOTIFY_MCE        = 6,    /* ACPI 5.0 */
-    ACPI_HEST_NOTIFY_GPIO       = 7,    /* ACPI 6.0 */
-    ACPI_HEST_NOTIFY_SEA        = 8,    /* ACPI 6.1 */
-    ACPI_HEST_NOTIFY_SEI        = 9,    /* ACPI 6.1 */
-    ACPI_HEST_NOTIFY_GSIV       = 10,   /* ACPI 6.1 */
-    ACPI_HEST_NOTIFY_RESERVED   = 11    /* 11 and greater are reserved */
+    ACPI_HEST_NOTIFY_POLLED             = 0,
+    ACPI_HEST_NOTIFY_EXTERNAL           = 1,
+    ACPI_HEST_NOTIFY_LOCAL              = 2,
+    ACPI_HEST_NOTIFY_SCI                = 3,
+    ACPI_HEST_NOTIFY_NMI                = 4,
+    ACPI_HEST_NOTIFY_CMCI               = 5,    /* ACPI 5.0 */
+    ACPI_HEST_NOTIFY_MCE                = 6,    /* ACPI 5.0 */
+    ACPI_HEST_NOTIFY_GPIO               = 7,    /* ACPI 6.0 */
+    ACPI_HEST_NOTIFY_SEA                = 8,    /* ACPI 6.1 */
+    ACPI_HEST_NOTIFY_SEI                = 9,    /* ACPI 6.1 */
+    ACPI_HEST_NOTIFY_GSIV               = 10,   /* ACPI 6.1 */
+    ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED = 11,   /* ACPI 6.2 */
+    ACPI_HEST_NOTIFY_RESERVED           = 12    /* 12 and greater are reserved */
 };
 
 /* Values for ConfigWriteEnable bitfield above */
@@ -608,7 +613,7 @@ typedef struct acpi_hest_ia_machine_check
 {
     ACPI_HEST_HEADER        Header;
     UINT16                  Reserved1;
-    UINT8                   Flags;
+    UINT8                   Flags;              /* See flags ACPI_HEST_GLOBAL, etc. above */
     UINT8                   Enabled;
     UINT32                  RecordsToPreallocate;
     UINT32                  MaxSectionsPerRecord;
@@ -626,7 +631,7 @@ typedef struct acpi_hest_ia_corrected
 {
     ACPI_HEST_HEADER        Header;
     UINT16                  Reserved1;
-    UINT8                   Flags;
+    UINT8                   Flags;              /* See flags ACPI_HEST_GLOBAL, etc. above */
     UINT8                   Enabled;
     UINT32                  RecordsToPreallocate;
     UINT32                  MaxSectionsPerRecord;
@@ -791,6 +796,155 @@ typedef struct acpi_hest_generic_data_v300
 #define ACPI_HEST_GEN_VALID_TIMESTAMP       (1<<2)
 
 
+/* 11: IA32 Deferred Machine Check Exception (ACPI 6.2) */
+
+typedef struct acpi_hest_ia_deferred_check
+{
+    ACPI_HEST_HEADER        Header;
+    UINT16                  Reserved1;
+    UINT8                   Flags;              /* See flags ACPI_HEST_GLOBAL, etc. above */
+    UINT8                   Enabled;
+    UINT32                  RecordsToPreallocate;
+    UINT32                  MaxSectionsPerRecord;
+    ACPI_HEST_NOTIFY        Notify;
+    UINT8                   NumHardwareBanks;
+    UINT8                   Reserved2[3];
+
+} ACPI_HEST_IA_DEFERRED_CHECK;
+
+
+/*******************************************************************************
+ *
+ * HMAT - Heterogeneous Memory Attributes Table (ACPI 6.2)
+ *        Version 1
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_hmat
+{
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    UINT32                  Reserved;
+
+} ACPI_TABLE_HMAT;
+
+
+/* Values for HMAT structure types */
+
+enum AcpiHmatType
+{
+    ACPI_HMAT_TYPE_ADDRESS_RANGE        = 0,   /* Memory subystem address range */
+    ACPI_HMAT_TYPE_LOCALITY             = 1,   /* System locality latency and bandwidth information */
+    ACPI_HMAT_TYPE_CACHE                = 2,   /* Memory side cache information */
+    ACPI_HMAT_TYPE_RESERVED             = 3    /* 3 and greater are reserved */
+};
+
+typedef struct acpi_hmat_structure
+{
+    UINT16                  Type;
+    UINT16                  Reserved;
+    UINT32                  Length;
+
+} ACPI_HMAT_STRUCTURE;
+
+
+/*
+ * HMAT Structures, correspond to Type in ACPI_HMAT_STRUCTURE
+ */
+
+/* 0: Memory subystem address range */
+
+typedef struct acpi_hmat_address_range
+{
+    ACPI_HMAT_STRUCTURE     Header;
+    UINT16                  Flags;
+    UINT16                  Reserved1;
+    UINT32                  ProcessorPD;            /* Processor proximity domain */
+    UINT32                  MemoryPD;               /* Memory proximity domain */
+    UINT32                  Reserved2;
+    UINT64                  PhysicalAddressBase;    /* Physical address range base */
+    UINT64                  PhysicalAddressLength;  /* Physical address range length */
+
+} ACPI_HMAT_ADDRESS_RANGE;
+
+/* Masks for Flags field above */
+
+#define ACPI_HMAT_PROCESSOR_PD_VALID    (1)     /* 1: ProcessorPD field is valid */
+#define ACPI_HMAT_MEMORY_PD_VALID       (1<<1)  /* 1: MemoryPD field is valid */
+#define ACPI_HMAT_RESERVATION_HINT      (1<<2)  /* 1: Reservation hint */
+
+
+/* 1: System locality latency and bandwidth information */
+
+typedef struct acpi_hmat_locality
+{
+    ACPI_HMAT_STRUCTURE     Header;
+    UINT8                   Flags;
+    UINT8                   DataType;
+    UINT16                  Reserved1;
+    UINT32                  NumberOfInitiatorPDs;
+    UINT32                  NumberOfTargetPDs;
+    UINT32                  Reserved2;
+    UINT64                  EntryBaseUnit;
+
+} ACPI_HMAT_LOCALITY;
+
+/* Masks for Flags field above */
+
+#define ACPI_HMAT_MEMORY_HIERARCHY  (0x0F)
+
+/* Values for Memory Hierarchy flag */
+
+#define ACPI_HMAT_MEMORY            0
+#define ACPI_HMAT_LAST_LEVEL_CACHE  1
+#define ACPI_HMAT_1ST_LEVEL_CACHE   2
+#define ACPI_HMAT_2ND_LEVEL_CACHE   3
+#define ACPI_HMAT_3RD_LEVEL_CACHE   4
+
+/* Values for DataType field above */
+
+#define ACPI_HMAT_ACCESS_LATENCY    0
+#define ACPI_HMAT_READ_LATENCY      1
+#define ACPI_HMAT_WRITE_LATENCY     2
+#define ACPI_HMAT_ACCESS_BANDWIDTH  3
+#define ACPI_HMAT_READ_BANDWIDTH    4
+#define ACPI_HMAT_WRITE_BANDWIDTH   5
+
+
+/* 2: Memory side cache information */
+
+typedef struct acpi_hmat_cache
+{
+    ACPI_HMAT_STRUCTURE     Header;
+    UINT32                  MemoryPD;
+    UINT32                  Reserved1;
+    UINT64                  CacheSize;
+    UINT32                  CacheAttributes;
+    UINT16                  Reserved2;
+    UINT16                  NumberOfSMBIOSHandles;
+
+} ACPI_HMAT_CACHE;
+
+/* Masks for CacheAttributes field above */
+
+#define ACPI_HMAT_TOTAL_CACHE_LEVEL     (0x0000000F)
+#define ACPI_HMAT_CACHE_LEVEL           (0x000000F0)
+#define ACPI_HMAT_CACHE_ASSOCIATIVITY   (0x00000F00)
+#define ACPI_HMAT_WRITE_POLICY          (0x0000F000)
+#define ACPI_HMAT_CACHE_LINE_SIZE       (0xFFFF0000)
+
+/* Values for cache associativity flag */
+
+#define ACPI_HMAT_CA_NONE                     (0)
+#define ACPI_HMAT_CA_DIRECT_MAPPED            (1)
+#define ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING   (2)
+
+/* Values for write policy flag */
+
+#define ACPI_HMAT_CP_NONE   (0)
+#define ACPI_HMAT_CP_WB     (1)
+#define ACPI_HMAT_CP_WT     (2)
+
+
 /*******************************************************************************
  *
  * MADT - Multiple APIC Description Table
@@ -812,8 +966,8 @@ typedef struct acpi_table_madt
 
 /* Values for PCATCompat flag */
 
-#define ACPI_MADT_DUAL_PIC          0
-#define ACPI_MADT_MULTIPLE_APIC     1
+#define ACPI_MADT_DUAL_PIC          1
+#define ACPI_MADT_MULTIPLE_APIC     0
 
 
 /* Values for MADT subtable type in ACPI_SUBTABLE_HEADER */
@@ -1338,6 +1492,95 @@ typedef struct acpi_nfit_flush_address
 } ACPI_NFIT_FLUSH_ADDRESS;
 
 
+/*******************************************************************************
+ *
+ * PPTT - Processor Properties Topology Table (ACPI 6.2)
+ *        Version 1
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_pptt
+{
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+
+} ACPI_TABLE_PPTT;
+
+/* Values for Type field above */
+
+enum AcpiPpttType
+{
+    ACPI_PPTT_TYPE_PROCESSOR            = 0,
+    ACPI_PPTT_TYPE_CACHE                = 1,
+    ACPI_PPTT_TYPE_ID                   = 2,
+    ACPI_PPTT_TYPE_RESERVED             = 3
+};
+
+
+/* 0: Processor Hierarchy Node Structure */
+
+typedef struct acpi_pptt_processor {
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT16                  Reserved;
+    UINT32                  Flags;
+    UINT32                  Parent;
+    UINT32                  AcpiProcessorId;
+    UINT32                  NumberOfPrivResources;
+
+} ACPI_PPTT_PROCESSOR;
+
+/* Flags */
+
+#define ACPI_PPTT_PHYSICAL_PACKAGE          (1)     /* Physical package */
+#define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID   (2)     /* ACPI Processor ID valid */
+
+
+/* 1: Cache Type Structure */
+
+typedef struct acpi_pptt_cache {
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT16                  Reserved;
+    UINT32                  Flags;
+    UINT32                  NextLevelOfCache;
+    UINT32                  Size;
+    UINT32                  NumberOfSets;
+    UINT8                   Associativity;
+    UINT8                   Attributes;
+    UINT16                  LineSize;
+
+} ACPI_PPTT_CACHE;
+
+/* Flags */
+
+#define ACPI_PPTT_SIZE_PROPERTY_VALID       (1)     /* Physical property valid */
+#define ACPI_PPTT_NUMBER_OF_SETS_VALID      (1<<1)  /* Number of sets valid */
+#define ACPI_PPTT_ASSOCIATIVITY_VALID       (1<<2)  /* Associativity valid */
+#define ACPI_PPTT_ALLOCATION_TYPE_VALID     (1<<3)  /* Allocation type valid */
+#define ACPI_PPTT_CACHE_TYPE_VALID          (1<<4)  /* Cache type valid */
+#define ACPI_PPTT_WRITE_POLICY_VALID        (1<<5)  /* Write policy valid */
+#define ACPI_PPTT_LINE_SIZE_VALID           (1<<6)  /* Line size valid */
+
+/* Masks for Attributes */
+
+#define ACPI_PPTT_MASK_ALLOCATION_TYPE      (0x03)  /* Allocation type */
+#define ACPI_PPTT_MASK_CACHE_TYPE           (0x0C)  /* Cache type */
+#define ACPI_PPTT_MASK_WRITE_POLICY         (0x10)  /* Write policy */
+
+
+/* 2: ID Structure */
+
+typedef struct acpi_pptt_id {
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT16                  Reserved;
+    UINT32                  VendorId;
+    UINT64                  Level1Id;
+    UINT64                  Level2Id;
+    UINT16                  MajorRev;
+    UINT16                  MinorRev;
+    UINT16                  SpinRev;
+
+} ACPI_PPTT_ID;
+
+
 /*******************************************************************************
  *
  * SBST - Smart Battery Specification Table
@@ -1394,7 +1637,8 @@ enum AcpiSratType
     ACPI_SRAT_TYPE_MEMORY_AFFINITY      = 1,
     ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY  = 2,
     ACPI_SRAT_TYPE_GICC_AFFINITY        = 3,
-    ACPI_SRAT_TYPE_RESERVED             = 4     /* 4 and greater are reserved */
+    ACPI_SRAT_TYPE_GIC_ITS_AFFINITY     = 4,    /* ACPI 6.2 */
+    ACPI_SRAT_TYPE_RESERVED             = 5     /* 5 and greater are reserved */
 };
 
 /*
@@ -1478,6 +1722,18 @@ typedef struct acpi_srat_gicc_affinity
 #define ACPI_SRAT_GICC_ENABLED     (1)         /* 00: Use affinity structure */
 
 
+/* 4: GCC ITS Affinity (ACPI 6.2) */
+
+typedef struct acpi_srat_gic_its_affinity
+{
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT32                  ProximityDomain;
+    UINT16                  Reserved;
+    UINT32                  ItsId;
+
+} ACPI_SRAT_GIC_ITS_AFFINITY;
+
+
 /* Reset to default packing */
 
 #pragma pack()
index 51aafc0..e809688 100644 (file)
@@ -89,6 +89,7 @@
 #define ACPI_SIG_WDAT           "WDAT"      /* Watchdog Action Table */
 #define ACPI_SIG_WDDT           "WDDT"      /* Watchdog Timer Description Table */
 #define ACPI_SIG_WDRT           "WDRT"      /* Watchdog Resource Table */
+#define ACPI_SIG_WSMT           "WSMT"      /* Windows SMM Security Migrations Table */
 #define ACPI_SIG_XXXX           "XXXX"      /* Intermediate AML header for ASL/ASL+ converter */
 
 #ifdef ACPI_UNDEFINED_TABLES
@@ -1413,7 +1414,8 @@ enum AcpiSpmiInterfaceTypes
  *        Version 2
  *
  * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
- * December 19, 2014
+ * Version 1.2, Revision 8
+ * February 27, 2017
  *
  * NOTE: There are two versions of the table with the same signature --
  * the client version and the server version. The common PlatformClass
@@ -1484,7 +1486,8 @@ typedef struct acpi_table_tcpa_server
  *        Version 4
  *
  * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
- * December 19, 2014
+ * Version 1.2, Revision 8
+ * February 27, 2017
  *
  ******************************************************************************/
 
@@ -1507,6 +1510,42 @@ typedef struct acpi_table_tpm2
 #define ACPI_TPM2_MEMORY_MAPPED                     6
 #define ACPI_TPM2_COMMAND_BUFFER                    7
 #define ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD  8
+#define ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC       11  /* V1.2 Rev 8 */
+
+
+/* Trailer appears after any StartMethod subtables */
+
+typedef struct acpi_tpm2_trailer
+{
+    UINT32                  MinimumLogLength;   /* Minimum length for the event log area */
+    UINT64                  LogAddress;         /* Address of the event log area */
+
+} ACPI_TPM2_TRAILER;
+
+
+/*
+ * Subtables (StartMethod-specific)
+ */
+
+/* 11: Start Method for ARM SMC (V1.2 Rev 8) */
+
+typedef struct acpi_tpm2_arm_smc
+{
+    UINT32                  GlobalInterrupt;
+    UINT8                   InterruptFlags;
+    UINT8                   OperationFlags;
+    UINT16                  Reserved;
+    UINT32                  FunctionId;
+
+} ACPI_TPM2_ARM_SMC;
+
+/* Values for InterruptFlags above */
+
+#define ACPI_TPM2_INTERRUPT_SUPPORT     (1)
+
+/* Values for OperationFlags above */
+
+#define ACPI_TPM2_IDLE_SUPPORT          (1)
 
 
 /*******************************************************************************
@@ -1726,6 +1765,30 @@ typedef struct acpi_table_wdrt
 } ACPI_TABLE_WDRT;
 
 
+/*******************************************************************************
+ *
+ * WSMT - Windows SMM Security Migrations Table
+ *        Version 1
+ *
+ * Conforms to "Windows SMM Security Migrations Table",
+ * Version 1.0, April 18, 2016
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_wsmt
+{
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    UINT32                  ProtectionFlags;
+
+} ACPI_TABLE_WSMT;
+
+/* Flags for ProtectionFlags field above */
+
+#define ACPI_WSMT_FIXED_COMM_BUFFERS                (1)
+#define ACPI_WSMT_COMM_BUFFER_NESTED_PTR_PROTECTION (2)
+#define ACPI_WSMT_SYSTEM_RESOURCE_PROTECTION        (4)
+
+
 /* Reset to default packing */
 
 #pragma pack()
index 65711de..e1a13d0 100644 (file)
@@ -121,6 +121,11 @@ typedef struct acpi_table_bgrt
 
 } ACPI_TABLE_BGRT;
 
+/* Flags for Status field above */
+
+#define ACPI_BGRT_DISPLAYED                 (1)
+#define ACPI_BGRT_ORIENTATION_OFFSET        (3 << 1)
+
 
 /*******************************************************************************
  *
@@ -543,7 +548,7 @@ typedef struct acpi_mpst_shared
 /*******************************************************************************
  *
  * PCCT - Platform Communications Channel Table (ACPI 5.0)
- *        Version 1
+ *        Version 2 (ACPI 6.2)
  *
  ******************************************************************************/
 
@@ -566,7 +571,9 @@ enum AcpiPcctType
     ACPI_PCCT_TYPE_GENERIC_SUBSPACE             = 0,
     ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE          = 1,
     ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2    = 2,    /* ACPI 6.1 */
-    ACPI_PCCT_TYPE_RESERVED                     = 3     /* 3 and greater are reserved */
+    ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE      = 3,    /* ACPI 6.2 */
+    ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE       = 4,    /* ACPI 6.2 */
+    ACPI_PCCT_TYPE_RESERVED                     = 5     /* 5 and greater are reserved */
 };
 
 /*
@@ -596,7 +603,7 @@ typedef struct acpi_pcct_subspace
 typedef struct acpi_pcct_hw_reduced
 {
     ACPI_SUBTABLE_HEADER    Header;
-    UINT32                  DoorbellInterrupt;
+    UINT32                  PlatformInterrupt;
     UINT8                   Flags;
     UINT8                   Reserved;
     UINT64                  BaseAddress;
@@ -616,7 +623,7 @@ typedef struct acpi_pcct_hw_reduced
 typedef struct acpi_pcct_hw_reduced_type2
 {
     ACPI_SUBTABLE_HEADER    Header;
-    UINT32                  DoorbellInterrupt;
+    UINT32                  PlatformInterrupt;
     UINT8                   Flags;
     UINT8                   Reserved;
     UINT64                  BaseAddress;
@@ -627,13 +634,75 @@ typedef struct acpi_pcct_hw_reduced_type2
     UINT32                  Latency;
     UINT32                  MaxAccessRate;
     UINT16                  MinTurnaroundTime;
-    ACPI_GENERIC_ADDRESS    DoorbellAckRegister;
+    ACPI_GENERIC_ADDRESS    PlatformAckRegister;
     UINT64                  AckPreserveMask;
     UINT64                  AckWriteMask;
 
 } ACPI_PCCT_HW_REDUCED_TYPE2;
 
 
+/* 3: Extended PCC Master Subspace Type 3 (ACPI 6.2) */
+
+typedef struct acpi_pcct_ext_pcc_master
+{
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT32                  PlatformInterrupt;
+    UINT8                   Flags;
+    UINT8                   Reserved1;
+    UINT64                  BaseAddress;
+    UINT32                  Length;
+    ACPI_GENERIC_ADDRESS    DoorbellRegister;
+    UINT64                  PreserveMask;
+    UINT64                  WriteMask;
+    UINT32                  Latency;
+    UINT32                  MaxAccessRate;
+    UINT32                  MinTurnaroundTime;
+    ACPI_GENERIC_ADDRESS    PlatformAckRegister;
+    UINT64                  AckPreserveMask;
+    UINT64                  AckSetMask;
+    UINT64                  Reserved2;
+    ACPI_GENERIC_ADDRESS    CmdCompleteRegister;
+    UINT64                  CmdCompleteMask;
+    ACPI_GENERIC_ADDRESS    CmdUpdateRegister;
+    UINT64                  CmdUpdatePreserveMask;
+    UINT64                  CmdUpdateSetMask;
+    ACPI_GENERIC_ADDRESS    ErrorStatusRegister;
+    UINT64                  ErrorStatusMask;
+
+} ACPI_PCCT_EXT_PCC_MASTER;
+
+
+/* 4: Extended PCC Slave Subspace Type 4 (ACPI 6.2) */
+
+typedef struct acpi_pcct_ext_pcc_slave
+{
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT32                  PlatformInterrupt;
+    UINT8                   Flags;
+    UINT8                   Reserved1;
+    UINT64                  BaseAddress;
+    UINT32                  Length;
+    ACPI_GENERIC_ADDRESS    DoorbellRegister;
+    UINT64                  PreserveMask;
+    UINT64                  WriteMask;
+    UINT32                  Latency;
+    UINT32                  MaxAccessRate;
+    UINT32                  MinTurnaroundTime;
+    ACPI_GENERIC_ADDRESS    PlatformAckRegister;
+    UINT64                  AckPreserveMask;
+    UINT64                  AckSetMask;
+    UINT64                  Reserved2;
+    ACPI_GENERIC_ADDRESS    CmdCompleteRegister;
+    UINT64                  CmdCompleteMask;
+    ACPI_GENERIC_ADDRESS    CmdUpdateRegister;
+    UINT64                  CmdUpdatePreserveMask;
+    UINT64                  CmdUpdateSetMask;
+    ACPI_GENERIC_ADDRESS    ErrorStatusRegister;
+    UINT64                  ErrorStatusMask;
+
+} ACPI_PCCT_EXT_PCC_SLAVE;
+
+
 /* Values for doorbell flags above */
 
 #define ACPI_PCCT_INTERRUPT_POLARITY    (1)
@@ -655,6 +724,18 @@ typedef struct acpi_pcct_shared_memory
 } ACPI_PCCT_SHARED_MEMORY;
 
 
+/* Extended PCC Subspace Shared Memory Region (ACPI 6.2) */
+
+typedef struct acpi_pcct_ext_pcc_shared_memory
+{
+    UINT32                  Signature;
+    UINT32                  Flags;
+    UINT32                  Length;
+    UINT32                  Command;
+
+} ACPI_PCCT_EXT_PCC_SHARED_MEMORY;
+
+
 /*******************************************************************************
  *
  * PMTT - Platform Memory Topology Table (ACPI 5.0)
index ca96eb6..b6d4080 100644 (file)
@@ -47,9 +47,9 @@
 /* acpisrc:StructDefs -- for acpisrc conversion */
 
 /*
- * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header
- * and must be either 32 or 64. 16-bit ACPICA is no longer supported, as of
- * 12/2006.
+ * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent
+ * header and must be either 32 or 64. 16-bit ACPICA is no longer
+ * supported, as of 12/2006.
  */
 #ifndef ACPI_MACHINE_WIDTH
 #error ACPI_MACHINE_WIDTH not defined
@@ -88,9 +88,9 @@
  * INT64        64-bit (8 byte) signed value
  *
  * COMPILER_DEPENDENT_UINT64/INT64 - These types are defined in the
- * compiler-dependent header(s) and were introduced because there is no common
- * 64-bit integer type across the various compilation models, as shown in
- * the table below.
+ * compiler-dependent header(s) and were introduced because there is no
+ * common 64-bit integer type across the various compilation models, as
+ * shown in the table below.
  *
  * Datatype  LP64 ILP64 LLP64 ILP32 LP32 16bit
  * char      8    8     8     8     8    8
  * 2) These types represent the native word size of the target mode of the
  * processor, and may be 16-bit, 32-bit, or 64-bit as required. They are
  * usually used for memory allocation, efficient loop counters, and array
- * indexes. The types are similar to the size_t type in the C library and are
- * required because there is no C type that consistently represents the native
- * data width. ACPI_SIZE is needed because there is no guarantee that a
- * kernel-level C library is present.
+ * indexes. The types are similar to the size_t type in the C library and
+ * are required because there is no C type that consistently represents the
+ * native data width. ACPI_SIZE is needed because there is no guarantee
+ * that a kernel-level C library is present.
  *
  * ACPI_SIZE        16/32/64-bit unsigned value
  * ACPI_NATIVE_INT  16/32/64-bit signed value
@@ -171,9 +171,10 @@ typedef UINT64                          ACPI_PHYSICAL_ADDRESS;
 
 /*
  * In the case of the Itanium Processor Family (IPF), the hardware does not
- * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag
- * to indicate that special precautions must be taken to avoid alignment faults.
- * (IA64 or ia64 is currently used by existing compilers to indicate IPF.)
+ * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED
+ * flag to indicate that special precautions must be taken to avoid alignment
+ * faults. (IA64 or ia64 is currently used by existing compilers to indicate
+ * IPF.)
  *
  * Note: EM64T and other X86-64 processors support misaligned transfers,
  * so there is no need to define this flag.
@@ -314,8 +315,8 @@ typedef UINT64                          ACPI_PHYSICAL_ADDRESS;
 #endif
 
 /*
- * Some compilers complain about unused variables. Sometimes we don't want to
- * use all the variables (for example, _AcpiModuleName). This allows us
+ * Some compilers complain about unused variables. Sometimes we don't want
+ * to use all the variables (for example, _AcpiModuleName). This allows us
  * to tell the compiler in a per-variable manner that a variable
  * is unused
  */
@@ -324,8 +325,9 @@ typedef UINT64                          ACPI_PHYSICAL_ADDRESS;
 #endif
 
 /*
- * All ACPICA external functions that are available to the rest of the kernel
- * are tagged with thes macros which can be defined as appropriate for the host.
+ * All ACPICA external functions that are available to the rest of the
+ * kernel are tagged with these macros which can be defined as appropriate
+ * for the host.
  *
  * Notes:
  * ACPI_EXPORT_SYMBOL_INIT is used for initialization and termination
@@ -390,7 +392,8 @@ typedef UINT64                          ACPI_PHYSICAL_ADDRESS;
 
 /******************************************************************************
  *
- * ACPI Specification constants (Do not change unless the specification changes)
+ * ACPI Specification constants (Do not change unless the specification
+ * changes)
  *
  *****************************************************************************/
 
@@ -496,10 +499,10 @@ typedef UINT8                           ACPI_OWNER_ID;
 #define ACPI_DO_NOT_WAIT                0
 
 /*
- * Obsolete: Acpi integer width. In ACPI version 1 (1996), integers are 32 bits.
- * In ACPI version 2 (2000) and later, integers are 64 bits. Note that this
- * pertains to the ACPI integer type only, not to other integers used in the
- * implementation of the ACPICA subsystem.
+ * Obsolete: Acpi integer width. In ACPI version 1 (1996), integers are
+ * 32 bits. In ACPI version 2 (2000) and later, integers are max 64 bits.
+ * Note that this pertains to the ACPI integer type only, not to other
+ * integers used in the implementation of the ACPICA subsystem.
  *
  * 01/2010: This type is obsolete and has been removed from the entire ACPICA
  * code base. It remains here for compatibility with device drivers that use
@@ -641,8 +644,9 @@ typedef UINT64                          ACPI_INTEGER;
 #define ACPI_NOTIFY_LOCALITY_UPDATE     (UINT8) 0x0B
 #define ACPI_NOTIFY_SHUTDOWN_REQUEST    (UINT8) 0x0C
 #define ACPI_NOTIFY_AFFINITY_UPDATE     (UINT8) 0x0D
+#define ACPI_NOTIFY_MEMORY_UPDATE       (UINT8) 0x0E
 
-#define ACPI_GENERIC_NOTIFY_MAX         0x0D
+#define ACPI_GENERIC_NOTIFY_MAX         0x0E
 #define ACPI_SPECIFIC_NOTIFY_MAX        0x84
 
 /*
@@ -679,10 +683,11 @@ typedef UINT32                          ACPI_OBJECT_TYPE;
 
 /*
  * These are object types that do not map directly to the ACPI
- * ObjectType() operator. They are used for various internal purposes only.
- * If new predefined ACPI_TYPEs are added (via the ACPI specification), these
- * internal types must move upwards. (There is code that depends on these
- * values being contiguous with the external types above.)
+ * ObjectType() operator. They are used for various internal purposes
+ * only. If new predefined ACPI_TYPEs are added (via the ACPI
+ * specification), these internal types must move upwards. (There
+ * is code that depends on these values being contiguous with the
+ * external types above.)
  */
 #define ACPI_TYPE_LOCAL_REGION_FIELD    0x11
 #define ACPI_TYPE_LOCAL_BANK_FIELD      0x12
@@ -783,7 +788,7 @@ typedef UINT32                          ACPI_EVENT_STATUS;
  *   |  | | |  +-- Type of dispatch:to method, handler, notify, or none
  *   |  | | +----- Interrupt type: edge or level triggered
  *   |  | +------- Is a Wake GPE
- *   |  +--------- Is GPE masked by the software GPE masking machanism
+ *   |  +--------- Is GPE masked by the software GPE masking mechanism
  *   +------------ <Reserved>
  */
 #define ACPI_GPE_DISPATCH_NONE          (UINT8) 0x00
@@ -929,8 +934,8 @@ typedef struct acpi_sleep_functions
  */
 
 /*
- * Note: Type == ACPI_TYPE_ANY (0) is used to indicate a NULL package element
- * or an unresolved named reference.
+ * Note: Type == ACPI_TYPE_ANY (0) is used to indicate a NULL package
+ * element or an unresolved named reference.
  */
 typedef union acpi_object
 {
@@ -1253,7 +1258,7 @@ typedef struct acpi_pnp_device_id_list
 
 /*
  * Structure returned from AcpiGetObjectInfo.
- * Optimized for both 32- and 64-bit builds
+ * Optimized for both 32-bit and 64-bit builds.
  */
 typedef struct acpi_device_info
 {
index a0dbbf4..e560a6f 100644 (file)
@@ -86,6 +86,7 @@ extern const char                       *AcpiGbl_BpbDecode[];
 extern const char                       *AcpiGbl_SbDecode[];
 extern const char                       *AcpiGbl_FcDecode[];
 extern const char                       *AcpiGbl_PtDecode[];
+extern const char                       *AcpiGbl_PtypDecode[];
 #endif
 
 /*
index 5c2e313..c32219d 100644 (file)
 #define UUID_PERSISTENT_VIRTUAL_DISK    "5cea02c9-4d07-69d3-269f-4496fbe096f9"
 #define UUID_PERSISTENT_VIRTUAL_CD      "08018188-42cd-bb48-100f-5387d53ded3d"
 
+/* Processor Properties (ACPI 6.2) */
+
+#define UUID_CACHE_PROPERTIES           "6DC63E77-257E-4E78-A973-A21F2796898D"
+#define UUID_PHYSICAL_PROPERTY          "DDE4D59A-AA42-4349-B407-EA40F57D9FB7"
+
 /* Miscellaneous */
 
 #define UUID_PLATFORM_CAPABILITIES      "0811b06e-4a27-44f9-8d60-3cbbc22e7b48"
index ed70466..e4033d0 100644 (file)
  *      #A is the number of required arguments
  *      #T is the number of target operands
  *      #R indicates whether there is a return value
+ *
+ * These types are used for the top-level dispatch of the AML
+ * opcode. They group similar operators that can share common
+ * front-end code before dispatch to the final code that implements
+ * the operator.
  */
 
 /*
  * The opcode Type is used in a dispatch table, do not change
  * or add anything new without updating the table.
  */
-#define AML_TYPE_EXEC_0A_0T_1R      0x00
-#define AML_TYPE_EXEC_1A_0T_0R      0x01 /* Monadic1  */
-#define AML_TYPE_EXEC_1A_0T_1R      0x02 /* Monadic2  */
-#define AML_TYPE_EXEC_1A_1T_0R      0x03
-#define AML_TYPE_EXEC_1A_1T_1R      0x04 /* Monadic2R */
-#define AML_TYPE_EXEC_2A_0T_0R      0x05 /* Dyadic1   */
-#define AML_TYPE_EXEC_2A_0T_1R      0x06 /* Dyadic2   */
-#define AML_TYPE_EXEC_2A_1T_1R      0x07 /* Dyadic2R  */
-#define AML_TYPE_EXEC_2A_2T_1R      0x08
-#define AML_TYPE_EXEC_3A_0T_0R      0x09
-#define AML_TYPE_EXEC_3A_1T_1R      0x0A
-#define AML_TYPE_EXEC_6A_0T_1R      0x0B
+#define AML_TYPE_EXEC_0A_0T_1R      0x00 /* 0 Args, 0 Target, 1 RetVal */
+#define AML_TYPE_EXEC_1A_0T_0R      0x01 /* 1 Args, 0 Target, 0 RetVal */
+#define AML_TYPE_EXEC_1A_0T_1R      0x02 /* 1 Args, 0 Target, 1 RetVal */
+#define AML_TYPE_EXEC_1A_1T_0R      0x03 /* 1 Args, 1 Target, 0 RetVal */
+#define AML_TYPE_EXEC_1A_1T_1R      0x04 /* 1 Args, 1 Target, 1 RetVal */
+#define AML_TYPE_EXEC_2A_0T_0R      0x05 /* 2 Args, 0 Target, 0 RetVal */
+#define AML_TYPE_EXEC_2A_0T_1R      0x06 /* 2 Args, 0 Target, 1 RetVal */
+#define AML_TYPE_EXEC_2A_1T_1R      0x07 /* 2 Args, 1 Target, 1 RetVal */
+#define AML_TYPE_EXEC_2A_2T_1R      0x08 /* 2 Args, 2 Target, 1 RetVal */
+#define AML_TYPE_EXEC_3A_0T_0R      0x09 /* 3 Args, 0 Target, 0 RetVal */
+#define AML_TYPE_EXEC_3A_1T_1R      0x0A /* 3 Args, 1 Target, 1 RetVal */
+#define AML_TYPE_EXEC_6A_0T_1R      0x0B /* 6 Args, 0 Target, 1 RetVal */
 /* End of types used in dispatch table */
 
-#define AML_TYPE_LITERAL            0x0B
-#define AML_TYPE_CONSTANT           0x0C
-#define AML_TYPE_METHOD_ARGUMENT    0x0D
-#define AML_TYPE_LOCAL_VARIABLE     0x0E
-#define AML_TYPE_DATA_TERM          0x0F
+#define AML_TYPE_LITERAL            0x0C
+#define AML_TYPE_CONSTANT           0x0D
+#define AML_TYPE_METHOD_ARGUMENT    0x0E
+#define AML_TYPE_LOCAL_VARIABLE     0x0F
+#define AML_TYPE_DATA_TERM          0x10
 
 /* Generic for an op that returns a value */
 
-#define AML_TYPE_METHOD_CALL        0x10
+#define AML_TYPE_METHOD_CALL        0x11
 
 /* Miscellaneous types */
 
-#define AML_TYPE_CREATE_FIELD       0x11
-#define AML_TYPE_CREATE_OBJECT      0x12
-#define AML_TYPE_CONTROL            0x13
-#define AML_TYPE_NAMED_NO_OBJ       0x14
-#define AML_TYPE_NAMED_FIELD        0x15
-#define AML_TYPE_NAMED_SIMPLE       0x16
-#define AML_TYPE_NAMED_COMPLEX      0x17
-#define AML_TYPE_RETURN             0x18
-#define AML_TYPE_UNDEFINED          0x19
-#define AML_TYPE_BOGUS              0x1A
+#define AML_TYPE_CREATE_FIELD       0x12
+#define AML_TYPE_CREATE_OBJECT      0x13
+#define AML_TYPE_CONTROL            0x14
+#define AML_TYPE_NAMED_NO_OBJ       0x15
+#define AML_TYPE_NAMED_FIELD        0x16
+#define AML_TYPE_NAMED_SIMPLE       0x17
+#define AML_TYPE_NAMED_COMPLEX      0x18
+#define AML_TYPE_RETURN             0x19
+#define AML_TYPE_UNDEFINED          0x1A
+#define AML_TYPE_BOGUS              0x1B
 
 /* AML Package Length encodings */
 
index 79aa5ba..e386f32 100644 (file)
@@ -66,6 +66,7 @@
 #define ACPI_RESTAG_DRIVESTRENGTH               "_DRS"
 #define ACPI_RESTAG_ENDIANNESS                  "_END"
 #define ACPI_RESTAG_FLOWCONTROL                 "_FLC"
+#define ACPI_RESTAG_FUNCTION                    "_FUN"
 #define ACPI_RESTAG_GRANULARITY                 "_GRA"
 #define ACPI_RESTAG_INTERRUPT                   "_INT"
 #define ACPI_RESTAG_INTERRUPTLEVEL              "_LL_"  /* ActiveLo(1), ActiveHi(0) */
@@ -85,6 +86,8 @@
 #define ACPI_RESTAG_PHASE                       "_PHA"
 #define ACPI_RESTAG_PIN                         "_PIN"
 #define ACPI_RESTAG_PINCONFIG                   "_PPI"
+#define ACPI_RESTAG_PINCONFIG_TYPE              "_TYP"
+#define ACPI_RESTAG_PINCONFIG_VALUE             "_VAL"
 #define ACPI_RESTAG_POLARITY                    "_POL"
 #define ACPI_RESTAG_REGISTERBITOFFSET           "_RBO"
 #define ACPI_RESTAG_REGISTERBITWIDTH            "_RBW"
@@ -528,6 +531,116 @@ typedef struct aml_resource_uart_serialbus
 #define AML_RESOURCE_UART_TYPE_REVISION         1       /* ACPI 5.0 */
 #define AML_RESOURCE_UART_MIN_DATA_LEN          10
 
+typedef struct aml_resource_pin_function
+{
+    AML_RESOURCE_LARGE_HEADER_COMMON
+    UINT8                           RevisionId;
+    UINT16                          Flags;
+    UINT8                           PinConfig;
+    UINT16                          FunctionNumber;
+    UINT16                          PinTableOffset;
+    UINT8                           ResSourceIndex;
+    UINT16                          ResSourceOffset;
+    UINT16                          VendorOffset;
+    UINT16                          VendorLength;
+    /*
+     * Optional fields follow immediately:
+     * 1) PIN list (Words)
+     * 2) Resource Source String
+     * 3) Vendor Data bytes
+     */
+
+} AML_RESOURCE_PIN_FUNCTION;
+
+#define AML_RESOURCE_PIN_FUNCTION_REVISION      1       /* ACPI 6.2 */
+
+typedef struct aml_resource_pin_config
+{
+    AML_RESOURCE_LARGE_HEADER_COMMON
+    UINT8                           RevisionId;
+    UINT16                          Flags;
+    UINT8                           PinConfigType;
+    UINT32                          PinConfigValue;
+    UINT16                          PinTableOffset;
+    UINT8                           ResSourceIndex;
+    UINT16                          ResSourceOffset;
+    UINT16                          VendorOffset;
+    UINT16                          VendorLength;
+    /*
+     * Optional fields follow immediately:
+     * 1) PIN list (Words)
+     * 2) Resource Source String
+     * 3) Vendor Data bytes
+     */
+
+} AML_RESOURCE_PIN_CONFIG;
+
+#define AML_RESOURCE_PIN_CONFIG_REVISION      1       /* ACPI 6.2 */
+
+typedef struct aml_resource_pin_group
+{
+    AML_RESOURCE_LARGE_HEADER_COMMON
+    UINT8                           RevisionId;
+    UINT16                          Flags;
+    UINT16                          PinTableOffset;
+    UINT16                          LabelOffset;
+    UINT16                          VendorOffset;
+    UINT16                          VendorLength;
+    /*
+     * Optional fields follow immediately:
+     * 1) PIN list (Words)
+     * 2) Resource Label String
+     * 3) Vendor Data bytes
+     */
+
+} AML_RESOURCE_PIN_GROUP;
+
+#define AML_RESOURCE_PIN_GROUP_REVISION      1       /* ACPI 6.2 */
+
+typedef struct aml_resource_pin_group_function
+{
+    AML_RESOURCE_LARGE_HEADER_COMMON
+    UINT8                           RevisionId;
+    UINT16                          Flags;
+    UINT16                          FunctionNumber;
+    UINT8                           ResSourceIndex;
+    UINT16                          ResSourceOffset;
+    UINT16                          ResSourceLabelOffset;
+    UINT16                          VendorOffset;
+    UINT16                          VendorLength;
+    /*
+     * Optional fields follow immediately:
+     * 1) Resource Source String
+     * 2) Resource Source Label String
+     * 3) Vendor Data bytes
+     */
+
+} AML_RESOURCE_PIN_GROUP_FUNCTION;
+
+#define AML_RESOURCE_PIN_GROUP_FUNCTION_REVISION    1       /* ACPI 6.2 */
+
+typedef struct aml_resource_pin_group_config
+{
+    AML_RESOURCE_LARGE_HEADER_COMMON
+    UINT8                           RevisionId;
+    UINT16                          Flags;
+    UINT8                           PinConfigType;
+    UINT32                          PinConfigValue;
+    UINT8                           ResSourceIndex;
+    UINT16                          ResSourceOffset;
+    UINT16                          ResSourceLabelOffset;
+    UINT16                          VendorOffset;
+    UINT16                          VendorLength;
+    /*
+     * Optional fields follow immediately:
+     * 1) Resource Source String
+     * 2) Resource Source Label String
+     * 3) Vendor Data bytes
+     */
+
+} AML_RESOURCE_PIN_GROUP_CONFIG;
+
+#define AML_RESOURCE_PIN_GROUP_CONFIG_REVISION    1       /* ACPI 6.2 */
 
 /* restore default alignment */
 
@@ -572,6 +685,11 @@ typedef union aml_resource
     AML_RESOURCE_SPI_SERIALBUS              SpiSerialBus;
     AML_RESOURCE_UART_SERIALBUS             UartSerialBus;
     AML_RESOURCE_COMMON_SERIALBUS           CommonSerialBus;
+    AML_RESOURCE_PIN_FUNCTION               PinFunction;
+    AML_RESOURCE_PIN_CONFIG                 PinConfig;
+    AML_RESOURCE_PIN_GROUP                  PinGroup;
+    AML_RESOURCE_PIN_GROUP_FUNCTION         PinGroupFunction;
+    AML_RESOURCE_PIN_GROUP_CONFIG           PinGroupConfig;
 
     /* Utility overlays */
 
index 1512e5b..7964d0e 100644 (file)
  * Use compiler specific <stdarg.h> is a good practice for even when
  * -nostdinc is specified (i.e., ACPI_USE_STANDARD_HEADERS undefined.
  */
+#ifndef va_arg
+#ifdef ACPI_USE_BUILTIN_STDARG
+typedef __builtin_va_list       va_list;
+#define va_start(v, l)          __builtin_va_start(v, l)
+#define va_end(v)               __builtin_va_end(v)
+#define va_arg(v, l)            __builtin_va_arg(v, l)
+#define va_copy(d, s)           __builtin_va_copy(d, s)
+#else
 #include <stdarg.h>
+#endif
+#endif
 
 #define ACPI_INLINE             __inline__
 
index 113f286..a1790f5 100644 (file)
@@ -48,7 +48,9 @@
  * Use compiler specific <stdarg.h> is a good practice for even when
  * -nostdinc is specified (i.e., ACPI_USE_STANDARD_HEADERS undefined.
  */
+#ifndef va_arg
 #include <stdarg.h>
+#endif
 
 /* Configuration specific to Intel 64-bit C compiler */
 
index 7b5715b..9016712 100644 (file)
@@ -47,6 +47,9 @@
 #include "acnamesp.h"
 #include "acdispat.h"
 
+#ifdef ACPI_ASL_COMPILER
+    #include "acdisasm.h"
+#endif
 
 #define _COMPONENT          ACPI_NAMESPACE
         ACPI_MODULE_NAME    ("nsaccess")
@@ -602,6 +605,30 @@ AcpiNsLookup (
                     CurrentNode));
             }
 
+#ifdef ACPI_ASL_COMPILER
+            /*
+             * If this ACPI name already exists within the namespace as an
+             * external declaration, then mark the external as a conflicting
+             * declaration and proceed to process the current node as if it did
+             * not exist in the namespace. If this node is not processed as
+             * normal, then it could cause improper namespace resolution
+             * by failing to open a new scope.
+             */
+            if (AcpiGbl_DisasmFlag &&
+                (Status == AE_ALREADY_EXISTS) &&
+                ((ThisNode->Flags & ANOBJ_IS_EXTERNAL) ||
+                    (WalkState && WalkState->Opcode == AML_EXTERNAL_OP)))
+            {
+                ThisNode->Flags &= ~ANOBJ_IS_EXTERNAL;
+                ThisNode->Type = (UINT8)ThisSearchType;
+                if (WalkState->Opcode != AML_EXTERNAL_OP)
+                {
+                    AcpiDmMarkExternalConflict (ThisNode);
+                }
+                break;
+            }
+#endif
+
             *ReturnNode = ThisNode;
             return_ACPI_STATUS (Status);
         }
index c82e17f..0ca3514 100644 (file)
@@ -216,10 +216,6 @@ AcpiNsHandleToPathname (
 
     (void) AcpiNsBuildNormalizedPath (Node, Buffer->Pointer,
         RequiredSize, NoTrailing);
-    if (ACPI_FAILURE (Status))
-    {
-        return_ACPI_STATUS (Status);
-    }
 
     ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%s [%X]\n",
         (char *) Buffer->Pointer, (UINT32) RequiredSize));
index 652b19c..284d2f9 100644 (file)
@@ -98,7 +98,7 @@ AcpiNsPrintNodePathname (
             AcpiOsPrintf ("%s ", Message);
         }
 
-        AcpiOsPrintf ("[%s] (Node %p)", (char *) Buffer.Pointer, Node);
+        AcpiOsPrintf ("%s", (char *) Buffer.Pointer);
         ACPI_FREE (Buffer.Pointer);
     }
 }
index 6b2d6fb..1186fa9 100644 (file)
@@ -91,6 +91,8 @@ AcpiEvaluateObjectTyped (
 {
     ACPI_STATUS             Status;
     BOOLEAN                 FreeBufferOnError = FALSE;
+    ACPI_HANDLE             TargetHandle;
+    char                    *FullPathname;
 
 
     ACPI_FUNCTION_TRACE (AcpiEvaluateObjectTyped);
@@ -108,41 +110,56 @@ AcpiEvaluateObjectTyped (
         FreeBufferOnError = TRUE;
     }
 
+    Status = AcpiGetHandle (Handle, Pathname, &TargetHandle);
+    if (ACPI_FAILURE (Status))
+    {
+        return_ACPI_STATUS (Status);
+    }
+
+    FullPathname = AcpiNsGetExternalPathname (TargetHandle);
+    if (!FullPathname)
+    {
+        return_ACPI_STATUS (AE_NO_MEMORY);
+    }
+
     /* Evaluate the object */
 
-    Status = AcpiEvaluateObject (Handle, Pathname,
-        ExternalParams, ReturnBuffer);
+    Status = AcpiEvaluateObject (TargetHandle, NULL, ExternalParams,
+        ReturnBuffer);
     if (ACPI_FAILURE (Status))
     {
-        return_ACPI_STATUS (Status);
+        goto Exit;
     }
 
-    /* Type ANY means "don't care" */
+    /* Type ANY means "don't care about return value type" */
 
     if (ReturnType == ACPI_TYPE_ANY)
     {
-        return_ACPI_STATUS (AE_OK);
+        goto Exit;
     }
 
     if (ReturnBuffer->Length == 0)
     {
         /* Error because caller specifically asked for a return value */
 
-        ACPI_ERROR ((AE_INFO, "No return value"));
-        return_ACPI_STATUS (AE_NULL_OBJECT);
+        ACPI_ERROR ((AE_INFO, "%s did not return any object",
+            FullPathname));
+        Status = AE_NULL_OBJECT;
+        goto Exit;
     }
 
     /* Examine the object type returned from EvaluateObject */
 
     if (((ACPI_OBJECT *) ReturnBuffer->Pointer)->Type == ReturnType)
     {
-        return_ACPI_STATUS (AE_OK);
+        goto Exit;
     }
 
     /* Return object type does not match requested type */
 
     ACPI_ERROR ((AE_INFO,
-        "Incorrect return type [%s] requested [%s]",
+        "Incorrect return type from %s - received [%s], requested [%s]",
+        FullPathname,
         AcpiUtGetTypeName (((ACPI_OBJECT *) ReturnBuffer->Pointer)->Type),
         AcpiUtGetTypeName (ReturnType)));
 
@@ -160,7 +177,11 @@ AcpiEvaluateObjectTyped (
     }
 
     ReturnBuffer->Length = 0;
-    return_ACPI_STATUS (AE_TYPE);
+    Status = AE_TYPE;
+
+Exit:
+    ACPI_FREE (FullPathname);
+    return_ACPI_STATUS (Status);
 }
 
 ACPI_EXPORT_SYMBOL (AcpiEvaluateObjectTyped)
index bcc2aa2..59fc7db 100644 (file)
@@ -129,12 +129,23 @@ AcpiPsGetAmlOpcode (
                 WalkState->Opcode,
                 (UINT32) (AmlOffset + sizeof (ACPI_TABLE_HEADER)));
 
+            ACPI_ERROR ((AE_INFO,
+                "Aborting disassembly, AML byte code is corrupt"));
+
             /* Dump the context surrounding the invalid opcode */
 
             AcpiUtDumpBuffer (((UINT8 *) WalkState->ParserState.Aml - 16),
                 48, DB_BYTE_DISPLAY,
                 (AmlOffset + sizeof (ACPI_TABLE_HEADER) - 16));
             AcpiOsPrintf (" */\n");
+
+            /*
+             * Just abort the disassembly, cannot continue because the
+             * parser is essentially lost. The disassembler can then
+             * randomly fail because an ill-constructed parse tree
+             * can result.
+             */
+            return_ACPI_STATUS (AE_AML_BAD_OPCODE);
 #endif
         }
 
@@ -350,6 +361,10 @@ AcpiPsCreateOp (
     {
         return_ACPI_STATUS (AE_CTRL_PARSE_CONTINUE);
     }
+    if (ACPI_FAILURE (Status))
+    {
+        return_ACPI_STATUS (Status);
+    }
 
     /* Create Op structure and append to parent's argument list */
 
index c355c3d..f7cc9ba 100644 (file)
@@ -337,7 +337,7 @@ const ACPI_OPCODE_INFO    AcpiGbl_AmlOpInfo[AML_NUM_OPCODES] =
 
 /* ACPI 6.0 opcodes */
 
-/* 81 */ ACPI_OP ("External",           ARGP_EXTERNAL_OP,          ARGI_EXTERNAL_OP,           ACPI_TYPE_ANY,               AML_CLASS_EXECUTE,/* ? */  AML_TYPE_EXEC_3A_0T_0R,   AML_FLAGS_EXEC_3A_0T_0R),
+/* 81 */ ACPI_OP ("External",           ARGP_EXTERNAL_OP,          ARGI_EXTERNAL_OP,           ACPI_TYPE_ANY,               AML_CLASS_NAMED_OBJECT,    AML_TYPE_NAMED_SIMPLE,    AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
 /* 82 */ ACPI_OP ("Comment",            ARGP_COMMENT_OP,           ARGI_COMMENT_OP,            ACPI_TYPE_STRING,            AML_CLASS_ARGUMENT,        AML_TYPE_LITERAL,         AML_CONSTANT)
 
 /*! [End] no source code translation !*/
index 112a4fc..1ac7a18 100644 (file)
@@ -56,6 +56,7 @@
 #include "acdispat.h"
 #include "amlcode.h"
 #include "acinterp.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_PARSER
         ACPI_MODULE_NAME    ("psparse")
@@ -556,8 +557,17 @@ AcpiPsParseAml (
             /* Either the method parse or actual execution failed */
 
             AcpiExExitInterpreter ();
-            ACPI_ERROR_METHOD ("Method parse/execution failed",
-                WalkState->MethodNode, NULL, Status);
+            if (Status == AE_ABORT_METHOD)
+            {
+                AcpiNsPrintNodePathname (
+                    WalkState->MethodNode, "Method aborted:");
+                AcpiOsPrintf ("\n");
+            }
+            else
+            {
+                ACPI_ERROR_METHOD ("Method parse/execution failed",
+                    WalkState->MethodNode, NULL, Status);
+            }
             AcpiExEnterInterpreter ();
 
             /* Check for possible multi-thread reentrancy problem */
index 4dc06cd..724d4db 100644 (file)
@@ -363,6 +363,15 @@ AcpiRsGetAmlLength (
 
             break;
 
+        case ACPI_RESOURCE_TYPE_PIN_FUNCTION:
+
+            TotalSize = (ACPI_RS_LENGTH) (TotalSize +
+                (Resource->Data.PinFunction.PinTableLength * 2) +
+                Resource->Data.PinFunction.ResourceSource.StringLength +
+                Resource->Data.PinFunction.VendorLength);
+
+            break;
+
 
         case ACPI_RESOURCE_TYPE_SERIAL_BUS:
 
@@ -375,6 +384,42 @@ AcpiRsGetAmlLength (
 
             break;
 
+        case ACPI_RESOURCE_TYPE_PIN_CONFIG:
+
+            TotalSize = (ACPI_RS_LENGTH) (TotalSize +
+                (Resource->Data.PinConfig.PinTableLength * 2) +
+                Resource->Data.PinConfig.ResourceSource.StringLength +
+                Resource->Data.PinConfig.VendorLength);
+
+            break;
+
+        case ACPI_RESOURCE_TYPE_PIN_GROUP:
+
+            TotalSize = (ACPI_RS_LENGTH) (TotalSize +
+                (Resource->Data.PinGroup.PinTableLength * 2) +
+                Resource->Data.PinGroup.ResourceLabel.StringLength +
+                Resource->Data.PinGroup.VendorLength);
+
+            break;
+
+        case ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION:
+
+            TotalSize = (ACPI_RS_LENGTH) (TotalSize +
+                Resource->Data.PinGroupFunction.ResourceSource.StringLength +
+                Resource->Data.PinGroupFunction.ResourceSourceLabel.StringLength +
+                Resource->Data.PinGroupFunction.VendorLength);
+
+            break;
+
+        case ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG:
+
+            TotalSize = (ACPI_RS_LENGTH) (TotalSize +
+                Resource->Data.PinGroupConfig.ResourceSource.StringLength +
+                Resource->Data.PinGroupConfig.ResourceSourceLabel.StringLength +
+                Resource->Data.PinGroupConfig.VendorLength);
+
+            break;
+
         default:
 
             break;
@@ -560,6 +605,26 @@ AcpiRsGetListLength (
             }
             break;
 
+        case ACPI_RESOURCE_NAME_PIN_FUNCTION:
+
+            /* Vendor data is optional */
+
+            if (AmlResource->PinFunction.VendorLength)
+            {
+                ExtraStructBytes +=
+                    AmlResource->PinFunction.VendorOffset -
+                    AmlResource->PinFunction.PinTableOffset +
+                    AmlResource->PinFunction.VendorLength;
+            }
+            else
+            {
+                ExtraStructBytes +=
+                    AmlResource->LargeHeader.ResourceLength +
+                    sizeof (AML_RESOURCE_LARGE_HEADER) -
+                    AmlResource->PinFunction.PinTableOffset;
+            }
+            break;
+
         case ACPI_RESOURCE_NAME_SERIAL_BUS:
 
             MinimumAmlResourceLength = AcpiGbl_ResourceAmlSerialBusSizes[
@@ -569,6 +634,53 @@ AcpiRsGetListLength (
                 MinimumAmlResourceLength;
             break;
 
+        case ACPI_RESOURCE_NAME_PIN_CONFIG:
+
+            /* Vendor data is optional */
+
+            if (AmlResource->PinConfig.VendorLength)
+            {
+                ExtraStructBytes +=
+                    AmlResource->PinConfig.VendorOffset -
+                    AmlResource->PinConfig.PinTableOffset +
+                    AmlResource->PinConfig.VendorLength;
+            }
+            else
+            {
+                ExtraStructBytes +=
+                    AmlResource->LargeHeader.ResourceLength +
+                    sizeof (AML_RESOURCE_LARGE_HEADER) -
+                    AmlResource->PinConfig.PinTableOffset;
+            }
+            break;
+
+        case ACPI_RESOURCE_NAME_PIN_GROUP:
+
+            ExtraStructBytes +=
+                AmlResource->PinGroup.VendorOffset -
+                AmlResource->PinGroup.PinTableOffset +
+                AmlResource->PinGroup.VendorLength;
+
+            break;
+
+        case ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION:
+
+            ExtraStructBytes +=
+                AmlResource->PinGroupFunction.VendorOffset -
+                AmlResource->PinGroupFunction.ResSourceOffset +
+                AmlResource->PinGroupFunction.VendorLength;
+
+            break;
+
+        case ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG:
+
+            ExtraStructBytes +=
+                AmlResource->PinGroupConfig.VendorOffset -
+                AmlResource->PinGroupConfig.ResSourceOffset +
+                AmlResource->PinGroupConfig.VendorLength;
+
+            break;
+
         default:
 
             break;
index 6be4986..b3604fe 100644 (file)
@@ -107,6 +107,11 @@ static void
 AcpiRsDumpResourceSource (
     ACPI_RESOURCE_SOURCE    *ResourceSource);
 
+static void
+AcpiRsDumpResourceLabel (
+    char                   *Title,
+    ACPI_RESOURCE_LABEL    *ResourceLabel);
+
 static void
 AcpiRsDumpAddressCommon (
     ACPI_RESOURCE_DATA      *Resource);
@@ -423,6 +428,22 @@ AcpiRsDumpDescriptor (
                 ACPI_RESOURCE_SOURCE, Target));
             break;
 
+        case ACPI_RSD_LABEL:
+            /*
+             * ResourceLabel
+             */
+            AcpiRsDumpResourceLabel ("Resource Label", ACPI_CAST_PTR (
+                ACPI_RESOURCE_LABEL, Target));
+            break;
+
+        case ACPI_RSD_SOURCE_LABEL:
+            /*
+             * ResourceSourceLabel
+             */
+            AcpiRsDumpResourceLabel ("Resource Source Label", ACPI_CAST_PTR (
+                ACPI_RESOURCE_LABEL, Target));
+            break;
+
         default:
 
             AcpiOsPrintf ("**** Invalid table opcode [%X] ****\n",
@@ -470,6 +491,32 @@ AcpiRsDumpResourceSource (
 }
 
 
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiRsDumpResourceLabel
+ *
+ * PARAMETERS:  Title              - Title of the dumped resource field
+ *              ResourceLabel      - Pointer to a Resource Label struct
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Common routine for dumping the ResourceLabel
+ *
+ ******************************************************************************/
+
+static void
+AcpiRsDumpResourceLabel (
+    char                   *Title,
+    ACPI_RESOURCE_LABEL    *ResourceLabel)
+{
+    ACPI_FUNCTION_ENTRY ();
+
+    AcpiRsOutString (Title,
+        ResourceLabel->StringPtr ?
+            ResourceLabel->StringPtr : "[Not Specified]");
+}
+
+
 /*******************************************************************************
  *
  * FUNCTION:    AcpiRsDumpAddressCommon
index 489a4f4..ef2b9bf 100644 (file)
@@ -252,6 +252,74 @@ ACPI_RSDUMP_INFO        AcpiRsDumpGpio[16] =
     {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (Gpio.VendorData),                 "VendorData",               NULL},
 };
 
+ACPI_RSDUMP_INFO        AcpiRsDumpPinFunction[10] =
+{
+    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpPinFunction),        "PinFunction",              NULL},
+    {ACPI_RSD_UINT8,    ACPI_RSD_OFFSET (PinFunction.RevisionId),           "RevisionId",               NULL},
+    {ACPI_RSD_UINT8,    ACPI_RSD_OFFSET (PinFunction.PinConfig),            "PinConfig",                AcpiGbl_PpcDecode},
+    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinFunction.Sharable),             "Sharing",                  AcpiGbl_ShrDecode},
+    {ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (PinFunction.FunctionNumber),       "FunctionNumber",           NULL},
+    {ACPI_RSD_SOURCE,   ACPI_RSD_OFFSET (PinFunction.ResourceSource),       "ResourceSource",           NULL},
+    {ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (PinFunction.PinTableLength),       "PinTableLength",           NULL},
+    {ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET (PinFunction.PinTable),             "PinTable",                 NULL},
+    {ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (PinFunction.VendorLength),         "VendorLength",             NULL},
+    {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (PinFunction.VendorData),          "VendorData",               NULL},
+};
+
+ACPI_RSDUMP_INFO        AcpiRsDumpPinConfig[11] =
+{
+    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpPinConfig),          "PinConfig",                NULL},
+    {ACPI_RSD_UINT8,    ACPI_RSD_OFFSET (PinConfig.RevisionId),             "RevisionId",               NULL},
+    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinConfig.ProducerConsumer),       "ProducerConsumer",         AcpiGbl_ConsumeDecode},
+    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinConfig.Sharable),               "Sharing",                  AcpiGbl_ShrDecode},
+    {ACPI_RSD_UINT8,    ACPI_RSD_OFFSET (PinConfig.PinConfigType),          "PinConfigType",            NULL},
+    {ACPI_RSD_UINT32,   ACPI_RSD_OFFSET (PinConfig.PinConfigValue),         "PinConfigValue",           NULL},
+    {ACPI_RSD_SOURCE,   ACPI_RSD_OFFSET (PinConfig.ResourceSource),         "ResourceSource",           NULL},
+    {ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (PinConfig.PinTableLength),         "PinTableLength",           NULL},
+    {ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET (PinConfig.PinTable),               "PinTable",                 NULL},
+    {ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (PinConfig.VendorLength),           "VendorLength",             NULL},
+    {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (PinConfig.VendorData),            "VendorData",               NULL},
+};
+
+ACPI_RSDUMP_INFO        AcpiRsDumpPinGroup[8] =
+{
+    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpPinGroup),           "PinGroup",                 NULL},
+    {ACPI_RSD_UINT8,    ACPI_RSD_OFFSET (PinGroup.RevisionId),              "RevisionId",               NULL},
+    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinGroup.ProducerConsumer),        "ProducerConsumer",         AcpiGbl_ConsumeDecode},
+    {ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (PinGroup.PinTableLength),          "PinTableLength",           NULL},
+    {ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET (PinGroup.PinTable),                "PinTable",                 NULL},
+    {ACPI_RSD_LABEL,    ACPI_RSD_OFFSET (PinGroup.ResourceLabel),           "ResourceLabel",            NULL},
+    {ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (PinGroup.VendorLength),            "VendorLength",             NULL},
+    {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (PinGroup.VendorData),             "VendorData",               NULL},
+};
+
+ACPI_RSDUMP_INFO        AcpiRsDumpPinGroupFunction[9] =
+{
+    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpPinGroupFunction),   "PinGroupFunction",         NULL},
+    {ACPI_RSD_UINT8,    ACPI_RSD_OFFSET (PinGroupFunction.RevisionId),      "RevisionId",               NULL},
+    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinGroupFunction.ProducerConsumer), "ProducerConsumer",        AcpiGbl_ConsumeDecode},
+    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinGroupFunction.Sharable),        "Sharing",                  AcpiGbl_ShrDecode},
+    {ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (PinGroupFunction.FunctionNumber),  "FunctionNumber",           NULL},
+    {ACPI_RSD_SOURCE_LABEL, ACPI_RSD_OFFSET (PinGroupFunction.ResourceSourceLabel), "ResourceSourceLabel", NULL},
+    {ACPI_RSD_SOURCE,   ACPI_RSD_OFFSET (PinGroupFunction.ResourceSource),  "ResourceSource",           NULL},
+    {ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (PinGroupFunction.VendorLength),    "VendorLength",             NULL},
+    {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (PinGroupFunction.VendorData),     "VendorData",               NULL},
+};
+
+ACPI_RSDUMP_INFO        AcpiRsDumpPinGroupConfig[10] =
+{
+    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpPinGroupConfig),     "PinGroupConfig",           NULL},
+    {ACPI_RSD_UINT8,    ACPI_RSD_OFFSET (PinGroupConfig.RevisionId),        "RevisionId",               NULL},
+    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinGroupConfig.ProducerConsumer),  "ProducerConsumer",         AcpiGbl_ConsumeDecode},
+    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (PinGroupConfig.Sharable),          "Sharing",                  AcpiGbl_ShrDecode},
+    {ACPI_RSD_UINT8,    ACPI_RSD_OFFSET (PinGroupConfig.PinConfigType),     "PinConfigType",            NULL},
+    {ACPI_RSD_UINT32,   ACPI_RSD_OFFSET (PinGroupConfig.PinConfigValue),    "PinConfigValue",           NULL},
+    {ACPI_RSD_SOURCE_LABEL, ACPI_RSD_OFFSET (PinGroupConfig.ResourceSourceLabel), "ResourceSourceLabel", NULL},
+    {ACPI_RSD_SOURCE,   ACPI_RSD_OFFSET (PinGroupConfig.ResourceSource),    "ResourceSource",           NULL},
+    {ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (PinGroupConfig.VendorLength),      "VendorLength",             NULL},
+    {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (PinGroupConfig.VendorData),       "VendorData",               NULL},
+};
+
 ACPI_RSDUMP_INFO        AcpiRsDumpFixedDma[4] =
 {
     {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpFixedDma),           "FixedDma",                 NULL},
index b08e218..3f67260 100644 (file)
@@ -84,6 +84,11 @@ ACPI_RSCONVERT_INFO         *AcpiGbl_SetResourceDispatch[] =
     AcpiRsConvertGpio,              /* 0x11, ACPI_RESOURCE_TYPE_GPIO */
     AcpiRsConvertFixedDma,          /* 0x12, ACPI_RESOURCE_TYPE_FIXED_DMA */
     NULL,                           /* 0x13, ACPI_RESOURCE_TYPE_SERIAL_BUS - Use subtype table below */
+    AcpiRsConvertPinFunction,       /* 0x14, ACPI_RESOURCE_TYPE_PIN_FUNCTION */
+    AcpiRsConvertPinConfig,         /* 0x15, ACPI_RESOURCE_TYPE_PIN_CONFIG */
+    AcpiRsConvertPinGroup,          /* 0x16, ACPI_RESOURCE_TYPE_PIN_GROUP */
+    AcpiRsConvertPinGroupFunction,  /* 0x17, ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */
+    AcpiRsConvertPinGroupConfig,    /* 0x18, ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */
 };
 
 /* Dispatch tables for AML-to-resource (Get Resource) conversion functions */
@@ -124,8 +129,12 @@ ACPI_RSCONVERT_INFO         *AcpiGbl_GetResourceDispatch[] =
     AcpiRsConvertAddress64,         /* 0x0A, ACPI_RESOURCE_NAME_ADDRESS64 */
     AcpiRsConvertExtAddress64,      /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */
     AcpiRsConvertGpio,              /* 0x0C, ACPI_RESOURCE_NAME_GPIO */
-    NULL,                           /* 0x0D, Reserved */
+    AcpiRsConvertPinFunction,       /* 0x0D, ACPI_RESOURCE_NAME_PIN_FUNCTION */
     NULL,                           /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS - Use subtype table below */
+    AcpiRsConvertPinConfig,         /* 0x0F, ACPI_RESOURCE_NAME_PIN_CONFIG */
+    AcpiRsConvertPinGroup,          /* 0x10, ACPI_RESOURCE_NAME_PIN_GROUP */
+    AcpiRsConvertPinGroupFunction,  /* 0x11, ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION */
+    AcpiRsConvertPinGroupConfig,    /* 0x12, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG */
 };
 
 /* Subtype table for SerialBus -- I2C, SPI, and UART */
@@ -165,6 +174,11 @@ ACPI_RSDUMP_INFO            *AcpiGbl_DumpResourceDispatch[] =
     AcpiRsDumpGpio,                 /* ACPI_RESOURCE_TYPE_GPIO */
     AcpiRsDumpFixedDma,             /* ACPI_RESOURCE_TYPE_FIXED_DMA */
     NULL,                           /* ACPI_RESOURCE_TYPE_SERIAL_BUS */
+    AcpiRsDumpPinFunction,          /* ACPI_RESOURCE_TYPE_PIN_FUNCTION */
+    AcpiRsDumpPinConfig,            /* ACPI_RESOURCE_TYPE_PIN_CONFIG */
+    AcpiRsDumpPinGroup,             /* ACPI_RESOURCE_TYPE_PIN_GROUP */
+    AcpiRsDumpPinGroupFunction,     /* ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */
+    AcpiRsDumpPinGroupConfig,       /* ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */
 };
 
 ACPI_RSDUMP_INFO            *AcpiGbl_DumpSerialBusDispatch[] =
@@ -204,6 +218,11 @@ const UINT8                 AcpiGbl_AmlResourceSizes[] =
     sizeof (AML_RESOURCE_GPIO),             /* ACPI_RESOURCE_TYPE_GPIO */
     sizeof (AML_RESOURCE_FIXED_DMA),        /* ACPI_RESOURCE_TYPE_FIXED_DMA */
     sizeof (AML_RESOURCE_COMMON_SERIALBUS), /* ACPI_RESOURCE_TYPE_SERIAL_BUS */
+    sizeof (AML_RESOURCE_PIN_FUNCTION),     /* ACPI_RESOURCE_TYPE_PIN_FUNCTION */
+    sizeof (AML_RESOURCE_PIN_CONFIG),       /* ACPI_RESOURCE_TYPE_PIN_CONFIG */
+    sizeof (AML_RESOURCE_PIN_GROUP),        /* ACPI_RESOURCE_TYPE_PIN_GROUP */
+    sizeof (AML_RESOURCE_PIN_GROUP_FUNCTION), /* ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION */
+    sizeof (AML_RESOURCE_PIN_GROUP_CONFIG), /* ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG */
 };
 
 
@@ -243,7 +262,12 @@ const UINT8                 AcpiGbl_ResourceStructSizes[] =
     ACPI_RS_SIZE (ACPI_RESOURCE_ADDRESS64),
     ACPI_RS_SIZE (ACPI_RESOURCE_EXTENDED_ADDRESS64),
     ACPI_RS_SIZE (ACPI_RESOURCE_GPIO),
-    ACPI_RS_SIZE (ACPI_RESOURCE_COMMON_SERIALBUS)
+    ACPI_RS_SIZE (ACPI_RESOURCE_PIN_FUNCTION),
+    ACPI_RS_SIZE (ACPI_RESOURCE_COMMON_SERIALBUS),
+    ACPI_RS_SIZE (ACPI_RESOURCE_PIN_CONFIG),
+    ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP),
+    ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_FUNCTION),
+    ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_CONFIG),
 };
 
 const UINT8                 AcpiGbl_AmlResourceSerialBusSizes[] =
index 71374b5..eff1732 100644 (file)
@@ -597,10 +597,7 @@ AcpiRsConvertResourceToAml (
 
             /* Set vendor offset only if there is vendor data */
 
-            if (Resource->Data.Gpio.VendorLength)
-            {
-                ACPI_SET16 (Target, AmlLength);
-            }
+            ACPI_SET16 (Target, AmlLength);
 
             AcpiRsSetResourceLength (AmlLength, Aml);
             break;
index a17fb73..9adbc66 100644 (file)
@@ -146,6 +146,78 @@ ACPI_RSCONVERT_INFO     AcpiRsConvertGpio[18] =
                         0},
 };
 
+/*******************************************************************************
+ *
+ * AcpiRsConvertPinfunction
+ *
+ ******************************************************************************/
+
+ACPI_RSCONVERT_INFO     AcpiRsConvertPinFunction[13] =
+{
+    {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_PIN_FUNCTION,
+                        ACPI_RS_SIZE (ACPI_RESOURCE_PIN_FUNCTION),
+                        ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinFunction)},
+
+    {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_PIN_FUNCTION,
+                        sizeof (AML_RESOURCE_PIN_FUNCTION),
+                        0},
+
+    {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinFunction.RevisionId),
+                        AML_OFFSET (PinFunction.RevisionId),
+                        1},
+
+    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinFunction.Sharable),
+                        AML_OFFSET (PinFunction.Flags),
+                        0},
+
+    {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinFunction.PinConfig),
+                        AML_OFFSET (PinFunction.PinConfig),
+                        1},
+
+    {ACPI_RSC_MOVE16,   ACPI_RS_OFFSET (Data.PinFunction.FunctionNumber),
+                        AML_OFFSET (PinFunction.FunctionNumber),
+                        2},
+
+    /* Pin Table */
+
+    /*
+     * It is OK to use GPIO operations here because none of them refer GPIO
+     * structures directly but instead use offsets given here.
+     */
+
+    {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.PinFunction.PinTableLength),
+                        AML_OFFSET (PinFunction.PinTableOffset),
+                        AML_OFFSET (PinFunction.ResSourceOffset)},
+
+    {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.PinFunction.PinTable),
+                        AML_OFFSET (PinFunction.PinTableOffset),
+                        0},
+
+    /* Resource Source */
+
+    {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinFunction.ResourceSource.Index),
+                        AML_OFFSET (PinFunction.ResSourceIndex),
+                        1},
+
+    {ACPI_RSC_COUNT_GPIO_RES,  ACPI_RS_OFFSET (Data.PinFunction.ResourceSource.StringLength),
+                        AML_OFFSET (PinFunction.ResSourceOffset),
+                        AML_OFFSET (PinFunction.VendorOffset)},
+
+    {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinFunction.ResourceSource.StringPtr),
+                        AML_OFFSET (PinFunction.ResSourceOffset),
+                        0},
+
+    /* Vendor Data */
+
+    {ACPI_RSC_COUNT_GPIO_VEN,   ACPI_RS_OFFSET (Data.PinFunction.VendorLength),
+                        AML_OFFSET (PinFunction.VendorLength),
+                        1},
+
+    {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinFunction.VendorData),
+                        AML_OFFSET (PinFunction.VendorOffset),
+                        0},
+};
+
 
 /*******************************************************************************
  *
@@ -437,3 +509,278 @@ ACPI_RSCONVERT_INFO     AcpiRsConvertUartSerialBus[23] =
                         AML_OFFSET (UartSerialBus.DefaultBaudRate),
                         1},
 };
+
+
+/*******************************************************************************
+ *
+ * AcpiRsConvertPinConfig
+ *
+ ******************************************************************************/
+
+ACPI_RSCONVERT_INFO     AcpiRsConvertPinConfig[14] =
+{
+    {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_PIN_CONFIG,
+                        ACPI_RS_SIZE (ACPI_RESOURCE_PIN_CONFIG),
+                        ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinConfig)},
+
+    {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_PIN_CONFIG,
+                        sizeof (AML_RESOURCE_PIN_CONFIG),
+                        0},
+
+    {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinConfig.RevisionId),
+                        AML_OFFSET (PinConfig.RevisionId),
+                        1},
+
+    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinConfig.Sharable),
+                        AML_OFFSET (PinConfig.Flags),
+                        0},
+
+    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinConfig.ProducerConsumer),
+                        AML_OFFSET (PinConfig.Flags),
+                        1},
+
+    {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinConfig.PinConfigType),
+                        AML_OFFSET (PinConfig.PinConfigType),
+                        1},
+
+    {ACPI_RSC_MOVE32,   ACPI_RS_OFFSET (Data.PinConfig.PinConfigValue),
+                        AML_OFFSET (PinConfig.PinConfigValue),
+                        1},
+
+    /* Pin Table */
+
+    /*
+     * It is OK to use GPIO operations here because none of them refer GPIO
+     * structures directly but instead use offsets given here.
+     */
+
+    {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.PinConfig.PinTableLength),
+                        AML_OFFSET (PinConfig.PinTableOffset),
+                        AML_OFFSET (PinConfig.ResSourceOffset)},
+
+    {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.PinConfig.PinTable),
+                        AML_OFFSET (PinConfig.PinTableOffset),
+                        0},
+
+    /* Resource Source */
+
+    {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.Index),
+                        AML_OFFSET (PinConfig.ResSourceIndex),
+                        1},
+
+    {ACPI_RSC_COUNT_GPIO_RES,  ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.StringLength),
+                        AML_OFFSET (PinConfig.ResSourceOffset),
+                        AML_OFFSET (PinConfig.VendorOffset)},
+
+    {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.StringPtr),
+                        AML_OFFSET (PinConfig.ResSourceOffset),
+                        0},
+
+    /* Vendor Data */
+
+    {ACPI_RSC_COUNT_GPIO_VEN,   ACPI_RS_OFFSET (Data.PinConfig.VendorLength),
+                        AML_OFFSET (PinConfig.VendorLength),
+                        1},
+
+    {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinConfig.VendorData),
+                        AML_OFFSET (PinConfig.VendorOffset),
+                        0},
+};
+
+/*******************************************************************************
+ *
+ * AcpiRsConvertPinGroup
+ *
+ ******************************************************************************/
+
+ACPI_RSCONVERT_INFO     AcpiRsConvertPinGroup[10] =
+{
+    {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_PIN_GROUP,
+                        ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP),
+                        ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroup)},
+
+    {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_PIN_GROUP,
+                        sizeof (AML_RESOURCE_PIN_GROUP),
+                        0},
+
+    {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinGroup.RevisionId),
+                        AML_OFFSET (PinGroup.RevisionId),
+                        1},
+
+    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroup.ProducerConsumer),
+                        AML_OFFSET (PinGroup.Flags),
+                        0},
+
+    /* Pin Table */
+
+    /*
+     * It is OK to use GPIO operations here because none of them refer GPIO
+     * structures directly but instead use offsets given here.
+     */
+
+    {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.PinGroup.PinTableLength),
+                        AML_OFFSET (PinGroup.PinTableOffset),
+                        AML_OFFSET (PinGroup.LabelOffset)},
+
+    {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.PinGroup.PinTable),
+                        AML_OFFSET (PinGroup.PinTableOffset),
+                        0},
+
+    /* Resource Label */
+
+    {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroup.ResourceLabel.StringLength),
+                        AML_OFFSET (PinGroup.LabelOffset),
+                        AML_OFFSET (PinGroup.VendorOffset)},
+
+    {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroup.ResourceLabel.StringPtr),
+                        AML_OFFSET (PinGroup.LabelOffset),
+                        0},
+
+    /* Vendor Data */
+
+    {ACPI_RSC_COUNT_GPIO_VEN,   ACPI_RS_OFFSET (Data.PinGroup.VendorLength),
+                        AML_OFFSET (PinGroup.VendorLength),
+                        1},
+
+    {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinGroup.VendorData),
+                        AML_OFFSET (PinGroup.VendorOffset),
+                        0},
+};
+
+/*******************************************************************************
+ *
+ * AcpiRsConvertPinGroupFunction
+ *
+ ******************************************************************************/
+
+ACPI_RSCONVERT_INFO     AcpiRsConvertPinGroupFunction[13] =
+{
+    {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION,
+                        ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_FUNCTION),
+                        ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroupFunction)},
+
+    {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION,
+                        sizeof (AML_RESOURCE_PIN_GROUP_FUNCTION),
+                        0},
+
+    {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinGroupFunction.RevisionId),
+                        AML_OFFSET (PinGroupFunction.RevisionId),
+                        1},
+
+    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupFunction.Sharable),
+                        AML_OFFSET (PinGroupFunction.Flags),
+                        0},
+
+    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupFunction.ProducerConsumer),
+                        AML_OFFSET (PinGroupFunction.Flags),
+                        1},
+
+    {ACPI_RSC_MOVE16,   ACPI_RS_OFFSET (Data.PinGroupFunction.FunctionNumber),
+                        AML_OFFSET (PinGroupFunction.FunctionNumber),
+                        1},
+
+    /* Resource Source */
+
+    {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.Index),
+                        AML_OFFSET (PinGroupFunction.ResSourceIndex),
+                        1},
+
+    {ACPI_RSC_COUNT_GPIO_RES,  ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.StringLength),
+                        AML_OFFSET (PinGroupFunction.ResSourceOffset),
+                        AML_OFFSET (PinGroupFunction.ResSourceLabelOffset)},
+
+    {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.StringPtr),
+                        AML_OFFSET (PinGroupFunction.ResSourceOffset),
+                        0},
+
+    /* Resource Source Label */
+
+    {ACPI_RSC_COUNT_GPIO_RES,  ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSourceLabel.StringLength),
+                        AML_OFFSET (PinGroupFunction.ResSourceLabelOffset),
+                        AML_OFFSET (PinGroupFunction.VendorOffset)},
+
+    {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSourceLabel.StringPtr),
+                        AML_OFFSET (PinGroupFunction.ResSourceLabelOffset),
+                        0},
+
+    /* Vendor Data */
+
+    {ACPI_RSC_COUNT_GPIO_VEN,   ACPI_RS_OFFSET (Data.PinGroupFunction.VendorLength),
+                        AML_OFFSET (PinGroupFunction.VendorLength),
+                        1},
+
+    {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinGroupFunction.VendorData),
+                        AML_OFFSET (PinGroupFunction.VendorOffset),
+                        0},
+};
+
+/*******************************************************************************
+ *
+ * AcpiRsConvertPinGroupConfig
+ *
+ ******************************************************************************/
+
+ACPI_RSCONVERT_INFO     AcpiRsConvertPinGroupConfig[14] =
+{
+    {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG,
+                        ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_CONFIG),
+                        ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroupConfig)},
+
+    {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG,
+                        sizeof (AML_RESOURCE_PIN_GROUP_CONFIG),
+                        0},
+
+    {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinGroupConfig.RevisionId),
+                        AML_OFFSET (PinGroupConfig.RevisionId),
+                        1},
+
+    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupConfig.Sharable),
+                        AML_OFFSET (PinGroupConfig.Flags),
+                        0},
+
+    {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupConfig.ProducerConsumer),
+                        AML_OFFSET (PinGroupConfig.Flags),
+                        1},
+
+    {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinGroupConfig.PinConfigType),
+                        AML_OFFSET (PinGroupConfig.PinConfigType),
+                        1},
+
+    {ACPI_RSC_MOVE32,   ACPI_RS_OFFSET (Data.PinGroupConfig.PinConfigValue),
+                        AML_OFFSET (PinGroupConfig.PinConfigValue),
+                        1},
+
+    /* Resource Source */
+
+    {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.Index),
+                        AML_OFFSET (PinGroupConfig.ResSourceIndex),
+                        1},
+
+    {ACPI_RSC_COUNT_GPIO_RES,  ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.StringLength),
+                        AML_OFFSET (PinGroupConfig.ResSourceOffset),
+                        AML_OFFSET (PinGroupConfig.ResSourceLabelOffset)},
+
+    {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.StringPtr),
+                        AML_OFFSET (PinGroupConfig.ResSourceOffset),
+                        0},
+
+    /* Resource Source Label */
+
+    {ACPI_RSC_COUNT_GPIO_RES,  ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSourceLabel.StringLength),
+                        AML_OFFSET (PinGroupConfig.ResSourceLabelOffset),
+                        AML_OFFSET (PinGroupConfig.VendorOffset)},
+
+    {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSourceLabel.StringPtr),
+                        AML_OFFSET (PinGroupConfig.ResSourceLabelOffset),
+                        0},
+
+    /* Vendor Data */
+
+    {ACPI_RSC_COUNT_GPIO_VEN,   ACPI_RS_OFFSET (Data.PinGroupConfig.VendorLength),
+                        AML_OFFSET (PinGroupConfig.VendorLength),
+                        1},
+
+    {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinGroupConfig.VendorData),
+                        AML_OFFSET (PinGroupConfig.VendorOffset),
+                        0},
+};
index acec947..4411979 100644 (file)
@@ -489,8 +489,8 @@ AcpiTbCreateLocalFadt (
  * The 64-bit X fields are optional extensions to the original 32-bit FADT
  * V1.0 fields. Even if they are present in the FADT, they are optional and
  * are unused if the BIOS sets them to zero. Therefore, we must copy/expand
- * 32-bit V1.0 fields to the 64-bit X fields if the the 64-bit X field is
- * originally zero.
+ * 32-bit V1.0 fields to the 64-bit X fields if the 64-bit X field is originally
+ * zero.
  *
  * For ACPI 1.0 FADTs (that contain no 64-bit addresses), all 32-bit address
  * fields are expanded to the corresponding 64-bit X fields in the internal
index 904dca8..006e8d9 100644 (file)
@@ -149,9 +149,9 @@ AcpiTbCheckDsdtHeader (
  *
  * FUNCTION:    AcpiTbCopyDsdt
  *
- * PARAMETERS:  TableDesc           - Installed table to copy
+ * PARAMETERS:  TableIndex          - Index of installed table to copy
  *
- * RETURN:      None
+ * RETURN:      The copied DSDT
  *
  * DESCRIPTION: Implements a subsystem option to copy the DSDT to local memory.
  *              Some very bad BIOSs are known to either corrupt the DSDT or
@@ -260,7 +260,7 @@ AcpiTbGetRootTableEntry (
  *
  * FUNCTION:    AcpiTbParseRootTable
  *
- * PARAMETERS:  Rsdp                    - Pointer to the RSDP
+ * PARAMETERS:  RsdpAddress         - Pointer to the RSDP
  *
  * RETURN:      Status
  *
index 80ca7f6..16b70a9 100644 (file)
@@ -521,8 +521,9 @@ static const char           *AcpiGbl_GenericNotify[ACPI_GENERIC_NOTIFY_MAX + 1]
     /* 09 */ "Device PLD Check",
     /* 0A */ "Reserved",
     /* 0B */ "System Locality Update",
-    /* 0C */ "Shutdown Request", /* Reserved in ACPI 6.0 */
-    /* 0D */ "System Resource Affinity Update"
+    /* 0C */ "Reserved (was previously Shutdown Request)",  /* Reserved in ACPI 6.0 */
+    /* 0D */ "System Resource Affinity Update",
+    /* 0E */ "Heterogeneous Memory Attributes Update"       /* ACPI 6.2 */
 };
 
 static const char           *AcpiGbl_DeviceNotify[5] =
index cfe9d76..40cdff6 100644 (file)
@@ -117,14 +117,20 @@ AcpiUtAllocateOwnerId (
                 break;
             }
 
-            if (!(AcpiGbl_OwnerIdMask[j] & (1 << k)))
+            /*
+             * Note: the UINT32 cast ensures that 1 is stored as a unsigned
+             * integer. Omitting the cast may result in 1 being stored as an
+             * int. Some compilers or runtime error detection may flag this as
+             * an error.
+             */
+            if (!(AcpiGbl_OwnerIdMask[j] & ((UINT32) 1 << k)))
             {
                 /*
                  * Found a free ID. The actual ID is the bit index plus one,
                  * making zero an invalid Owner ID. Save this as the last ID
                  * allocated and update the global ID mask.
                  */
-                AcpiGbl_OwnerIdMask[j] |= (1 << k);
+                AcpiGbl_OwnerIdMask[j] |= ((UINT32) 1 << k);
 
                 AcpiGbl_LastOwnerIdIndex = (UINT8) j;
                 AcpiGbl_NextOwnerIdOffset = (UINT8) (k + 1);
@@ -220,7 +226,7 @@ AcpiUtReleaseOwnerId (
     /* Decode ID to index/offset pair */
 
     Index = ACPI_DIV_32 (OwnerId);
-    Bit = 1 << ACPI_MOD_32 (OwnerId);
+    Bit = (UINT32) 1 << ACPI_MOD_32 (OwnerId);
 
     /* Free the owner ID only if it is valid */
 
diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utresdecode.c b/reactos/drivers/bus/acpi/acpica/utilities/utresdecode.c
new file mode 100644 (file)
index 0000000..c221600
--- /dev/null
@@ -0,0 +1,353 @@
+/*******************************************************************************
+ *
+ * Module Name: utresdecode - Resource descriptor keyword strings
+ *
+ ******************************************************************************/
+
+/*
+ * Copyright (C) 2000 - 2017, Intel Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *    substantially similar to the "NO WARRANTY" disclaimer below
+ *    ("Disclaimer") and any redistribution must be conditioned upon
+ *    including a substantially similar Disclaimer requirement for further
+ *    binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ *    of any contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGES.
+ */
+
+#include "acpi.h"
+#include "accommon.h"
+#include "acresrc.h"
+
+
+#define _COMPONENT          ACPI_UTILITIES
+        ACPI_MODULE_NAME    ("utresdecode")
+
+
+#if defined (ACPI_DEBUG_OUTPUT) || \
+    defined (ACPI_DISASSEMBLER) || \
+    defined (ACPI_DEBUGGER)
+
+/*
+ * Strings used to decode resource descriptors.
+ * Used by both the disassembler and the debugger resource dump routines
+ */
+const char                      *AcpiGbl_BmDecode[] =
+{
+    "NotBusMaster",
+    "BusMaster"
+};
+
+const char                      *AcpiGbl_ConfigDecode[] =
+{
+    "0 - Good Configuration",
+    "1 - Acceptable Configuration",
+    "2 - Suboptimal Configuration",
+    "3 - ***Invalid Configuration***",
+};
+
+const char                      *AcpiGbl_ConsumeDecode[] =
+{
+    "ResourceProducer",
+    "ResourceConsumer"
+};
+
+const char                      *AcpiGbl_DecDecode[] =
+{
+    "PosDecode",
+    "SubDecode"
+};
+
+const char                      *AcpiGbl_HeDecode[] =
+{
+    "Level",
+    "Edge"
+};
+
+const char                      *AcpiGbl_IoDecode[] =
+{
+    "Decode10",
+    "Decode16"
+};
+
+const char                      *AcpiGbl_LlDecode[] =
+{
+    "ActiveHigh",
+    "ActiveLow",
+    "ActiveBoth",
+    "Reserved"
+};
+
+const char                      *AcpiGbl_MaxDecode[] =
+{
+    "MaxNotFixed",
+    "MaxFixed"
+};
+
+const char                      *AcpiGbl_MemDecode[] =
+{
+    "NonCacheable",
+    "Cacheable",
+    "WriteCombining",
+    "Prefetchable"
+};
+
+const char                      *AcpiGbl_MinDecode[] =
+{
+    "MinNotFixed",
+    "MinFixed"
+};
+
+const char                      *AcpiGbl_MtpDecode[] =
+{
+    "AddressRangeMemory",
+    "AddressRangeReserved",
+    "AddressRangeACPI",
+    "AddressRangeNVS"
+};
+
+const char                      *AcpiGbl_RngDecode[] =
+{
+    "InvalidRanges",
+    "NonISAOnlyRanges",
+    "ISAOnlyRanges",
+    "EntireRange"
+};
+
+const char                      *AcpiGbl_RwDecode[] =
+{
+    "ReadOnly",
+    "ReadWrite"
+};
+
+const char                      *AcpiGbl_ShrDecode[] =
+{
+    "Exclusive",
+    "Shared",
+    "ExclusiveAndWake",         /* ACPI 5.0 */
+    "SharedAndWake"             /* ACPI 5.0 */
+};
+
+const char                      *AcpiGbl_SizDecode[] =
+{
+    "Transfer8",
+    "Transfer8_16",
+    "Transfer16",
+    "InvalidSize"
+};
+
+const char                      *AcpiGbl_TrsDecode[] =
+{
+    "DenseTranslation",
+    "SparseTranslation"
+};
+
+const char                      *AcpiGbl_TtpDecode[] =
+{
+    "TypeStatic",
+    "TypeTranslation"
+};
+
+const char                      *AcpiGbl_TypDecode[] =
+{
+    "Compatibility",
+    "TypeA",
+    "TypeB",
+    "TypeF"
+};
+
+const char                      *AcpiGbl_PpcDecode[] =
+{
+    "PullDefault",
+    "PullUp",
+    "PullDown",
+    "PullNone"
+};
+
+const char                      *AcpiGbl_IorDecode[] =
+{
+    "IoRestrictionNone",
+    "IoRestrictionInputOnly",
+    "IoRestrictionOutputOnly",
+    "IoRestrictionNoneAndPreserve"
+};
+
+const char                      *AcpiGbl_DtsDecode[] =
+{
+    "Width8bit",
+    "Width16bit",
+    "Width32bit",
+    "Width64bit",
+    "Width128bit",
+    "Width256bit",
+};
+
+/* GPIO connection type */
+
+const char                      *AcpiGbl_CtDecode[] =
+{
+    "Interrupt",
+    "I/O"
+};
+
+/* Serial bus type */
+
+const char                      *AcpiGbl_SbtDecode[] =
+{
+    "/* UNKNOWN serial bus type */",
+    "I2C",
+    "SPI",
+    "UART"
+};
+
+/* I2C serial bus access mode */
+
+const char                      *AcpiGbl_AmDecode[] =
+{
+    "AddressingMode7Bit",
+    "AddressingMode10Bit"
+};
+
+/* I2C serial bus slave mode */
+
+const char                      *AcpiGbl_SmDecode[] =
+{
+    "ControllerInitiated",
+    "DeviceInitiated"
+};
+
+/* SPI serial bus wire mode */
+
+const char                      *AcpiGbl_WmDecode[] =
+{
+    "FourWireMode",
+    "ThreeWireMode"
+};
+
+/* SPI serial clock phase */
+
+const char                      *AcpiGbl_CphDecode[] =
+{
+    "ClockPhaseFirst",
+    "ClockPhaseSecond"
+};
+
+/* SPI serial bus clock polarity */
+
+const char                      *AcpiGbl_CpoDecode[] =
+{
+    "ClockPolarityLow",
+    "ClockPolarityHigh"
+};
+
+/* SPI serial bus device polarity */
+
+const char                      *AcpiGbl_DpDecode[] =
+{
+    "PolarityLow",
+    "PolarityHigh"
+};
+
+/* UART serial bus endian */
+
+const char                      *AcpiGbl_EdDecode[] =
+{
+    "LittleEndian",
+    "BigEndian"
+};
+
+/* UART serial bus bits per byte */
+
+const char                      *AcpiGbl_BpbDecode[] =
+{
+    "DataBitsFive",
+    "DataBitsSix",
+    "DataBitsSeven",
+    "DataBitsEight",
+    "DataBitsNine",
+    "/* UNKNOWN Bits per byte */",
+    "/* UNKNOWN Bits per byte */",
+    "/* UNKNOWN Bits per byte */"
+};
+
+/* UART serial bus stop bits */
+
+const char                      *AcpiGbl_SbDecode[] =
+{
+    "StopBitsZero",
+    "StopBitsOne",
+    "StopBitsOnePlusHalf",
+    "StopBitsTwo"
+};
+
+/* UART serial bus flow control */
+
+const char                      *AcpiGbl_FcDecode[] =
+{
+    "FlowControlNone",
+    "FlowControlHardware",
+    "FlowControlXON",
+    "/* UNKNOWN flow control keyword */"
+};
+
+/* UART serial bus parity type */
+
+const char                      *AcpiGbl_PtDecode[] =
+{
+    "ParityTypeNone",
+    "ParityTypeEven",
+    "ParityTypeOdd",
+    "ParityTypeMark",
+    "ParityTypeSpace",
+    "/* UNKNOWN parity keyword */",
+    "/* UNKNOWN parity keyword */",
+    "/* UNKNOWN parity keyword */"
+};
+
+/* PinConfig type */
+
+const char                      *AcpiGbl_PtypDecode[] =
+{
+    "Default",
+    "Bias Pull-up",
+    "Bias Pull-down",
+    "Bias Default",
+    "Bias Disable",
+    "Bias High Impedance",
+    "Bias Bus Hold",
+    "Drive Open Drain",
+    "Drive Open Source",
+    "Drive Push Pull",
+    "Drive Strength",
+    "Slew Rate",
+    "Input Debounce",
+    "Input Schmitt Trigger",
+};
+
+#endif
index f3cd77c..2a32078 100644 (file)
         ACPI_MODULE_NAME    ("utresrc")
 
 
-#if defined(ACPI_DEBUG_OUTPUT) || defined (ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
-
-/*
- * Strings used to decode resource descriptors.
- * Used by both the disassembler and the debugger resource dump routines
- */
-const char                      *AcpiGbl_BmDecode[] =
-{
-    "NotBusMaster",
-    "BusMaster"
-};
-
-const char                      *AcpiGbl_ConfigDecode[] =
-{
-    "0 - Good Configuration",
-    "1 - Acceptable Configuration",
-    "2 - Suboptimal Configuration",
-    "3 - ***Invalid Configuration***",
-};
-
-const char                      *AcpiGbl_ConsumeDecode[] =
-{
-    "ResourceProducer",
-    "ResourceConsumer"
-};
-
-const char                      *AcpiGbl_DecDecode[] =
-{
-    "PosDecode",
-    "SubDecode"
-};
-
-const char                      *AcpiGbl_HeDecode[] =
-{
-    "Level",
-    "Edge"
-};
-
-const char                      *AcpiGbl_IoDecode[] =
-{
-    "Decode10",
-    "Decode16"
-};
-
-const char                      *AcpiGbl_LlDecode[] =
-{
-    "ActiveHigh",
-    "ActiveLow",
-    "ActiveBoth",
-    "Reserved"
-};
-
-const char                      *AcpiGbl_MaxDecode[] =
-{
-    "MaxNotFixed",
-    "MaxFixed"
-};
-
-const char                      *AcpiGbl_MemDecode[] =
-{
-    "NonCacheable",
-    "Cacheable",
-    "WriteCombining",
-    "Prefetchable"
-};
-
-const char                      *AcpiGbl_MinDecode[] =
-{
-    "MinNotFixed",
-    "MinFixed"
-};
-
-const char                      *AcpiGbl_MtpDecode[] =
-{
-    "AddressRangeMemory",
-    "AddressRangeReserved",
-    "AddressRangeACPI",
-    "AddressRangeNVS"
-};
-
-const char                      *AcpiGbl_RngDecode[] =
-{
-    "InvalidRanges",
-    "NonISAOnlyRanges",
-    "ISAOnlyRanges",
-    "EntireRange"
-};
-
-const char                      *AcpiGbl_RwDecode[] =
-{
-    "ReadOnly",
-    "ReadWrite"
-};
-
-const char                      *AcpiGbl_ShrDecode[] =
-{
-    "Exclusive",
-    "Shared",
-    "ExclusiveAndWake",         /* ACPI 5.0 */
-    "SharedAndWake"             /* ACPI 5.0 */
-};
-
-const char                      *AcpiGbl_SizDecode[] =
-{
-    "Transfer8",
-    "Transfer8_16",
-    "Transfer16",
-    "InvalidSize"
-};
-
-const char                      *AcpiGbl_TrsDecode[] =
-{
-    "DenseTranslation",
-    "SparseTranslation"
-};
-
-const char                      *AcpiGbl_TtpDecode[] =
-{
-    "TypeStatic",
-    "TypeTranslation"
-};
-
-const char                      *AcpiGbl_TypDecode[] =
-{
-    "Compatibility",
-    "TypeA",
-    "TypeB",
-    "TypeF"
-};
-
-const char                      *AcpiGbl_PpcDecode[] =
-{
-    "PullDefault",
-    "PullUp",
-    "PullDown",
-    "PullNone"
-};
-
-const char                      *AcpiGbl_IorDecode[] =
-{
-    "IoRestrictionNone",
-    "IoRestrictionInputOnly",
-    "IoRestrictionOutputOnly",
-    "IoRestrictionNoneAndPreserve"
-};
-
-const char                      *AcpiGbl_DtsDecode[] =
-{
-    "Width8bit",
-    "Width16bit",
-    "Width32bit",
-    "Width64bit",
-    "Width128bit",
-    "Width256bit",
-};
-
-/* GPIO connection type */
-
-const char                      *AcpiGbl_CtDecode[] =
-{
-    "Interrupt",
-    "I/O"
-};
-
-/* Serial bus type */
-
-const char                      *AcpiGbl_SbtDecode[] =
-{
-    "/* UNKNOWN serial bus type */",
-    "I2C",
-    "SPI",
-    "UART"
-};
-
-/* I2C serial bus access mode */
-
-const char                      *AcpiGbl_AmDecode[] =
-{
-    "AddressingMode7Bit",
-    "AddressingMode10Bit"
-};
-
-/* I2C serial bus slave mode */
-
-const char                      *AcpiGbl_SmDecode[] =
-{
-    "ControllerInitiated",
-    "DeviceInitiated"
-};
-
-/* SPI serial bus wire mode */
-
-const char                      *AcpiGbl_WmDecode[] =
-{
-    "FourWireMode",
-    "ThreeWireMode"
-};
-
-/* SPI serial clock phase */
-
-const char                      *AcpiGbl_CphDecode[] =
-{
-    "ClockPhaseFirst",
-    "ClockPhaseSecond"
-};
-
-/* SPI serial bus clock polarity */
-
-const char                      *AcpiGbl_CpoDecode[] =
-{
-    "ClockPolarityLow",
-    "ClockPolarityHigh"
-};
-
-/* SPI serial bus device polarity */
-
-const char                      *AcpiGbl_DpDecode[] =
-{
-    "PolarityLow",
-    "PolarityHigh"
-};
-
-/* UART serial bus endian */
-
-const char                      *AcpiGbl_EdDecode[] =
-{
-    "LittleEndian",
-    "BigEndian"
-};
-
-/* UART serial bus bits per byte */
-
-const char                      *AcpiGbl_BpbDecode[] =
-{
-    "DataBitsFive",
-    "DataBitsSix",
-    "DataBitsSeven",
-    "DataBitsEight",
-    "DataBitsNine",
-    "/* UNKNOWN Bits per byte */",
-    "/* UNKNOWN Bits per byte */",
-    "/* UNKNOWN Bits per byte */"
-};
-
-/* UART serial bus stop bits */
-
-const char                      *AcpiGbl_SbDecode[] =
-{
-    "StopBitsZero",
-    "StopBitsOne",
-    "StopBitsOnePlusHalf",
-    "StopBitsTwo"
-};
-
-/* UART serial bus flow control */
-
-const char                      *AcpiGbl_FcDecode[] =
-{
-    "FlowControlNone",
-    "FlowControlHardware",
-    "FlowControlXON",
-    "/* UNKNOWN flow control keyword */"
-};
-
-/* UART serial bus parity type */
-
-const char                      *AcpiGbl_PtDecode[] =
-{
-    "ParityTypeNone",
-    "ParityTypeEven",
-    "ParityTypeOdd",
-    "ParityTypeMark",
-    "ParityTypeSpace",
-    "/* UNKNOWN parity keyword */",
-    "/* UNKNOWN parity keyword */",
-    "/* UNKNOWN parity keyword */"
-};
-
-#endif
-
-
 /*
  * Base sizes of the raw AML resource descriptors, indexed by resource type.
  * Zero indicates a reserved (and therefore invalid) resource type.
@@ -371,8 +90,12 @@ const UINT8                 AcpiGbl_ResourceAmlSizes[] =
     ACPI_AML_SIZE_LARGE (AML_RESOURCE_ADDRESS64),
     ACPI_AML_SIZE_LARGE (AML_RESOURCE_EXTENDED_ADDRESS64),
     ACPI_AML_SIZE_LARGE (AML_RESOURCE_GPIO),
-    0,
+    ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_FUNCTION),
     ACPI_AML_SIZE_LARGE (AML_RESOURCE_COMMON_SERIALBUS),
+    ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_CONFIG),
+    ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_GROUP),
+    ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_GROUP_FUNCTION),
+    ACPI_AML_SIZE_LARGE (AML_RESOURCE_PIN_GROUP_CONFIG),
 };
 
 const UINT8                 AcpiGbl_ResourceAmlSerialBusSizes[] =
@@ -426,8 +149,12 @@ static const UINT8          AcpiGbl_ResourceTypes[] =
     ACPI_VARIABLE_LENGTH,           /* 0A Qword* address */
     ACPI_FIXED_LENGTH,              /* 0B Extended* address */
     ACPI_VARIABLE_LENGTH,           /* 0C Gpio* */
-    0,
-    ACPI_VARIABLE_LENGTH            /* 0E *SerialBus */
+    ACPI_VARIABLE_LENGTH,           /* 0D PinFunction */
+    ACPI_VARIABLE_LENGTH,           /* 0E *SerialBus */
+    ACPI_VARIABLE_LENGTH,           /* 0F PinConfig */
+    ACPI_VARIABLE_LENGTH,           /* 10 PinGroup */
+    ACPI_VARIABLE_LENGTH,           /* 11 PinGroupFunction */
+    ACPI_VARIABLE_LENGTH,           /* 12 PinGroupConfig */
 };
 
 
@@ -472,7 +199,7 @@ AcpiUtWalkAmlResources (
      * The absolute minimum resource template is one EndTag descriptor.
      * However, we will treat a lone EndTag as just a simple buffer.
      */
-    if (AmlLength < sizeof (AML_RESOURCE_END_TAG))
+    if (AmlLength <= sizeof (AML_RESOURCE_END_TAG))
     {
         return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG);
     }
@@ -505,8 +232,8 @@ AcpiUtWalkAmlResources (
 
         if (UserFunction)
         {
-            Status = UserFunction (Aml, Length, Offset,
-                ResourceIndex, Context);
+            Status = UserFunction (
+                Aml, Length, Offset, ResourceIndex, Context);
             if (ACPI_FAILURE (Status))
             {
                 return_ACPI_STATUS (Status);
@@ -543,15 +270,10 @@ AcpiUtWalkAmlResources (
                 *Context = Aml;
             }
 
-            /* Check if buffer is defined to be longer than the resource length */
-
-            if (AmlLength > (Offset + Length))
-            {
-                return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG);
-            }
-
-            /* Normal exit */
-
+            /*
+             * Normal exit. Note: We allow the buffer to be larger than
+             * the resource template, as long as the END_TAG exists.
+             */
             return_ACPI_STATUS (AE_OK);
         }
 
index 3aa3753..1488631 100644 (file)
@@ -169,6 +169,8 @@ AcpiAcquireMutex (
     return (Status);
 }
 
+ACPI_EXPORT_SYMBOL (AcpiAcquireMutex)
+
 
 /*******************************************************************************
  *
@@ -209,3 +211,5 @@ AcpiReleaseMutex (
     AcpiOsReleaseMutex (MutexObj->Mutex.OsMutex);
     return (AE_OK);
 }
+
+ACPI_EXPORT_SYMBOL (AcpiReleaseMutex)