ACK: [PATCH] ACPICA: update to version 20131218 (LP: #1262348)

IvanHu ivan.hu at canonical.com
Mon Dec 23 08:10:02 UTC 2013


On 12/19/2013 03:56 AM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> This includes APCICA commit a9ca6dbd2f1db4bbbdce0be57800beef002c7351
> which reverts an acpiexec hang on some DSDTs and SSDTs.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>   src/acpica/source/common/adfile.c                  |   5 +-
>   src/acpica/source/common/adwalk.c                  |  68 ++-
>   src/acpica/source/common/dmextern.c                | 571 ++++++++++++---------
>   src/acpica/source/common/dmtable.c                 |  34 +-
>   src/acpica/source/common/dmtbdump.c                |  31 +-
>   src/acpica/source/common/dmtbinfo.c                |  27 +-
>   src/acpica/source/compiler/aslbtypes.c             |   2 +-
>   src/acpica/source/compiler/asldefine.h             |   2 +-
>   src/acpica/source/compiler/aslerror.c              |  13 +-
>   src/acpica/source/compiler/aslfiles.c              |   1 +
>   src/acpica/source/compiler/aslglobal.h             |   2 +-
>   src/acpica/source/compiler/asllookup.c             |  56 +-
>   src/acpica/source/compiler/aslmain.c               |  28 +-
>   src/acpica/source/compiler/aslmessages.h           |   2 +-
>   src/acpica/source/compiler/asloperands.c           |   1 +
>   src/acpica/source/compiler/aslopt.c                |  17 +-
>   src/acpica/source/compiler/aslstartup.c            |   1 +
>   src/acpica/source/compiler/aslstubs.c              |   2 +-
>   src/acpica/source/compiler/aslxref.c               |  24 +-
>   src/acpica/source/compiler/dtcompile.c             |   9 +
>   src/acpica/source/compiler/dtcompiler.h            |  10 +
>   src/acpica/source/compiler/dtfield.c               |   3 +-
>   src/acpica/source/compiler/dttable.c               | 229 +++++++++
>   src/acpica/source/compiler/dttemplate.h            |  59 ++-
>   src/acpica/source/compiler/dtutils.c               |   1 +
>   src/acpica/source/components/debugger/dbfileio.c   |  10 -
>   src/acpica/source/components/debugger/dbinput.c    |   6 +-
>   src/acpica/source/components/dispatcher/dsfield.c  |   2 +-
>   src/acpica/source/components/dispatcher/dsutils.c  |  16 +-
>   src/acpica/source/components/dispatcher/dswexec.c  |   3 +-
>   src/acpica/source/components/dispatcher/dswload.c  |   2 +-
>   src/acpica/source/components/events/evgpeblk.c     |   7 +-
>   src/acpica/source/components/events/evgpeutil.c    |  21 +-
>   src/acpica/source/components/executer/exresnte.c   |   4 +-
>   src/acpica/source/components/namespace/nsxfeval.c  |  16 +-
>   src/acpica/source/components/parser/psopinfo.c     |  52 +-
>   src/acpica/source/components/tables/tbfadt.c       | 313 ++++++-----
>   src/acpica/source/components/tables/tbutils.c      | 150 +++++-
>   src/acpica/source/components/utilities/utaddress.c |  14 +-
>   src/acpica/source/components/utilities/utalloc.c   |  10 +-
>   src/acpica/source/components/utilities/utcache.c   |  12 +-
>   src/acpica/source/components/utilities/utdebug.c   |   4 +-
>   src/acpica/source/components/utilities/utxfinit.c  |  12 +-
>   src/acpica/source/include/acdisasm.h               |  25 +-
>   src/acpica/source/include/acevents.h               |   5 +-
>   src/acpica/source/include/acglobal.h               |  32 ++
>   src/acpica/source/include/aclocal.h                |  10 +-
>   src/acpica/source/include/acpixf.h                 |  18 +-
>   src/acpica/source/include/actbl.h                  |   3 +
>   src/acpica/source/include/actbl1.h                 |  10 +-
>   src/acpica/source/include/actbl2.h                 |   8 +
>   src/acpica/source/include/actbl3.h                 |  16 +-
>   src/acpica/source/include/actypes.h                |   8 +-
>   src/acpica/source/include/platform/acenv.h         |  20 +-
>   src/acpica/source/include/platform/aclinux.h       |   8 -
>   .../source/os_specific/service_layers/osunixxf.c   |   1 -
>   src/acpica/source/tools/acpiexec/aecommon.h        |   1 -
>   src/acpica/source/tools/acpiexec/aehandlers.c      |  14 +-
>   58 files changed, 1409 insertions(+), 622 deletions(-)
>
> diff --git a/src/acpica/source/common/adfile.c b/src/acpica/source/common/adfile.c
> index d598ac8..fc2d815 100644
> --- a/src/acpica/source/common/adfile.c
> +++ b/src/acpica/source/common/adfile.c
> @@ -271,6 +271,7 @@ FlGenerateFilename (
>   {
>       char                    *Position;
>       char                    *NewFilename;
> +    char                    *DirectoryPosition;
>
>
>       /*
> @@ -283,8 +284,10 @@ FlGenerateFilename (
>
>       /* Try to find the last dot in the filename */
>
> +    DirectoryPosition = strrchr (NewFilename, '/');
>       Position = strrchr (NewFilename, '.');
> -    if (Position)
> +
> +    if (Position && (Position > DirectoryPosition))
>       {
>           /* Tack on the new suffix */
>
> diff --git a/src/acpica/source/common/adwalk.c b/src/acpica/source/common/adwalk.c
> index 2d380f4..932c88f 100644
> --- a/src/acpica/source/common/adwalk.c
> +++ b/src/acpica/source/common/adwalk.c
> @@ -541,8 +541,9 @@ AcpiDmFindOrphanDescending (
>               !ChildOp->Common.Node)
>           {
>               AcpiNsExternalizeName (ACPI_UINT32_MAX, ChildOp->Common.Value.String,
> -                            NULL, &Path);
> -            AcpiOsPrintf ("/* %-16s A-NAMEPATH: %s  */\n", Op->Common.AmlOpName, Path);
> +                NULL, &Path);
> +            AcpiOsPrintf ("/* %-16s A-NAMEPATH: %s  */\n",
> +                Op->Common.AmlOpName, Path);
>               ACPI_FREE (Path);
>
>               NextOp = Op->Common.Next;
> @@ -550,22 +551,26 @@ AcpiDmFindOrphanDescending (
>               {
>                   /* This NamePath has no args, assume it is an integer */
>
> -                AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
> +                AcpiDmAddOpToExternalList (ChildOp,
> +                    ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
>                   return (AE_OK);
>               }
>
>               ArgCount = AcpiDmInspectPossibleArgs (3, 1, NextOp);
> -            AcpiOsPrintf ("/* A-CHILDREN: %u Actual %u */\n", ArgCount, AcpiDmCountChildren (Op));
> +            AcpiOsPrintf ("/* A-CHILDREN: %u Actual %u */\n",
> +                ArgCount, AcpiDmCountChildren (Op));
>
>               if (ArgCount < 1)
>               {
>                   /* One Arg means this is just a Store(Name,Target) */
>
> -                AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
> +                AcpiDmAddOpToExternalList (ChildOp,
> +                    ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
>                   return (AE_OK);
>               }
>
> -            AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
> +            AcpiDmAddOpToExternalList (ChildOp,
> +                ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount, 0);
>           }
>           break;
>   #endif
> @@ -581,7 +586,8 @@ AcpiDmFindOrphanDescending (
>               {
>                   /* This NamePath has no args, assume it is an integer */
>
> -                AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
> +                AcpiDmAddOpToExternalList (ChildOp,
> +                    ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
>                   return (AE_OK);
>               }
>
> @@ -590,11 +596,13 @@ AcpiDmFindOrphanDescending (
>               {
>                   /* One Arg means this is just a Store(Name,Target) */
>
> -                AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0);
> +                AcpiDmAddOpToExternalList (ChildOp,
> +                    ChildOp->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
>                   return (AE_OK);
>               }
>
> -            AcpiDmAddToExternalList (ChildOp, ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
> +            AcpiDmAddOpToExternalList (ChildOp,
> +                ChildOp->Common.Value.String, ACPI_TYPE_METHOD, ArgCount, 0);
>           }
>           break;
>
> @@ -626,7 +634,8 @@ AcpiDmFindOrphanDescending (
>                        /* And namepath is the first argument */
>                        (ParentOp->Common.Value.Arg == Op))
>                   {
> -                    AcpiDmAddToExternalList (Op, Op->Common.Value.String, ACPI_TYPE_INTEGER, 0);
> +                    AcpiDmAddOpToExternalList (Op,
> +                        Op->Common.Value.String, ACPI_TYPE_INTEGER, 0, 0);
>                       break;
>                   }
>               }
> @@ -636,8 +645,8 @@ AcpiDmFindOrphanDescending (
>                * operator) - it *must* be a method invocation, nothing else is
>                * grammatically possible.
>                */
> -            AcpiDmAddToExternalList (Op, Op->Common.Value.String, ACPI_TYPE_METHOD, ArgCount);
> -
> +            AcpiDmAddOpToExternalList (Op,
> +                Op->Common.Value.String, ACPI_TYPE_METHOD, ArgCount, 0);
>           }
>           break;
>
> @@ -813,6 +822,7 @@ AcpiDmXrefDescendingOp (
>       ACPI_NAMESPACE_NODE     *Node;
>       ACPI_OPERAND_OBJECT     *Object;
>       UINT32                  ParamCount = 0;
> +    char                    *Pathname;
>
>
>       WalkState = Info->WalkState;
> @@ -880,11 +890,14 @@ AcpiDmXrefDescendingOp (
>        * The namespace is also used as a lookup table for references to resource
>        * descriptors and the fields within them.
>        */
> +    Node = NULL;
>       Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY,
>                   ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
>                   WalkState, &Node);
>       if (ACPI_SUCCESS (Status) && (Node->Flags & ANOBJ_IS_EXTERNAL))
>       {
> +        /* Node was created by an External() statement */
> +
>           Status = AE_NOT_FOUND;
>       }
>
> @@ -902,16 +915,28 @@ AcpiDmXrefDescendingOp (
>               if (!(Op->Asl.Parent &&
>                   (Op->Asl.Parent->Asl.AmlOpcode == AML_COND_REF_OF_OP)))
>               {
> -                AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType, 0);
> +                if (Node)
> +                {
> +                    AcpiDmAddNodeToExternalList (Node,
> +                        (UINT8) ObjectType, 0, 0);
> +                }
> +                else
> +                {
> +                    AcpiDmAddOpToExternalList (Op, Path,
> +                        (UINT8) ObjectType, 0, 0);
> +                }
>               }
>           }
>       }
>
>       /*
> -     * Found the node in external table, add it to external list
> -     * Node->OwnerId == 0 indicates built-in ACPI Names, _OS_ etc
> +     * Found the node, but check if it came from an external table.
> +     * Add it to external list. Note: Node->OwnerId == 0 indicates
> +     * one of the built-in ACPI Names (_OS_ etc.) which can safely
> +     * be ignored.
>        */
> -    else if (Node->OwnerId && WalkState->OwnerId != Node->OwnerId)
> +    else if (Node->OwnerId &&
> +            (WalkState->OwnerId != Node->OwnerId))
>       {
>           ObjectType2 = ObjectType;
>
> @@ -925,7 +950,16 @@ AcpiDmXrefDescendingOp (
>               }
>           }
>
> -        AcpiDmAddToExternalList (Op, Path, (UINT8) ObjectType2, ParamCount | 0x80);
> +        Pathname = AcpiNsGetExternalPathname (Node);
> +        if (!Pathname)
> +        {
> +            return (AE_NO_MEMORY);
> +        }
> +
> +        AcpiDmAddNodeToExternalList (Node, (UINT8) ObjectType2,
> +            ParamCount, ACPI_EXT_RESOLVED_REFERENCE);
> +
> +        ACPI_FREE (Pathname);
>           Op->Common.Node = Node;
>       }
>       else
> diff --git a/src/acpica/source/common/dmextern.c b/src/acpica/source/common/dmextern.c
> index 5b3a8b1..f6b32f1 100644
> --- a/src/acpica/source/common/dmextern.c
> +++ b/src/acpica/source/common/dmextern.c
> @@ -176,10 +176,19 @@ AcpiDmNormalizeParentPrefix (
>       char                    *Path);
>
>   static void
> -AcpiDmAddToExternalListFromFile (
> +AcpiDmAddPathToExternalList (
>       char                    *Path,
>       UINT8                   Type,
> -    UINT32                  Value);
> +    UINT32                  Value,
> +    UINT16                  Flags);
> +
> +static ACPI_STATUS
> +AcpiDmCreateNewExternal (
> +    char                    *ExternalPath,
> +    char                    *InternalPath,
> +    UINT8                   Type,
> +    UINT32                  Value,
> +    UINT16                  Flags);
>
>
>   /*******************************************************************************
> @@ -421,196 +430,6 @@ AcpiDmClearExternalFileList (
>
>   /*******************************************************************************
>    *
> - * FUNCTION:    AcpiDmAddToExternalList
> - *
> - * PARAMETERS:  Op                  - Current parser Op
> - *              Path                - Internal (AML) path to the object
> - *              Type                - ACPI object type to be added
> - *              Value               - Arg count if adding a Method object
> - *
> - * RETURN:      None
> - *
> - * DESCRIPTION: Insert a new name into the global list of Externals which
> - *              will in turn be later emitted as an External() declaration
> - *              in the disassembled output.
> - *
> - ******************************************************************************/
> -
> -void
> -AcpiDmAddToExternalList (
> -    ACPI_PARSE_OBJECT       *Op,
> -    char                    *Path,
> -    UINT8                   Type,
> -    UINT32                  Value)
> -{
> -    char                    *ExternalPath;
> -    char                    *Fullpath = NULL;
> -    ACPI_EXTERNAL_LIST      *NewExternal;
> -    ACPI_EXTERNAL_LIST      *NextExternal;
> -    ACPI_EXTERNAL_LIST      *PrevExternal = NULL;
> -    ACPI_STATUS             Status;
> -    BOOLEAN                 Resolved = FALSE;
> -
> -
> -    if (!Path)
> -    {
> -        return;
> -    }
> -
> -    if (Type == ACPI_TYPE_METHOD)
> -    {
> -        if (Value & 0x80)
> -        {
> -            Resolved = TRUE;
> -        }
> -        Value &= 0x07;
> -    }
> -
> -    /*
> -     * We don't want External() statements to contain a leading '\'.
> -     * This prevents duplicate external statements of the form:
> -     *
> -     *    External (\ABCD)
> -     *    External (ABCD)
> -     *
> -     * This would cause a compile time error when the disassembled
> -     * output file is recompiled.
> -     */
> -    if ((*Path == AML_ROOT_PREFIX) && (Path[1]))
> -    {
> -        Path++;
> -    }
> -
> -    /* Externalize the ACPI pathname */
> -
> -    Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path,
> -                NULL, &ExternalPath);
> -    if (ACPI_FAILURE (Status))
> -    {
> -        return;
> -    }
> -
> -    /*
> -     * Get the full pathname from the root if "Path" has one or more
> -     * parent prefixes (^). Note: path will not contain a leading '\'.
> -     */
> -    if (*Path == (UINT8) AML_PARENT_PREFIX)
> -    {
> -        Fullpath = AcpiDmNormalizeParentPrefix (Op, ExternalPath);
> -        if (Fullpath)
> -        {
> -            /* Set new external path */
> -
> -            ACPI_FREE (ExternalPath);
> -            ExternalPath = Fullpath;
> -        }
> -    }
> -
> -    /* Check all existing externals to ensure no duplicates */
> -
> -    NextExternal = AcpiGbl_ExternalList;
> -    while (NextExternal)
> -    {
> -        if (!ACPI_STRCMP (ExternalPath, NextExternal->Path))
> -        {
> -            /* Duplicate method, check that the Value (ArgCount) is the same */
> -
> -            if ((NextExternal->Type == ACPI_TYPE_METHOD) &&
> -                (NextExternal->Value != Value))
> -            {
> -                ACPI_ERROR ((AE_INFO,
> -                    "External method arg count mismatch %s: Current %u, attempted %u",
> -                    NextExternal->Path, NextExternal->Value, Value));
> -            }
> -
> -            /* Allow upgrade of type from ANY */
> -
> -            else if (NextExternal->Type == ACPI_TYPE_ANY)
> -            {
> -                NextExternal->Type = Type;
> -                NextExternal->Value = Value;
> -            }
> -
> -            ACPI_FREE (ExternalPath);
> -            return;
> -        }
> -
> -        NextExternal = NextExternal->Next;
> -    }
> -
> -    /* Allocate and init a new External() descriptor */
> -
> -    NewExternal = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_LIST));
> -    if (!NewExternal)
> -    {
> -        ACPI_FREE (ExternalPath);
> -        return;
> -    }
> -
> -    NewExternal->Path = ExternalPath;
> -    NewExternal->Type = Type;
> -    NewExternal->Value = Value;
> -    NewExternal->Resolved = Resolved;
> -    NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath);
> -
> -    /* Was the external path with parent prefix normalized to a fullpath? */
> -
> -    if (Fullpath == ExternalPath)
> -    {
> -        /* Get new internal path */
> -
> -        Status = AcpiNsInternalizeName (ExternalPath, &Path);
> -        if (ACPI_FAILURE (Status))
> -        {
> -            ACPI_FREE (ExternalPath);
> -            ACPI_FREE (NewExternal);
> -            return;
> -        }
> -
> -        /* Set flag to indicate External->InternalPath need to be freed */
> -
> -        NewExternal->Flags |= ACPI_IPATH_ALLOCATED;
> -    }
> -
> -    NewExternal->InternalPath = Path;
> -
> -    /* Link the new descriptor into the global list, alphabetically ordered */
> -
> -    NextExternal = AcpiGbl_ExternalList;
> -    while (NextExternal)
> -    {
> -        if (AcpiUtStricmp (NewExternal->Path, NextExternal->Path) < 0)
> -        {
> -            if (PrevExternal)
> -            {
> -                PrevExternal->Next = NewExternal;
> -            }
> -            else
> -            {
> -                AcpiGbl_ExternalList = NewExternal;
> -            }
> -
> -            NewExternal->Next = NextExternal;
> -            return;
> -        }
> -
> -        PrevExternal = NextExternal;
> -        NextExternal = NextExternal->Next;
> -    }
> -
> -    if (PrevExternal)
> -    {
> -        PrevExternal->Next = NewExternal;
> -    }
> -    else
> -    {
> -        AcpiGbl_ExternalList = NewExternal;
> -    }
> -}
> -
> -
> -/*******************************************************************************
> - *
>    * FUNCTION:    AcpiDmGetExternalsFromFile
>    *
>    * PARAMETERS:  None
> @@ -691,7 +510,8 @@ AcpiDmGetExternalsFromFile (
>           AcpiOsPrintf ("%s: Importing method external (%u arguments) %s\n",
>               Gbl_ExternalRefFilename, ArgCount, MethodName);
>
> -        AcpiDmAddToExternalListFromFile (MethodName, ACPI_TYPE_METHOD, ArgCount | 0x80);
> +        AcpiDmAddPathToExternalList (MethodName, ACPI_TYPE_METHOD,
> +            ArgCount, (ACPI_EXT_RESOLVED_REFERENCE | ACPI_EXT_ORIGIN_FROM_FILE));
>           ImportCount++;
>       }
>
> @@ -716,11 +536,13 @@ AcpiDmGetExternalsFromFile (
>
>   /*******************************************************************************
>    *
> - * FUNCTION:    AcpiDmAddToExternalListFromFile
> + * FUNCTION:    AcpiDmAddOpToExternalList
>    *
> - * PARAMETERS:  Path                - Internal (AML) path to the object
> + * PARAMETERS:  Op                  - Current parser Op
> + *              Path                - Internal (AML) path to the object
>    *              Type                - ACPI object type to be added
>    *              Value               - Arg count if adding a Method object
> + *              Flags               - To be passed to the external object
>    *
>    * RETURN:      None
>    *
> @@ -728,60 +550,315 @@ AcpiDmGetExternalsFromFile (
>    *              will in turn be later emitted as an External() declaration
>    *              in the disassembled output.
>    *
> + *              This function handles the most common case where the referenced
> + *              name is simply not found in the constructed namespace.
> + *
>    ******************************************************************************/
>
> -static void
> -AcpiDmAddToExternalListFromFile (
> +void
> +AcpiDmAddOpToExternalList (
> +    ACPI_PARSE_OBJECT       *Op,
>       char                    *Path,
>       UINT8                   Type,
> -    UINT32                  Value)
> +    UINT32                  Value,
> +    UINT16                  Flags)
>   {
> -    char                    *InternalPath;
>       char                    *ExternalPath;
> -    ACPI_EXTERNAL_LIST      *NewExternal;
> -    ACPI_EXTERNAL_LIST      *NextExternal;
> -    ACPI_EXTERNAL_LIST      *PrevExternal = NULL;
> +    char                    *InternalPath = Path;
> +    char                    *Temp;
>       ACPI_STATUS             Status;
> -    BOOLEAN                 Resolved = FALSE;
> +
> +
> +    ACPI_FUNCTION_TRACE (DmAddOpToExternalList);
>
>
>       if (!Path)
>       {
> -        return;
> +        return_VOID;
>       }
>
> -    /* TBD: Add a flags parameter */
> +    /* Remove a root backslash if present */
>
> -    if (Type == ACPI_TYPE_METHOD)
> +    if ((*Path == AML_ROOT_PREFIX) && (Path[1]))
>       {
> -        if (Value & 0x80)
> -        {
> -            Resolved = TRUE;
> -        }
> -        Value &= 0x07;
> +        Path++;
> +    }
> +
> +    /* Externalize the pathname */
> +
> +    Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path,
> +        NULL, &ExternalPath);
> +    if (ACPI_FAILURE (Status))
> +    {
> +        return_VOID;
>       }
>
>       /*
> -     * We don't want External() statements to contain a leading '\'.
> -     * This prevents duplicate external statements of the form:
> -     *
> -     *    External (\ABCD)
> -     *    External (ABCD)
> -     *
> -     * This would cause a compile time error when the disassembled
> -     * output file is recompiled.
> +     * Get the full pathname from the root if "Path" has one or more
> +     * parent prefixes (^). Note: path will not contain a leading '\'.
>        */
> +    if (*Path == (UINT8) AML_PARENT_PREFIX)
> +    {
> +        Temp = AcpiDmNormalizeParentPrefix (Op, ExternalPath);
> +
> +        /* Set new external path */
> +
> +        ACPI_FREE (ExternalPath);
> +        ExternalPath = Temp;
> +        if (!Temp)
> +        {
> +            return_VOID;
> +        }
> +
> +        /* Create the new internal pathname */
> +
> +        Flags |= ACPI_EXT_INTERNAL_PATH_ALLOCATED;
> +        Status = AcpiNsInternalizeName (ExternalPath, &InternalPath);
> +        if (ACPI_FAILURE (Status))
> +        {
> +            ACPI_FREE (ExternalPath);
> +            return_VOID;
> +        }
> +    }
> +
> +    /* Create the new External() declaration node */
> +
> +    Status = AcpiDmCreateNewExternal (ExternalPath, InternalPath,
> +        Type, Value, Flags);
> +    if (ACPI_FAILURE (Status))
> +    {
> +        ACPI_FREE (ExternalPath);
> +        if (Flags & ACPI_EXT_INTERNAL_PATH_ALLOCATED)
> +        {
> +            ACPI_FREE (InternalPath);
> +        }
> +    }
> +
> +    return_VOID;
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION:    AcpiDmAddNodeToExternalList
> + *
> + * PARAMETERS:  Node                - Namespace node for object to be added
> + *              Type                - ACPI object type to be added
> + *              Value               - Arg count if adding a Method object
> + *              Flags               - To be passed to the external object
> + *
> + * RETURN:      None
> + *
> + * DESCRIPTION: Insert a new name into the global list of Externals which
> + *              will in turn be later emitted as an External() declaration
> + *              in the disassembled output.
> + *
> + *              This function handles the case where the referenced name has
> + *              been found in the namespace, but the name originated in a
> + *              table other than the one that is being disassembled (such
> + *              as a table that is added via the iASL -e option).
> + *
> + ******************************************************************************/
> +
> +void
> +AcpiDmAddNodeToExternalList (
> +    ACPI_NAMESPACE_NODE     *Node,
> +    UINT8                   Type,
> +    UINT32                  Value,
> +    UINT16                  Flags)
> +{
> +    char                    *ExternalPath;
> +    char                    *InternalPath;
> +    char                    *Temp;
> +    ACPI_STATUS             Status;
> +
> +
> +    ACPI_FUNCTION_TRACE (DmAddNodeToExternalList);
> +
> +
> +    if (!Node)
> +    {
> +        return_VOID;
> +    }
> +
> +    /* Get the full external and internal pathnames to the node */
> +
> +    ExternalPath = AcpiNsGetExternalPathname (Node);
> +    if (!ExternalPath)
> +    {
> +        return_VOID;
> +    }
> +
> +    Status = AcpiNsInternalizeName (ExternalPath, &InternalPath);
> +    if (ACPI_FAILURE (Status))
> +    {
> +        ACPI_FREE (ExternalPath);
> +        return_VOID;
> +    }
> +
> +    /* Remove the root backslash */
> +
> +    if ((*ExternalPath == AML_ROOT_PREFIX) && (ExternalPath[1]))
> +    {
> +        Temp = ACPI_ALLOCATE_ZEROED (ACPI_STRLEN (ExternalPath) + 1);
> +        if (!Temp)
> +        {
> +            return_VOID;
> +        }
> +
> +        ACPI_STRCPY (Temp, &ExternalPath[1]);
> +        ACPI_FREE (ExternalPath);
> +        ExternalPath = Temp;
> +    }
> +
> +    /* Create the new External() declaration node */
> +
> +    Status = AcpiDmCreateNewExternal (ExternalPath, InternalPath, Type,
> +        Value, (Flags | ACPI_EXT_INTERNAL_PATH_ALLOCATED));
> +    if (ACPI_FAILURE (Status))
> +    {
> +        ACPI_FREE (ExternalPath);
> +        ACPI_FREE (InternalPath);
> +    }
> +
> +    return_VOID;
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION:    AcpiDmAddPathToExternalList
> + *
> + * PARAMETERS:  Path                - External name of the object to be added
> + *              Type                - ACPI object type to be added
> + *              Value               - Arg count if adding a Method object
> + *              Flags               - To be passed to the external object
> + *
> + * RETURN:      None
> + *
> + * DESCRIPTION: Insert a new name into the global list of Externals which
> + *              will in turn be later emitted as an External() declaration
> + *              in the disassembled output.
> + *
> + *              This function currently is used to add externals via a
> + *              reference file (via the -fe iASL option).
> + *
> + ******************************************************************************/
> +
> +static void
> +AcpiDmAddPathToExternalList (
> +    char                    *Path,
> +    UINT8                   Type,
> +    UINT32                  Value,
> +    UINT16                  Flags)
> +{
> +    char                    *InternalPath;
> +    char                    *ExternalPath;
> +    ACPI_STATUS             Status;
> +
> +
> +    ACPI_FUNCTION_TRACE (DmAddPathToExternalList);
> +
> +
> +    if (!Path)
> +    {
> +        return_VOID;
> +    }
> +
> +    /* Remove a root backslash if present */
> +
>       if ((*Path == AML_ROOT_PREFIX) && (Path[1]))
>       {
>           Path++;
>       }
>
> +    /* Create the internal and external pathnames */
> +
> +    Status = AcpiNsInternalizeName (Path, &InternalPath);
> +    if (ACPI_FAILURE (Status))
> +    {
> +        return_VOID;
> +    }
> +
> +    Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, InternalPath,
> +        NULL, &ExternalPath);
> +    if (ACPI_FAILURE (Status))
> +    {
> +        ACPI_FREE (InternalPath);
> +        return_VOID;
> +    }
> +
> +    /* Create the new External() declaration node */
> +
> +    Status = AcpiDmCreateNewExternal (ExternalPath, InternalPath,
> +        Type, Value, (Flags | ACPI_EXT_INTERNAL_PATH_ALLOCATED));
> +    if (ACPI_FAILURE (Status))
> +    {
> +        ACPI_FREE (ExternalPath);
> +        ACPI_FREE (InternalPath);
> +    }
> +
> +    return_VOID;
> +}
> +
> +
> +/*******************************************************************************
> + *
> + * FUNCTION:    AcpiDmCreateNewExternal
> + *
> + * PARAMETERS:  ExternalPath        - External path to the object
> + *              InternalPath        - Internal (AML) path to the object
> + *              Type                - ACPI object type to be added
> + *              Value               - Arg count if adding a Method object
> + *              Flags               - To be passed to the external object
> + *
> + * RETURN:      Status
> + *
> + * DESCRIPTION: Common low-level function to insert a new name into the global
> + *              list of Externals which will in turn be later emitted as
> + *              External() declarations in the disassembled output.
> + *
> + *              Note: The external name should not include a root prefix
> + *              (backslash). We do not want External() statements to contain
> + *              a leading '\', as this prevents duplicate external statements
> + *              of the form:
> + *
> + *                  External (\ABCD)
> + *                  External (ABCD)
> + *
> + *              This would cause a compile time error when the disassembled
> + *              output file is recompiled.
> + *
> + *              There are two cases that are handled here. For both, we emit
> + *              an External() statement:
> + *              1) The name was simply not found in the namespace.
> + *              2) The name was found, but it originated in a table other than
> + *              the table that is being disassembled.
> + *
> + ******************************************************************************/
> +
> +static ACPI_STATUS
> +AcpiDmCreateNewExternal (
> +    char                    *ExternalPath,
> +    char                    *InternalPath,
> +    UINT8                   Type,
> +    UINT32                  Value,
> +    UINT16                  Flags)
> +{
> +    ACPI_EXTERNAL_LIST      *NewExternal;
> +    ACPI_EXTERNAL_LIST      *NextExternal;
> +    ACPI_EXTERNAL_LIST      *PrevExternal = NULL;
> +
> +
> +    ACPI_FUNCTION_TRACE (DmCreateNewExternal);
> +
> +
>       /* Check all existing externals to ensure no duplicates */
>
>       NextExternal = AcpiGbl_ExternalList;
>       while (NextExternal)
>       {
> -        if (!ACPI_STRCMP (Path, NextExternal->Path))
> +        if (!ACPI_STRCMP (ExternalPath, NextExternal->Path))
>           {
>               /* Duplicate method, check that the Value (ArgCount) is the same */
>
> @@ -789,12 +866,8 @@ AcpiDmAddToExternalListFromFile (
>                   (NextExternal->Value != Value))
>               {
>                   ACPI_ERROR ((AE_INFO,
> -                    "(File) External method arg count mismatch %s: Current %u, override to %u",
> +                    "External method arg count mismatch %s: Current %u, attempted %u",
>                       NextExternal->Path, NextExternal->Value, Value));
> -
> -                /* Override, since new value came from external reference file */
> -
> -                NextExternal->Value = Value;
>               }
>
>               /* Allow upgrade of type from ANY */
> @@ -805,44 +878,31 @@ AcpiDmAddToExternalListFromFile (
>                   NextExternal->Value = Value;
>               }
>
> -            return;
> +            return_ACPI_STATUS (AE_ALREADY_EXISTS);
>           }
>
>           NextExternal = NextExternal->Next;
>       }
>
> -    /* Get the internal pathname (AML format) */
> -
> -    Status = AcpiNsInternalizeName (Path, &InternalPath);
> -    if (ACPI_FAILURE (Status))
> -    {
> -        return;
> -    }
> -
>       /* Allocate and init a new External() descriptor */
>
>       NewExternal = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EXTERNAL_LIST));
>       if (!NewExternal)
>       {
> -        ACPI_FREE (InternalPath);
> -        return;
> +        return_ACPI_STATUS (AE_NO_MEMORY);
>       }
>
> -    /* Must copy and normalize the input path */
> -
> -    AcpiNsExternalizeName (ACPI_UINT32_MAX, InternalPath, NULL, &ExternalPath);
> +    ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
> +        "Adding external reference node (%s) type [%s]\n",
> +        ExternalPath, AcpiUtGetTypeName (Type)));
>
> +    NewExternal->Flags = Flags;
> +    NewExternal->Value = Value;
>       NewExternal->Path = ExternalPath;
>       NewExternal->Type = Type;
> -    NewExternal->Value = Value;
> -    NewExternal->Resolved = Resolved;
> -    NewExternal->Length = (UINT16) ACPI_STRLEN (Path);
> +    NewExternal->Length = (UINT16) ACPI_STRLEN (ExternalPath);
>       NewExternal->InternalPath = InternalPath;
>
> -    /* Set flag to indicate External->InternalPath needs to be freed */
> -
> -    NewExternal->Flags |= ACPI_IPATH_ALLOCATED | ACPI_FROM_REFERENCE_FILE;
> -
>       /* Link the new descriptor into the global list, alphabetically ordered */
>
>       NextExternal = AcpiGbl_ExternalList;
> @@ -860,7 +920,7 @@ AcpiDmAddToExternalListFromFile (
>               }
>
>               NewExternal->Next = NextExternal;
> -            return;
> +            return_ACPI_STATUS (AE_OK);
>           }
>
>           PrevExternal = NextExternal;
> @@ -875,6 +935,8 @@ AcpiDmAddToExternalListFromFile (
>       {
>           AcpiGbl_ExternalList = NewExternal;
>       }
> +
> +    return_ACPI_STATUS (AE_OK);
>   }
>
>
> @@ -1050,7 +1112,7 @@ AcpiDmEmitExternals (
>           if (NextExternal->Type == ACPI_TYPE_METHOD)
>           {
>               AcpiGbl_NumExternalMethods++;
> -            if (NextExternal->Resolved)
> +            if (NextExternal->Flags & ACPI_EXT_RESOLVED_REFERENCE)
>               {
>                   AcpiGbl_ResolvedExternalMethods++;
>               }
> @@ -1069,7 +1131,7 @@ AcpiDmEmitExternals (
>       while (NextExternal)
>       {
>           if ((NextExternal->Type == ACPI_TYPE_METHOD) &&
> -            (!NextExternal->Resolved))
> +            (!(NextExternal->Flags & ACPI_EXT_RESOLVED_REFERENCE)))
>           {
>               AcpiOsPrintf ("    External (%s%s",
>                   NextExternal->Path,
> @@ -1080,7 +1142,7 @@ AcpiDmEmitExternals (
>                   "guessing %u arguments (may be incorrect, see warning above)\n",
>                   NextExternal->Value);
>
> -            NextExternal->Emitted = TRUE;
> +            NextExternal->Flags |= ACPI_EXT_EXTERNAL_EMITTED;
>           }
>
>           NextExternal = NextExternal->Next;
> @@ -1101,7 +1163,8 @@ AcpiDmEmitExternals (
>           NextExternal = AcpiGbl_ExternalList;
>           while (NextExternal)
>           {
> -            if (!NextExternal->Emitted && (NextExternal->Flags & ACPI_FROM_REFERENCE_FILE))
> +            if (!(NextExternal->Flags & ACPI_EXT_EXTERNAL_EMITTED) &&
> +                (NextExternal->Flags & ACPI_EXT_ORIGIN_FROM_FILE))
>               {
>                   AcpiOsPrintf ("    External (%s%s",
>                       NextExternal->Path,
> @@ -1116,7 +1179,7 @@ AcpiDmEmitExternals (
>                   {
>                       AcpiOsPrintf (")\n");
>                   }
> -                NextExternal->Emitted = TRUE;
> +                NextExternal->Flags |= ACPI_EXT_EXTERNAL_EMITTED;
>               }
>
>               NextExternal = NextExternal->Next;
> @@ -1130,7 +1193,7 @@ AcpiDmEmitExternals (
>        */
>       while (AcpiGbl_ExternalList)
>       {
> -        if (!AcpiGbl_ExternalList->Emitted)
> +        if (!(AcpiGbl_ExternalList->Flags & ACPI_EXT_EXTERNAL_EMITTED))
>           {
>               AcpiOsPrintf ("    External (%s%s",
>                   AcpiGbl_ExternalList->Path,
> @@ -1152,7 +1215,7 @@ AcpiDmEmitExternals (
>           /* Free this external info block and move on to next external */
>
>           NextExternal = AcpiGbl_ExternalList->Next;
> -        if (AcpiGbl_ExternalList->Flags & ACPI_IPATH_ALLOCATED)
> +        if (AcpiGbl_ExternalList->Flags & ACPI_EXT_INTERNAL_PATH_ALLOCATED)
>           {
>               ACPI_FREE (AcpiGbl_ExternalList->InternalPath);
>           }
> diff --git a/src/acpica/source/common/dmtable.c b/src/acpica/source/common/dmtable.c
> index fa7b300..ccfdfbe 100644
> --- a/src/acpica/source/common/dmtable.c
> +++ b/src/acpica/source/common/dmtable.c
> @@ -277,6 +277,12 @@ static const char           *AcpiDmMadtSubnames[] =
>       "Unknown SubTable Type"         /* Reserved */
>   };
>
> +static const char           *AcpiDmPcctSubnames[] =
> +{
> +    "Generic Communications Subspace",  /* ACPI_PCCT_TYPE_GENERIC_SUBSPACE */
> +    "Unknown SubTable Type"             /* Reserved */
> +};
> +
>   static const char           *AcpiDmPmttSubnames[] =
>   {
>       "Socket",                       /* ACPI_PMTT_TYPE_SOCKET */
> @@ -358,7 +364,7 @@ ACPI_DMTABLE_DATA    AcpiDmTableData[] =
>       {ACPI_SIG_BOOT, AcpiDmTableInfoBoot,    NULL,           NULL,           TemplateBoot,   "Simple Boot Flag Table"},
>       {ACPI_SIG_CPEP, NULL,                   AcpiDmDumpCpep, DtCompileCpep,  TemplateCpep,   "Corrected Platform Error Polling table"},
>       {ACPI_SIG_CSRT, NULL,                   AcpiDmDumpCsrt, DtCompileCsrt,  TemplateCsrt,   "Core System Resource Table"},
> -    {ACPI_SIG_DBG2, NULL,                   AcpiDmDumpDbg2, NULL,           NULL,           "Debug Port table type 2"},
> +    {ACPI_SIG_DBG2, AcpiDmTableInfoDbg2,    AcpiDmDumpDbg2, DtCompileDbg2,  TemplateDbg2,   "Debug Port table type 2"},
>       {ACPI_SIG_DBGP, AcpiDmTableInfoDbgp,    NULL,           NULL,           TemplateDbgp,   "Debug Port table"},
>       {ACPI_SIG_DMAR, NULL,                   AcpiDmDumpDmar, DtCompileDmar,  TemplateDmar,   "DMA Remapping table"},
>       {ACPI_SIG_ECDT, AcpiDmTableInfoEcdt,    NULL,           NULL,           TemplateEcdt,   "Embedded Controller Boot Resources Table"},
> @@ -376,7 +382,7 @@ ACPI_DMTABLE_DATA    AcpiDmTableData[] =
>       {ACPI_SIG_MPST, AcpiDmTableInfoMpst,    AcpiDmDumpMpst, DtCompileMpst,  TemplateMpst,   "Memory Power State Table"},
>       {ACPI_SIG_MSCT, NULL,                   AcpiDmDumpMsct, DtCompileMsct,  TemplateMsct,   "Maximum System Characteristics Table"},
>       {ACPI_SIG_MTMR, NULL,                   AcpiDmDumpMtmr, DtCompileMtmr,  TemplateMtmr,   "MID Timer Table"},
> -    {ACPI_SIG_PCCT, NULL,                   AcpiDmDumpPcct, NULL,           NULL,           "Platform Communications Channel Table"},
> +    {ACPI_SIG_PCCT, AcpiDmTableInfoPcct,    AcpiDmDumpPcct, DtCompilePcct,  TemplatePcct,   "Platform Communications Channel Table"},
>       {ACPI_SIG_PMTT, NULL,                   AcpiDmDumpPmtt, DtCompilePmtt,  TemplatePmtt,   "Platform Memory Topology Table"},
>       {ACPI_SIG_RSDT, NULL,                   AcpiDmDumpRsdt, DtCompileRsdt,  TemplateRsdt,   "Root System Description Table"},
>       {ACPI_SIG_S3PT, NULL,                   NULL,           NULL,           TemplateS3pt,   "S3 Performance Table"},
> @@ -722,6 +728,7 @@ AcpiDmDumpTable (
>       UINT32                  ByteLength;
>       UINT8                   Temp8;
>       UINT16                  Temp16;
> +    UINT64                  Value;
>       ACPI_DMTABLE_DATA       *TableData;
>       const char              *Name;
>       BOOLEAN                 LastOutputBlankLine = FALSE;
> @@ -764,6 +771,7 @@ AcpiDmDumpTable (
>           case ACPI_DMT_ACCWIDTH:
>           case ACPI_DMT_IVRS:
>           case ACPI_DMT_MADT:
> +        case ACPI_DMT_PCCT:
>           case ACPI_DMT_PMTT:
>           case ACPI_DMT_SRAT:
>           case ACPI_DMT_ASF:
> @@ -935,10 +943,19 @@ AcpiDmDumpTable (
>                * Dump bytes - high byte first, low byte last.
>                * Note: All ACPI tables are little-endian.
>                */
> +            Value = 0;
>               for (Temp8 = (UINT8) ByteLength; Temp8 > 0; Temp8--)
>               {
>                   AcpiOsPrintf ("%2.2X", Target[Temp8 - 1]);
> +                Value |= Target[Temp8 - 1];
> +                Value <<= 8;
> +            }
> +
> +            if (!Value && (Info->Flags & DT_DESCRIBES_OPTIONAL))
> +            {
> +                AcpiOsPrintf (" [Optional field not present]");
>               }
> +
>               AcpiOsPrintf ("\n");
>               break;
>
> @@ -1194,6 +1211,19 @@ AcpiDmDumpTable (
>               AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmMadtSubnames[Temp8]);
>               break;
>
> +        case ACPI_DMT_PCCT:
> +
> +            /* PCCT subtable types */
> +
> +            Temp8 = *Target;
> +            if (Temp8 > ACPI_PCCT_TYPE_RESERVED)
> +            {
> +                Temp8 = ACPI_PCCT_TYPE_RESERVED;
> +            }
> +
> +            AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmPcctSubnames[Temp8]);
> +            break;
> +
>           case ACPI_DMT_PMTT:
>
>               /* PMTT subtable types */
> diff --git a/src/acpica/source/common/dmtbdump.c b/src/acpica/source/common/dmtbdump.c
> index 84c646a..7619b40 100644
> --- a/src/acpica/source/common/dmtbdump.c
> +++ b/src/acpica/source/common/dmtbdump.c
> @@ -881,8 +881,11 @@ AcpiDmDumpDbg2 (
>
>           /* Dump the OemData (optional) */
>
> -        AcpiDmDumpBuffer (SubTable, SubTable->OemDataOffset, SubTable->OemDataLength,
> -            Offset + SubTable->OemDataOffset, "OEM Data");
> +        if (SubTable->OemDataOffset)
> +        {
> +            AcpiDmDumpBuffer (SubTable, SubTable->OemDataOffset, SubTable->OemDataLength,
> +                Offset + SubTable->OemDataOffset, "OEM Data");
> +        }
>
>           /* Point to next sub-table */
>
> @@ -2019,11 +2022,31 @@ AcpiDmDumpPcct (
>           return;
>       }
>
> -    /* Sub-tables */
> +    /* Subtables */
>
>       SubTable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, Table, Offset);
>       while (Offset < Table->Length)
>       {
> +        /* Common subtable header */
> +
> +        AcpiOsPrintf ("\n");
> +        Status = AcpiDmDumpTable (Length, Offset, SubTable,
> +                    SubTable->Header.Length, AcpiDmTableInfoPcctHdr);
> +        if (ACPI_FAILURE (Status))
> +        {
> +            return;
> +        }
> +
> +        /* ACPI 5.0: Only one type of PCCT subtable is supported */
> +
> +        if (SubTable->Header.Type != ACPI_PCCT_TYPE_GENERIC_SUBSPACE)
> +        {
> +            AcpiOsPrintf (
> +                "\n**** Unexpected or unknown PCCT subtable type 0x%X\n\n",
> +                SubTable->Header.Type);
> +            return;
> +        }
> +
>           AcpiOsPrintf ("\n");
>           Status = AcpiDmDumpTable (Length, Offset, SubTable,
>                       SubTable->Header.Length, AcpiDmTableInfoPcct0);
> @@ -2032,7 +2055,7 @@ AcpiDmDumpPcct (
>               return;
>           }
>
> -        /* Point to next sub-table */
> +        /* Point to next subtable */
>
>           Offset += SubTable->Header.Length;
>           SubTable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, SubTable,
> diff --git a/src/acpica/source/common/dmtbinfo.c b/src/acpica/source/common/dmtbinfo.c
> index def6de8..3c68804 100644
> --- a/src/acpica/source/common/dmtbinfo.c
> +++ b/src/acpica/source/common/dmtbinfo.c
> @@ -792,12 +792,12 @@ ACPI_DMTABLE_INFO           AcpiDmTableInfoDbg2[] =
>   ACPI_DMTABLE_INFO           AcpiDmTableInfoDbg2Device[] =
>   {
>       {ACPI_DMT_UINT8,    ACPI_DBG20_OFFSET (Revision),               "Revision", 0},
> -    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (Length),                 "Length", 0},
> +    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (Length),                 "Length", DT_LENGTH},
>       {ACPI_DMT_UINT8,    ACPI_DBG20_OFFSET (RegisterCount),          "Register Count", 0},
>       {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (NamepathLength),         "Namepath Length", 0},
>       {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (NamepathOffset),         "Namepath Offset", 0},
> -    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (OemDataLength),          "OEM Data Length", 0},
> -    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (OemDataOffset),          "OEM Data Offset", 0},
> +    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (OemDataLength),          "OEM Data Length", DT_DESCRIBES_OPTIONAL},
> +    {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (OemDataOffset),          "OEM Data Offset", DT_DESCRIBES_OPTIONAL},
>       {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (PortType),               "Port Type", 0},
>       {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (PortSubtype),            "Port Subtype", 0},
>       {ACPI_DMT_UINT16,   ACPI_DBG20_OFFSET (Reserved),               "Reserved", 0},
> @@ -826,6 +826,12 @@ ACPI_DMTABLE_INFO           AcpiDmTableInfoDbg2Name[] =
>       ACPI_DMT_TERMINATOR
>   };
>
> +ACPI_DMTABLE_INFO           AcpiDmTableInfoDbg2OemData[] =
> +{
> +    {ACPI_DMT_BUFFER,   0,                                          "OEM Data", DT_OPTIONAL},
> +    ACPI_DMT_TERMINATOR
> +};
> +
>
>   /*******************************************************************************
>    *
> @@ -1749,25 +1755,32 @@ ACPI_DMTABLE_INFO           AcpiDmTableInfoPcct[] =
>   {
>       {ACPI_DMT_UINT32,   ACPI_PCCT_OFFSET (Flags),                   "Flags (decoded below)", DT_FLAG},
>       {ACPI_DMT_FLAG0,    ACPI_PCCT_FLAG_OFFSET (Flags,0),            "Doorbell", 0},
> -    {ACPI_DMT_UINT32,   ACPI_PCCT_OFFSET (Latency),                 "Command Latency", 0},
> -    {ACPI_DMT_UINT32,   ACPI_PCCT_OFFSET (Reserved),                "Reserved", 0},
> +    {ACPI_DMT_UINT64,   ACPI_PCCT_OFFSET (Reserved),                "Reserved", 0},
>       ACPI_DMT_TERMINATOR
>   };
>
>   /* PCCT subtables */
>
> +ACPI_DMTABLE_INFO           AcpiDmTableInfoPcctHdr[] =
> +{
> +    {ACPI_DMT_PCCT,     ACPI_PCCT0_OFFSET (Header.Type),            "Subtable Type", 0},
> +    {ACPI_DMT_UINT8,    ACPI_PCCT0_OFFSET (Header.Length),          "Length", DT_LENGTH},
> +    ACPI_DMT_TERMINATOR
> +};
> +
>   /* 0: Generic Communications Subspace */
>
>   ACPI_DMTABLE_INFO           AcpiDmTableInfoPcct0[] =
>   {
> -    {ACPI_DMT_UINT8,    ACPI_PCCT0_OFFSET (Header.Type),            "Subtable Type", 0},
> -    {ACPI_DMT_UINT8,    ACPI_PCCT0_OFFSET (Header.Length),          "Length", DT_LENGTH},
>       {ACPI_DMT_UINT48,   ACPI_PCCT0_OFFSET (Reserved[0]),            "Reserved", 0},
>       {ACPI_DMT_UINT64,   ACPI_PCCT0_OFFSET (BaseAddress),            "Base Address", 0},
>       {ACPI_DMT_UINT64,   ACPI_PCCT0_OFFSET (Length),                 "Address Length", 0},
>       {ACPI_DMT_GAS,      ACPI_PCCT0_OFFSET (DoorbellRegister),       "Doorbell Register", 0},
>       {ACPI_DMT_UINT64,   ACPI_PCCT0_OFFSET (PreserveMask),           "Preserve Mask", 0},
>       {ACPI_DMT_UINT64,   ACPI_PCCT0_OFFSET (WriteMask),              "Write Mask", 0},
> +    {ACPI_DMT_UINT32,   ACPI_PCCT0_OFFSET (Latency),                "Command Latency", 0},
> +    {ACPI_DMT_UINT32,   ACPI_PCCT0_OFFSET (MaxAccessRate),          "Maximum Access Rate", 0},
> +    {ACPI_DMT_UINT16,   ACPI_PCCT0_OFFSET (MinTurnaroundTime),      "Minimum Turnaround Time", 0},
>       ACPI_DMT_TERMINATOR
>   };
>
> diff --git a/src/acpica/source/compiler/aslbtypes.c b/src/acpica/source/compiler/aslbtypes.c
> index 17240cd..4fcd616 100644
> --- a/src/acpica/source/compiler/aslbtypes.c
> +++ b/src/acpica/source/compiler/aslbtypes.c
> @@ -315,7 +315,7 @@ AnMapEtypeToBtype (
>
>               return (ACPI_BTYPE_INTEGER | ACPI_BTYPE_DDB_HANDLE);
>
> -        case ACPI_BTYPE_DEBUG_OBJECT:
> +        case ACPI_TYPE_DEBUG_OBJECT:
>
>               /* Cannot be used as a source operand */
>
> diff --git a/src/acpica/source/compiler/asldefine.h b/src/acpica/source/compiler/asldefine.h
> index 4920f00..a0603a1 100644
> --- a/src/acpica/source/compiler/asldefine.h
> +++ b/src/acpica/source/compiler/asldefine.h
> @@ -127,7 +127,7 @@
>   #define ASL_INVOCATION_NAME         "iasl"
>   #define ASL_CREATOR_ID              "INTL"
>
> -#define ASL_COMPLIANCE              "Supports ACPI Specification Revision 5.0"
> +#define ASL_COMPLIANCE              "Supports ACPI Specification Revision 5.0A"
>
>
>   /* Configuration constants */
> diff --git a/src/acpica/source/compiler/aslerror.c b/src/acpica/source/compiler/aslerror.c
> index 6439977..e3d1e62 100644
> --- a/src/acpica/source/compiler/aslerror.c
> +++ b/src/acpica/source/compiler/aslerror.c
> @@ -272,6 +272,16 @@ AePrintException (
>
>           switch (Enode->Level)
>           {
> +        case ASL_WARNING:
> +        case ASL_WARNING2:
> +        case ASL_WARNING3:
> +
> +            if (!Gbl_DisplayWarnings)
> +            {
> +                return;
> +            }
> +            break;
> +
>           case ASL_REMARK:
>
>               if (!Gbl_DisplayRemarks)
> @@ -294,11 +304,10 @@ AePrintException (
>           }
>       }
>
> -    /* Get the file handles */
> +    /* Get the various required file handles */
>
>       OutputFile = Gbl_Files[FileId].Handle;
>
> -
>       if (!Enode->SourceLine)
>       {
>           /* Use the merged header/source file if present, otherwise use input file */
> diff --git a/src/acpica/source/compiler/aslfiles.c b/src/acpica/source/compiler/aslfiles.c
> index df3d368..c470146 100644
> --- a/src/acpica/source/compiler/aslfiles.c
> +++ b/src/acpica/source/compiler/aslfiles.c
> @@ -896,6 +896,7 @@ FlParseInputPathname (
>           *(Substring+1) = 0;
>       }
>
> +    UtConvertBackslashes (Gbl_OutputFilenamePrefix);
>       return (AE_OK);
>   }
>   #endif
> diff --git a/src/acpica/source/compiler/aslglobal.h b/src/acpica/source/compiler/aslglobal.h
> index 7fb67c9..29e0ff6 100644
> --- a/src/acpica/source/compiler/aslglobal.h
> +++ b/src/acpica/source/compiler/aslglobal.h
> @@ -235,6 +235,7 @@ ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_GetAllTables, FALSE);
>   ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_IntegerOptimizationFlag, TRUE);
>   ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_ReferenceOptimizationFlag, TRUE);
>   ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_DisplayRemarks, TRUE);
> +ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_DisplayWarnings, TRUE);
>   ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_DisplayOptimizations, FALSE);
>   ASL_EXTERN UINT8                    ASL_INIT_GLOBAL (Gbl_WarningLevel, ASL_WARNING);
>   ASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_UseOriginalCompilerId, FALSE);
> @@ -304,7 +305,6 @@ ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_NumNamespaceObjects, 0)
>   ASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_ReservedMethods, 0);
>   ASL_EXTERN char                     ASL_INIT_GLOBAL (*Gbl_TableSignature, "NO_SIG");
>   ASL_EXTERN char                     ASL_INIT_GLOBAL (*Gbl_TableId, "NO_ID");
> -ASL_EXTERN FILE                     *AcpiGbl_DebugFile; /* Placeholder for oswinxf only */
>
>
>   /* Static structures */
> diff --git a/src/acpica/source/compiler/asllookup.c b/src/acpica/source/compiler/asllookup.c
> index 82a8334..259df47 100644
> --- a/src/acpica/source/compiler/asllookup.c
> +++ b/src/acpica/source/compiler/asllookup.c
> @@ -177,7 +177,9 @@ LkFindUnreferencedObjects (
>    * DESCRIPTION: Check for an unreferenced namespace object and emit a warning.
>    *              We have to be careful, because some types and names are
>    *              typically or always unreferenced, we don't want to issue
> - *              excessive warnings.
> + *              excessive warnings. Note: Names that are declared within a
> + *              control method are temporary, so we always issue a remark
> + *              if they are not referenced.
>    *
>    ******************************************************************************/
>
> @@ -189,6 +191,7 @@ LkIsObjectUsed (
>       void                    **ReturnValue)
>   {
>       ACPI_NAMESPACE_NODE     *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
> +    ACPI_NAMESPACE_NODE     *Next;
>
>
>       /* Referenced flag is set during the namespace xref */
> @@ -198,23 +201,19 @@ LkIsObjectUsed (
>           return (AE_OK);
>       }
>
> -    /*
> -     * Ignore names that start with an underscore,
> -     * these are the reserved ACPI names and are typically not referenced,
> -     * they are called by the host OS.
> -     */
> -    if (Node->Name.Ascii[0] == '_')
> +    if (!Node->Op)
>       {
>           return (AE_OK);
>       }
>
> -    /* There are some types that are typically not referenced, ignore them */
> +    /* These types are typically never directly referenced, ignore them */
>
>       switch (Node->Type)
>       {
>       case ACPI_TYPE_DEVICE:
>       case ACPI_TYPE_PROCESSOR:
>       case ACPI_TYPE_POWER:
> +    case ACPI_TYPE_THERMAL:
>       case ACPI_TYPE_LOCAL_RESOURCE:
>
>           return (AE_OK);
> @@ -224,12 +223,47 @@ LkIsObjectUsed (
>           break;
>       }
>
> -    /* All others are valid unreferenced namespace objects */
> +    /* Determine if the name is within a control method */
>
> -    if (Node->Op)
> +    Next = Node->Parent;
> +    while (Next)
>       {
> -        AslError (ASL_WARNING2, ASL_MSG_NOT_REFERENCED, LkGetNameOp (Node->Op), NULL);
> +        if (Next->Type == ACPI_TYPE_METHOD)
> +        {
> +            /*
> +             * Name is within a method, therefore it is temporary.
> +             * Issue a remark even if it is a reserved name (starts
> +             * with an underscore).
> +             */
> +            sprintf (MsgBuffer, "Name is within method [%4.4s]",
> +                Next->Name.Ascii);
> +            AslError (ASL_REMARK, ASL_MSG_NOT_REFERENCED,
> +                LkGetNameOp (Node->Op), MsgBuffer);
> +            return (AE_OK);
> +        }
> +
> +        Next = Next->Parent;
>       }
> +
> +    /* The name is not within a control method */
> +
> +    /*
> +     * Ignore names that start with an underscore. These are the reserved
> +     * ACPI names and are typically not referenced since they are meant
> +     * to be called by the host OS.
> +     */
> +    if (Node->Name.Ascii[0] == '_')
> +    {
> +        return (AE_OK);
> +    }
> +
> +    /*
> +     * What remains is an unresolved user name that is not within a method.
> +     * However, the object could be referenced via another table, so issue
> +     * the warning at level 2.
> +     */
> +    AslError (ASL_WARNING2, ASL_MSG_NOT_REFERENCED,
> +        LkGetNameOp (Node->Op), NULL);
>       return (AE_OK);
>   }
>
> diff --git a/src/acpica/source/compiler/aslmain.c b/src/acpica/source/compiler/aslmain.c
> index bc6b658..27fc6b0 100644
> --- a/src/acpica/source/compiler/aslmain.c
> +++ b/src/acpica/source/compiler/aslmain.c
> @@ -166,11 +166,21 @@ Usage (
>       printf ("%s\n\n", ASL_COMPLIANCE);
>       ACPI_USAGE_HEADER ("iasl [Options] [Files]");
>
> -    printf ("\nGlobal:\n");
> +    printf ("\nGeneral:\n");
>       ACPI_OPTION ("-@ <file>",       "Specify command file");
>       ACPI_OPTION ("-I <dir>",        "Specify additional include directory");
>       ACPI_OPTION ("-T <sig>|ALL|*",  "Create table template file for ACPI <Sig>");
> +    ACPI_OPTION ("-p <prefix>",     "Specify path/filename prefix for all output files");
>       ACPI_OPTION ("-v",              "Display compiler version");
> +    ACPI_OPTION ("-vo",             "Enable optimization comments");
> +    ACPI_OPTION ("-vs",             "Disable signon");
> +
> +    printf ("\nHelp:\n");
> +    ACPI_OPTION ("-h",              "This message");
> +    ACPI_OPTION ("-hc",             "Display operators allowed in constant expressions");
> +    ACPI_OPTION ("-hf",             "Display help for output filename generation");
> +    ACPI_OPTION ("-hr",             "Display ACPI reserved method names");
> +    ACPI_OPTION ("-ht",             "Display currently supported ACPI table names");
>
>       printf ("\nPreprocessor:\n");
>       ACPI_OPTION ("-D <symbol>",     "Define symbol for preprocessor use");
> @@ -178,13 +188,11 @@ Usage (
>       ACPI_OPTION ("-P",              "Preprocess only and create preprocessor output file (*.i)");
>       ACPI_OPTION ("-Pn",             "Disable preprocessor");
>
> -    printf ("\nGeneral Processing:\n");
> -    ACPI_OPTION ("-p <prefix>",     "Specify path/filename prefix for all output files");
> -    ACPI_OPTION ("-va",             "Disable all errors and warnings (summary only)");
> +    printf ("\nErrors, Warnings, and Remarks:\n");
> +    ACPI_OPTION ("-va",             "Disable all errors/warnings/remarks");
> +    ACPI_OPTION ("-ve",             "Report only errors (ignore warnings and remarks)");
>       ACPI_OPTION ("-vi",             "Less verbose errors and warnings for use with IDEs");
> -    ACPI_OPTION ("-vo",             "Enable optimization comments");
>       ACPI_OPTION ("-vr",             "Disable remarks");
> -    ACPI_OPTION ("-vs",             "Disable signon");
>       ACPI_OPTION ("-vw <messageid>", "Disable specific warning or remark");
>       ACPI_OPTION ("-w1 -w2 -w3",     "Set warning reporting level");
>       ACPI_OPTION ("-we",             "Report warnings as errors");
> @@ -226,13 +234,6 @@ Usage (
>       ACPI_OPTION ("-in",             "Ignore NoOp opcodes");
>       ACPI_OPTION ("-vt",             "Dump binary table data in hex format within output file");
>
> -    printf ("\nHelp:\n");
> -    ACPI_OPTION ("-h",              "This message");
> -    ACPI_OPTION ("-hc",             "Display operators allowed in constant expressions");
> -    ACPI_OPTION ("-hf",             "Display help for output filename generation");
> -    ACPI_OPTION ("-hr",             "Display ACPI reserved method names");
> -    ACPI_OPTION ("-ht",             "Display currently supported ACPI table names");
> -
>       printf ("\nDebug Options:\n");
>       ACPI_OPTION ("-bf -bt",         "Create debug file (full or parse tree only) (*.txt)");
>       ACPI_OPTION ("-f",              "Ignore errors, force creation of AML output file(s)");
> @@ -425,6 +426,7 @@ main (
>           if (Gbl_UseDefaultAmlFilename)
>           {
>               Gbl_OutputFilenamePrefix = argv[Index2];
> +            UtConvertBackslashes (Gbl_OutputFilenamePrefix);
>           }
>
>           Status = AslDoOneFile (argv[Index2]);
> diff --git a/src/acpica/source/compiler/aslmessages.h b/src/acpica/source/compiler/aslmessages.h
> index 16c1d94..a3f6c8b 100644
> --- a/src/acpica/source/compiler/aslmessages.h
> +++ b/src/acpica/source/compiler/aslmessages.h
> @@ -441,7 +441,7 @@ char                        *AslMessages [] =
>   /*    ASL_MSG_NOT_METHOD */                 "Not a control method, cannot invoke",
>   /*    ASL_MSG_NOT_PARAMETER */              "Not a parameter, used as local only",
>   /*    ASL_MSG_NOT_REACHABLE */              "Object is not accessible from this scope",
> -/*    ASL_MSG_NOT_REFERENCED */             "Namespace object is not referenced",
> +/*    ASL_MSG_NOT_REFERENCED */             "Object is not referenced",
>   /*    ASL_MSG_NULL_DESCRIPTOR */            "Min/Max/Length/Gran are all zero, but no resource tag",
>   /*    ASL_MSG_NULL_STRING */                "Invalid zero-length (null) string",
>   /*    ASL_MSG_OPEN */                       "Could not open file",
> diff --git a/src/acpica/source/compiler/asloperands.c b/src/acpica/source/compiler/asloperands.c
> index 1a85a9f..f011d51 100644
> --- a/src/acpica/source/compiler/asloperands.c
> +++ b/src/acpica/source/compiler/asloperands.c
> @@ -994,6 +994,7 @@ OpnDoDefinitionBlock (
>           strcat (Filename, (char *) Child->Asl.Value.Buffer);
>
>           Gbl_OutputFilenamePrefix = Filename;
> +        UtConvertBackslashes (Gbl_OutputFilenamePrefix);
>       }
>       Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG;
>
> diff --git a/src/acpica/source/compiler/aslopt.c b/src/acpica/source/compiler/aslopt.c
> index 535d7b0..0588246 100644
> --- a/src/acpica/source/compiler/aslopt.c
> +++ b/src/acpica/source/compiler/aslopt.c
> @@ -648,7 +648,8 @@ OptOptimizeNamePath (
>           return_VOID;
>       }
>
> -    ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "%5d [%12.12s] [%12.12s] ",
> +    ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
> +        "PATH OPTIMIZE: Line %5d ParentOp [%12.12s] ThisOp [%12.12s] ",
>           Op->Asl.LogicalLineNumber,
>           AcpiPsGetOpcodeName (Op->Common.Parent->Common.AmlOpcode),
>           AcpiPsGetOpcodeName (Op->Common.AmlOpcode)));
> @@ -692,7 +693,7 @@ OptOptimizeNamePath (
>       {
>           /* This is the declaration of a new name */
>
> -        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "NAME"));
> +        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "NAME\n"));
>
>           /*
>            * The node of interest is the parent of this node (the containing
> @@ -718,7 +719,7 @@ OptOptimizeNamePath (
>       {
>           /* This is a reference to an existing named object */
>
> -        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "REF "));
> +        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, "REFERENCE\n"));
>       }
>
>       /*
> @@ -760,9 +761,10 @@ OptOptimizeNamePath (
>       }
>
>       ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
> -        "%37s (%2u) ==> %-32s(%2u) %-32s",
> -        (char *) CurrentPath.Pointer, (UINT32) CurrentPath.Length,
> -        (char *) TargetPath.Pointer, (UINT32) TargetPath.Length, ExternalNameString));
> +        "CURRENT SCOPE: (%2u) %-37s FULL PATH TO NAME: (%2u) %-32s ACTUAL AML:%-32s\n",
> +        (UINT32) CurrentPath.Length, (char *) CurrentPath.Pointer,
> +        (UINT32) TargetPath.Length, (char *) TargetPath.Pointer,
> +        ExternalNameString));
>
>       ACPI_FREE (ExternalNameString);
>
> @@ -819,7 +821,8 @@ OptOptimizeNamePath (
>           HowMuchShorter = (AmlNameStringLength - ACPI_STRLEN (NewPath));
>           OptTotal += HowMuchShorter;
>
> -        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS, " REDUCED %2u (%u)",
> +        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OPTIMIZATIONS,
> +            " REDUCED BY %2u (TOTAL SAVED %2u)",
>               (UINT32) HowMuchShorter, OptTotal));
>
>           if (Flags & AML_NAMED)
> diff --git a/src/acpica/source/compiler/aslstartup.c b/src/acpica/source/compiler/aslstartup.c
> index 73e1b8f..4504532 100644
> --- a/src/acpica/source/compiler/aslstartup.c
> +++ b/src/acpica/source/compiler/aslstartup.c
> @@ -398,6 +398,7 @@ AslDoOneFile (
>       }
>
>       Gbl_Files[ASL_FILE_INPUT].Filename = Filename;
> +    UtConvertBackslashes (Filename);
>
>       /*
>        * AML Disassembly (Optional)
> diff --git a/src/acpica/source/compiler/aslstubs.c b/src/acpica/source/compiler/aslstubs.c
> index 4cf1d42..8d2400e 100644
> --- a/src/acpica/source/compiler/aslstubs.c
> +++ b/src/acpica/source/compiler/aslstubs.c
> @@ -311,7 +311,7 @@ ACPI_THREAD_ID
>   AcpiOsGetThreadId (
>       void)
>   {
> -    return (0xFFFF);
> +    return (1);
>   }
>
>   ACPI_STATUS
> diff --git a/src/acpica/source/compiler/aslxref.c b/src/acpica/source/compiler/aslxref.c
> index 51eb314..78a8775 100644
> --- a/src/acpica/source/compiler/aslxref.c
> +++ b/src/acpica/source/compiler/aslxref.c
> @@ -388,7 +388,7 @@ XfNamespaceLocateBegin (
>        */
>       if (Op->Asl.CompileFlags & NODE_IS_NAME_DECLARATION)
>       {
> -        return (AE_OK);
> +        return_ACPI_STATUS (AE_OK);
>       }
>
>       /* We are only interested in opcodes that have an associated name */
> @@ -401,7 +401,7 @@ XfNamespaceLocateBegin (
>           (Op->Asl.ParseOpcode != PARSEOP_NAMESEG)    &&
>           (Op->Asl.ParseOpcode != PARSEOP_METHODCALL))
>       {
> -        return (AE_OK);
> +        return_ACPI_STATUS (AE_OK);
>       }
>
>       /*
> @@ -412,7 +412,7 @@ XfNamespaceLocateBegin (
>       if ((Op->Asl.Parent) &&
>           (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONDREFOF))
>       {
> -        return (AE_OK);
> +        return_ACPI_STATUS (AE_OK);
>       }
>
>       /*
> @@ -531,7 +531,8 @@ XfNamespaceLocateBegin (
>
>               Status = AE_OK;
>           }
> -        return (Status);
> +
> +        return_ACPI_STATUS (Status);
>       }
>
>       /* Check for a reference vs. name declaration */
> @@ -696,7 +697,6 @@ XfNamespaceLocateBegin (
>
>                   (Op->Asl.ParseOpcode == PARSEOP_METHODCALL))
>       {
> -
>           /*
>            * A reference to a method within one of these opcodes is not an
>            * invocation of the method, it is simply a reference to the method.
> @@ -706,7 +706,7 @@ XfNamespaceLocateBegin (
>               (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_DEREFOF)    ||
>               (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_OBJECTTYPE)))
>           {
> -            return (AE_OK);
> +            return_ACPI_STATUS (AE_OK);
>           }
>           /*
>            * There are two types of method invocation:
> @@ -722,7 +722,7 @@ XfNamespaceLocateBegin (
>                       Op->Asl.ExternalName, AcpiUtGetTypeName (Node->Type));
>
>               AslError (ASL_ERROR, ASL_MSG_NOT_METHOD, Op, MsgBuffer);
> -            return (AE_OK);
> +            return_ACPI_STATUS (AE_OK);
>           }
>
>           /* Save the method node in the caller's op */
> @@ -730,7 +730,7 @@ XfNamespaceLocateBegin (
>           Op->Asl.Node = Node;
>           if (Op->Asl.Parent->Asl.ParseOpcode == PARSEOP_CONDREFOF)
>           {
> -            return (AE_OK);
> +            return_ACPI_STATUS (AE_OK);
>           }
>
>           /*
> @@ -895,7 +895,7 @@ XfNamespaceLocateBegin (
>       }
>
>       Op->Asl.Node = Node;
> -    return (Status);
> +    return_ACPI_STATUS (Status);
>   }
>
>
> @@ -930,7 +930,7 @@ XfNamespaceLocateEnd (
>       OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode);
>       if (!(OpInfo->Flags & AML_NAMED))
>       {
> -        return (AE_OK);
> +        return_ACPI_STATUS (AE_OK);
>       }
>
>       /* Not interested in name references, we did not open a scope for them */
> @@ -939,7 +939,7 @@ XfNamespaceLocateEnd (
>           (Op->Asl.ParseOpcode == PARSEOP_NAMESEG)    ||
>           (Op->Asl.ParseOpcode == PARSEOP_METHODCALL))
>       {
> -        return (AE_OK);
> +        return_ACPI_STATUS (AE_OK);
>       }
>
>       /* Pop the scope stack if necessary */
> @@ -954,5 +954,5 @@ XfNamespaceLocateEnd (
>           (void) AcpiDsScopeStackPop (WalkState);
>       }
>
> -    return (AE_OK);
> +    return_ACPI_STATUS (AE_OK);
>   }
> diff --git a/src/acpica/source/compiler/dtcompile.c b/src/acpica/source/compiler/dtcompile.c
> index 099018b..926bf72 100644
> --- a/src/acpica/source/compiler/dtcompile.c
> +++ b/src/acpica/source/compiler/dtcompile.c
> @@ -518,6 +518,15 @@ DtCompileTable (
>           return (AE_BAD_PARAMETER);
>       }
>
> +    /* Ignore optional subtable if name does not match */
> +
> +    if ((Info->Flags & DT_OPTIONAL) &&
> +        ACPI_STRCMP ((*Field)->Name, Info->Name))
> +    {
> +        *RetSubtable = NULL;
> +        return (AE_OK);
> +    }
> +
>       Length = DtGetSubtableLength (*Field, Info);
>       if (Length == ASL_EOF)
>       {
> diff --git a/src/acpica/source/compiler/dtcompiler.h b/src/acpica/source/compiler/dtcompiler.h
> index 9868662..4c04508 100644
> --- a/src/acpica/source/compiler/dtcompiler.h
> +++ b/src/acpica/source/compiler/dtcompiler.h
> @@ -472,6 +472,10 @@ DtCompileCsrt (
>       void                    **PFieldList);
>
>   ACPI_STATUS
> +DtCompileDbg2 (
> +    void                    **PFieldList);
> +
> +ACPI_STATUS
>   DtCompileDmar (
>       void                    **PFieldList);
>
> @@ -524,6 +528,10 @@ DtCompilePmtt (
>       void                    **PFieldList);
>
>   ACPI_STATUS
> +DtCompilePcct (
> +    void                    **PFieldList);
> +
> +ACPI_STATUS
>   DtCompileRsdt (
>       void                    **PFieldList);
>
> @@ -575,6 +583,7 @@ extern const unsigned char  TemplateBert[];
>   extern const unsigned char  TemplateBgrt[];
>   extern const unsigned char  TemplateCpep[];
>   extern const unsigned char  TemplateCsrt[];
> +extern const unsigned char  TemplateDbg2[];
>   extern const unsigned char  TemplateDbgp[];
>   extern const unsigned char  TemplateDmar[];
>   extern const unsigned char  TemplateEcdt[];
> @@ -592,6 +601,7 @@ extern const unsigned char  TemplateMchi[];
>   extern const unsigned char  TemplateMpst[];
>   extern const unsigned char  TemplateMsct[];
>   extern const unsigned char  TemplateMtmr[];
> +extern const unsigned char  TemplatePcct[];
>   extern const unsigned char  TemplatePmtt[];
>   extern const unsigned char  TemplateRsdt[];
>   extern const unsigned char  TemplateS3pt[];
> diff --git a/src/acpica/source/compiler/dtfield.c b/src/acpica/source/compiler/dtfield.c
> index 00debb8..4a45519 100644
> --- a/src/acpica/source/compiler/dtfield.c
> +++ b/src/acpica/source/compiler/dtfield.c
> @@ -412,7 +412,8 @@ DtCompileInteger (
>
>       if (Value > MaxValue)
>       {
> -        sprintf (MsgBuffer, "%8.8X%8.8X", ACPI_FORMAT_UINT64 (Value));
> +        sprintf (MsgBuffer, "%8.8X%8.8X - max %u bytes",
> +            ACPI_FORMAT_UINT64 (Value), ByteLength);
>           DtError (ASL_ERROR, ASL_MSG_INTEGER_SIZE, Field, MsgBuffer);
>       }
>
> diff --git a/src/acpica/source/compiler/dttable.c b/src/acpica/source/compiler/dttable.c
> index e754cc4..5b9236f 100644
> --- a/src/acpica/source/compiler/dttable.c
> +++ b/src/acpica/source/compiler/dttable.c
> @@ -592,6 +592,156 @@ DtCompileCsrt (
>
>   /******************************************************************************
>    *
> + * FUNCTION:    DtCompileDbg2
> + *
> + * PARAMETERS:  List                - Current field list pointer
> + *
> + * RETURN:      Status
> + *
> + * DESCRIPTION: Compile DBG2.
> + *
> + *****************************************************************************/
> +
> +ACPI_STATUS
> +DtCompileDbg2 (
> +    void                    **List)
> +{
> +    ACPI_STATUS             Status;
> +    DT_SUBTABLE             *Subtable;
> +    DT_SUBTABLE             *ParentTable;
> +    DT_FIELD                **PFieldList = (DT_FIELD **) List;
> +    UINT32                  SubtableCount;
> +    ACPI_DBG2_HEADER        *Dbg2Header;
> +    ACPI_DBG2_DEVICE        *DeviceInfo;
> +    UINT16                  CurrentOffset;
> +    UINT32                  i;
> +
> +
> +    /* Main table */
> +
> +    Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2, &Subtable, TRUE);
> +    if (ACPI_FAILURE (Status))
> +    {
> +        return (Status);
> +    }
> +
> +    ParentTable = DtPeekSubtable ();
> +    DtInsertSubtable (ParentTable, Subtable);
> +
> +    /* Main table fields */
> +
> +    Dbg2Header = ACPI_CAST_PTR (ACPI_DBG2_HEADER, Subtable->Buffer);
> +    Dbg2Header->InfoOffset = sizeof (ACPI_TABLE_HEADER) + ACPI_PTR_DIFF (
> +        ACPI_ADD_PTR (UINT8, Dbg2Header, sizeof (ACPI_DBG2_HEADER)), Dbg2Header);
> +
> +    SubtableCount = Dbg2Header->InfoCount;
> +    DtPushSubtable (Subtable);
> +
> +    /* Process all Device Information subtables (Count = InfoCount) */
> +
> +    while (*PFieldList && SubtableCount)
> +    {
> +        /* Subtable: Debug Device Information */
> +
> +        Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Device,
> +                    &Subtable, TRUE);
> +        if (ACPI_FAILURE (Status))
> +        {
> +            return (Status);
> +        }
> +
> +        DeviceInfo = ACPI_CAST_PTR (ACPI_DBG2_DEVICE, Subtable->Buffer);
> +        CurrentOffset = (UINT16) sizeof (ACPI_DBG2_DEVICE);
> +
> +        ParentTable = DtPeekSubtable ();
> +        DtInsertSubtable (ParentTable, Subtable);
> +        DtPushSubtable (Subtable);
> +
> +        ParentTable = DtPeekSubtable ();
> +
> +        /* BaseAddressRegister GAS array (Required, size is RegisterCount) */
> +
> +        DeviceInfo->BaseAddressOffset = CurrentOffset;
> +        for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
> +        {
> +            Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Addr,
> +                        &Subtable, TRUE);
> +            if (ACPI_FAILURE (Status))
> +            {
> +                return (Status);
> +            }
> +
> +            CurrentOffset += (UINT16) sizeof (ACPI_GENERIC_ADDRESS);
> +            DtInsertSubtable (ParentTable, Subtable);
> +        }
> +
> +        /* AddressSize array (Required, size = RegisterCount) */
> +
> +        DeviceInfo->AddressSizeOffset = CurrentOffset;
> +        for (i = 0; *PFieldList && (i < DeviceInfo->RegisterCount); i++)
> +        {
> +            Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Size,
> +                        &Subtable, TRUE);
> +            if (ACPI_FAILURE (Status))
> +            {
> +                return (Status);
> +            }
> +
> +            CurrentOffset += (UINT16) sizeof (UINT32);
> +            DtInsertSubtable (ParentTable, Subtable);
> +        }
> +
> +        /* NamespaceString device identifier (Required, size = NamePathLength) */
> +
> +        DeviceInfo->NamepathOffset = CurrentOffset;
> +        Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2Name,
> +                    &Subtable, TRUE);
> +        if (ACPI_FAILURE (Status))
> +        {
> +            return (Status);
> +        }
> +
> +        /* Update the device info header */
> +
> +        DeviceInfo->NamepathLength = (UINT16) Subtable->Length;
> +        CurrentOffset += (UINT16) DeviceInfo->NamepathLength;
> +        DtInsertSubtable (ParentTable, Subtable);
> +
> +        /* OemData - Variable-length data (Optional, size = OemDataLength) */
> +
> +        Status = DtCompileTable (PFieldList, AcpiDmTableInfoDbg2OemData,
> +                    &Subtable, TRUE);
> +        if (ACPI_FAILURE (Status))
> +        {
> +            return (Status);
> +        }
> +
> +        /* Update the device info header (zeros if no OEM data present) */
> +
> +        DeviceInfo->OemDataOffset = 0;
> +        DeviceInfo->OemDataLength = 0;
> +
> +        /* Optional subtable (OemData) */
> +
> +        if (Subtable && Subtable->Length)
> +        {
> +            DeviceInfo->OemDataOffset = CurrentOffset;
> +            DeviceInfo->OemDataLength = (UINT16) Subtable->Length;
> +
> +            DtInsertSubtable (ParentTable, Subtable);
> +        }
> +
> +        SubtableCount--;
> +        DtPopSubtable (); /* Get next Device Information subtable */
> +    }
> +
> +    DtPopSubtable ();
> +    return (AE_OK);
> +}
> +
> +
> +/******************************************************************************
> + *
>    * FUNCTION:    DtCompileDmar
>    *
>    * PARAMETERS:  List                - Current field list pointer
> @@ -1577,6 +1727,85 @@ DtCompileMtmr (
>
>   /******************************************************************************
>    *
> + * FUNCTION:    DtCompilePcct
> + *
> + * PARAMETERS:  List                - Current field list pointer
> + *
> + * RETURN:      Status
> + *
> + * DESCRIPTION: Compile PCCT.
> + *
> + *****************************************************************************/
> +
> +ACPI_STATUS
> +DtCompilePcct (
> +    void                    **List)
> +{
> +    ACPI_STATUS             Status;
> +    DT_SUBTABLE             *Subtable;
> +    DT_SUBTABLE             *ParentTable;
> +    DT_FIELD                **PFieldList = (DT_FIELD **) List;
> +    DT_FIELD                *SubtableStart;
> +    ACPI_SUBTABLE_HEADER    *PcctHeader;
> +    ACPI_DMTABLE_INFO       *InfoTable;
> +
> +
> +    Status = DtCompileTable (PFieldList, AcpiDmTableInfoPcct,
> +                &Subtable, TRUE);
> +    if (ACPI_FAILURE (Status))
> +    {
> +        return (Status);
> +    }
> +
> +    ParentTable = DtPeekSubtable ();
> +    DtInsertSubtable (ParentTable, Subtable);
> +
> +    while (*PFieldList)
> +    {
> +        SubtableStart = *PFieldList;
> +        Status = DtCompileTable (PFieldList, AcpiDmTableInfoPcctHdr,
> +                    &Subtable, TRUE);
> +        if (ACPI_FAILURE (Status))
> +        {
> +            return (Status);
> +        }
> +
> +        ParentTable = DtPeekSubtable ();
> +        DtInsertSubtable (ParentTable, Subtable);
> +        DtPushSubtable (Subtable);
> +
> +        PcctHeader = ACPI_CAST_PTR (ACPI_SUBTABLE_HEADER, Subtable->Buffer);
> +
> +        switch (PcctHeader->Type)
> +        {
> +        case ACPI_PCCT_TYPE_GENERIC_SUBSPACE:
> +
> +            InfoTable = AcpiDmTableInfoPcct0;
> +            break;
> +
> +        default:
> +
> +            DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "PCCT");
> +            return (AE_ERROR);
> +        }
> +
> +        Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
> +        if (ACPI_FAILURE (Status))
> +        {
> +            return (Status);
> +        }
> +
> +        ParentTable = DtPeekSubtable ();
> +        DtInsertSubtable (ParentTable, Subtable);
> +        DtPopSubtable ();
> +    }
> +
> +    return (AE_OK);
> +}
> +
> +
> +/******************************************************************************
> + *
>    * FUNCTION:    DtCompilePmtt
>    *
>    * PARAMETERS:  List                - Current field list pointer
> diff --git a/src/acpica/source/compiler/dttemplate.h b/src/acpica/source/compiler/dttemplate.h
> index f131b62..d133d91 100644
> --- a/src/acpica/source/compiler/dttemplate.h
> +++ b/src/acpica/source/compiler/dttemplate.h
> @@ -246,6 +246,33 @@ const unsigned char TemplateCsrt[] =
>       0x43,0x48,0x41,0x37                       /* 00000148    "CHA7"     */
>   };
>
> +const unsigned char TemplateDbg2[] =
> +{
> +    0x44,0x42,0x47,0x32,0xB2,0x00,0x00,0x00,  /* 00000000    "DBG2...." */
> +    0x01,0xBA,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    "..INTEL " */
> +    0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45,  /* 00000010    "TEMPLATE" */
> +    0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
> +    0x15,0x11,0x13,0x20,0x2C,0x00,0x00,0x00,  /* 00000020    "... ,..." */
> +    0x02,0x00,0x00,0x00,0xEE,0x3F,0x00,0x02,  /* 00000028    ".....?.." */
> +    0x09,0x00,0x36,0x00,0x00,0x00,0x00,0x00,  /* 00000030    "..6....." */
> +    0x00,0x80,0x00,0x00,0x00,0x00,0x16,0x00,  /* 00000038    "........" */
> +    0x2E,0x00,0x01,0x32,0x00,0x03,0x88,0x77,  /* 00000040    "...2...w" */
> +    0x66,0x55,0x44,0x33,0x22,0x11,0x01,0x64,  /* 00000048    "fUD3"..d" */
> +    0x00,0x04,0x11,0x00,0xFF,0xEE,0xDD,0xCC,  /* 00000050    "........" */
> +    0xBB,0xAA,0x10,0x32,0x54,0x76,0x98,0xBA,  /* 00000058    "...2Tv.." */
> +    0xDC,0xFE,0x4D,0x79,0x44,0x65,0x76,0x69,  /* 00000060    "..MyDevi" */
> +    0x63,0x65,0x00,0xEE,0x47,0x00,0x01,0x11,  /* 00000068    "ce..G..." */
> +    0x00,0x26,0x00,0x10,0x00,0x37,0x00,0x00,  /* 00000070    ".&...7.." */
> +    0x80,0x00,0x00,0x00,0x00,0x16,0x00,0x22,  /* 00000078    "......."" */
> +    0x00,0x01,0x64,0x00,0x04,0x11,0x00,0xFF,  /* 00000080    "..d....." */
> +    0xEE,0xDD,0xCC,0xBB,0xAA,0x98,0xBA,0xDC,  /* 00000088    "........" */
> +    0xFE,0x5C,0x5C,0x5F,0x53,0x42,0x5F,0x2E,  /* 00000090    ".\\_SB_." */
> +    0x50,0x43,0x49,0x30,0x2E,0x44,0x42,0x47,  /* 00000098    "PCI0.DBG" */
> +    0x50,0x00,0x41,0x42,0x43,0x44,0x45,0x46,  /* 000000A0    "P.ABCDEF" */
> +    0x47,0x48,0x49,0x50,0x51,0x52,0x53,0x54,  /* 000000A8    "GHIPQRST" */
> +    0x55,0x56                                 /* 000000B0    "UV"       */
> +};
> +
>   const unsigned char TemplateDbgp[] =
>   {
>       0x44,0x42,0x47,0x50,0x34,0x00,0x00,0x00,  /* 00000000    "DBGP4..." */
> @@ -425,10 +452,10 @@ const unsigned char TemplateFacs[] =
>   const unsigned char TemplateFadt[] =
>   {
>       0x46,0x41,0x43,0x50,0x0C,0x01,0x00,0x00,  /* 00000000    "FACP...." */
> -    0x05,0x18,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    "..INTEL " */
> +    0x05,0x64,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    ".dINTEL " */
>       0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45,  /* 00000010    "TEMPLATE" */
>       0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
> -    0x23,0x11,0x11,0x20,0x01,0x00,0x00,0x00,  /* 00000020    "#.. ...." */
> +    0x15,0x11,0x13,0x20,0x01,0x00,0x00,0x00,  /* 00000020    "... ...." */
>       0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000028    "........" */
>       0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000030    "........" */
>       0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000038    "........" */
> @@ -451,7 +478,7 @@ const unsigned char TemplateFadt[] =
>       0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x00,  /* 000000C0    "........" */
>       0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000C8    "........" */
>       0x01,0x20,0x00,0x03,0x01,0x00,0x00,0x00,  /* 000000D0    ". ......" */
> -    0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x01,  /* 000000D8    "........" */
> +    0x00,0x00,0x00,0x00,0x01,0x40,0x00,0x01,  /* 000000D8    "..... at .." */
>       0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000E0    "........" */
>       0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000E8    "........" */
>       0x00,0x00,0x00,0x00,0x01,0x08,0x00,0x01,  /* 000000F0    "........" */
> @@ -718,6 +745,32 @@ const unsigned char TemplateMtmr[] =
>       0x00,0x00,0x00,0x00                       /* 00000048    "...."     */
>   };
>
> +const unsigned char TemplatePcct[] =
> +{
> +    0x50,0x43,0x43,0x54,0xAC,0x00,0x00,0x00,  /* 00000000    "PCCT...." */
> +    0x01,0x97,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    "..INTEL " */
> +    0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45,  /* 00000010    "TEMPLATE" */
> +    0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
> +    0x15,0x11,0x13,0x20,0x01,0x00,0x00,0x00,  /* 00000020    "... ...." */
> +    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000028    "........" */
> +    0x00,0x3E,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000030    ".>......" */
> +    0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,  /* 00000038    "........" */
> +    0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x22,  /* 00000040    """""""""" */
> +    0x01,0x32,0x00,0x03,0x33,0x33,0x33,0x33,  /* 00000048    ".2..3333" */
> +    0x33,0x33,0x33,0x33,0x44,0x44,0x44,0x44,  /* 00000050    "3333DDDD" */
> +    0x44,0x44,0x44,0x44,0x55,0x55,0x55,0x55,  /* 00000058    "DDDDUUUU" */
> +    0x55,0x55,0x55,0x55,0x66,0x66,0x66,0x66,  /* 00000060    "UUUUffff" */
> +    0x77,0x77,0x77,0x77,0x88,0x88,0x00,0x3E,  /* 00000068    "wwww...>" */
> +    0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,  /* 00000070    "........" */
> +    0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xEE,0xEE,  /* 00000078    "........" */
> +    0xEE,0xEE,0xEE,0xEE,0xEE,0xEE,0x01,0x32,  /* 00000080    ".......2" */
> +    0x00,0x03,0xDD,0xDD,0xDD,0xDD,0xDD,0xDD,  /* 00000088    "........" */
> +    0xDD,0xDD,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,  /* 00000090    "........" */
> +    0xCC,0xCC,0xBB,0xBB,0xBB,0xBB,0xBB,0xBB,  /* 00000098    "........" */
> +    0xBB,0xBB,0xAA,0xAA,0xAA,0xAA,0x99,0x99,  /* 000000A0    "........" */
> +    0x99,0x99,0x88,0x88                       /* 000000A8    "...."     */
> +};
> +
>   const unsigned char TemplatePmtt[] =
>   {
>       0x50,0x4D,0x54,0x54,0xB4,0x00,0x00,0x00,  /* 00000000    "PMTT...." */
> diff --git a/src/acpica/source/compiler/dtutils.c b/src/acpica/source/compiler/dtutils.c
> index 0045e07..d3e8616 100644
> --- a/src/acpica/source/compiler/dtutils.c
> +++ b/src/acpica/source/compiler/dtutils.c
> @@ -604,6 +604,7 @@ DtGetFieldLength (
>       case ACPI_DMT_ACCWIDTH:
>       case ACPI_DMT_IVRS:
>       case ACPI_DMT_MADT:
> +    case ACPI_DMT_PCCT:
>       case ACPI_DMT_PMTT:
>       case ACPI_DMT_SRAT:
>       case ACPI_DMT_ASF:
> diff --git a/src/acpica/source/components/debugger/dbfileio.c b/src/acpica/source/components/debugger/dbfileio.c
> index 1f0ae72..e9a9ad6 100644
> --- a/src/acpica/source/components/debugger/dbfileio.c
> +++ b/src/acpica/source/components/debugger/dbfileio.c
> @@ -132,16 +132,6 @@
>   #define _COMPONENT          ACPI_CA_DEBUGGER
>           ACPI_MODULE_NAME    ("dbfileio")
>
> -/*
> - * NOTE: this is here for lack of a better place. It is used in all
> - * flavors of the debugger, need LCD file
> - */
> -#ifdef ACPI_APPLICATION
> -#include <stdio.h>
> -FILE                        *AcpiGbl_DebugFile = NULL;
> -#endif
> -
> -
>   #ifdef ACPI_DEBUGGER
>
>   /* Local prototypes */
> diff --git a/src/acpica/source/components/debugger/dbinput.c b/src/acpica/source/components/debugger/dbinput.c
> index 91f4e62..4b60389 100644
> --- a/src/acpica/source/components/debugger/dbinput.c
> +++ b/src/acpica/source/components/debugger/dbinput.c
> @@ -200,7 +200,7 @@ enum AcpiExDebuggerCommands
>       CMD_METHODS,
>       CMD_NAMESPACE,
>       CMD_NOTIFY,
> -    CMD_OBJECT,
> +    CMD_OBJECTS,
>       CMD_OPEN,
>       CMD_OSI,
>       CMD_OWNER,
> @@ -273,7 +273,7 @@ static const ACPI_DB_COMMAND_INFO   AcpiGbl_DbCommands[] =
>       {"METHODS",      0},
>       {"NAMESPACE",    0},
>       {"NOTIFY",       2},
> -    {"OBJECT",       1},
> +    {"OBJECTS",      1},
>       {"OPEN",         1},
>       {"OSI",          0},
>       {"OWNER",        1},
> @@ -1072,7 +1072,7 @@ AcpiDbCommandDispatch (
>           AcpiDbSendNotify (AcpiGbl_DbArgs[1], Temp);
>           break;
>
> -    case CMD_OBJECT:
> +    case CMD_OBJECTS:
>
>           AcpiUtStrupr (AcpiGbl_DbArgs[1]);
>           Status = AcpiDbDisplayObjects (AcpiGbl_DbArgs[1], AcpiGbl_DbArgs[2]);
> diff --git a/src/acpica/source/components/dispatcher/dsfield.c b/src/acpica/source/components/dispatcher/dsfield.c
> index 56a8d3e..812c30b 100644
> --- a/src/acpica/source/components/dispatcher/dsfield.c
> +++ b/src/acpica/source/components/dispatcher/dsfield.c
> @@ -188,7 +188,7 @@ AcpiDsCreateExternalRegion (
>        * OperationRegion not found. Generate an External for it, and
>        * insert the name into the namespace.
>        */
> -    AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_REGION, 0);
> +    AcpiDmAddOpToExternalList (Op, Path, ACPI_TYPE_REGION, 0, 0);
>       Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_REGION,
>          ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, WalkState, Node);
>       if (ACPI_FAILURE (Status))
> diff --git a/src/acpica/source/components/dispatcher/dsutils.c b/src/acpica/source/components/dispatcher/dsutils.c
> index d3c9580..7757238 100644
> --- a/src/acpica/source/components/dispatcher/dsutils.c
> +++ b/src/acpica/source/components/dispatcher/dsutils.c
> @@ -851,16 +851,16 @@ AcpiDsCreateOperands (
>           Index++;
>       }
>
> -    Index--;
> +    ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
> +        "NumOperands %d, ArgCount %d, Index %d\n",
> +        WalkState->NumOperands, ArgCount, Index));
>
> -    /* It is the appropriate order to get objects from the Result stack */
> +    /* Create the interpreter arguments, in reverse order */
>
> +    Index--;
>       for (i = 0; i < ArgCount; i++)
>       {
>           Arg = Arguments[Index];
> -
> -        /* Force the filling of the operand stack in inverse order */
> -
>           WalkState->OperandIndex = (UINT8) Index;
>
>           Status = AcpiDsCreateOperand (WalkState, Arg, Index);
> @@ -869,10 +869,10 @@ AcpiDsCreateOperands (
>               goto Cleanup;
>           }
>
> +        ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
> +            "Created Arg #%u (%p) %u args total\n",
> +            Index, Arg, ArgCount));
>           Index--;
> -
> -        ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Arg #%u (%p) done, Arg1=%p\n",
> -            Index, Arg, FirstArg));
>       }
>
>       return_ACPI_STATUS (Status);
> diff --git a/src/acpica/source/components/dispatcher/dswexec.c b/src/acpica/source/components/dispatcher/dswexec.c
> index fdc79fe..b8c5be3 100644
> --- a/src/acpica/source/components/dispatcher/dswexec.c
> +++ b/src/acpica/source/components/dispatcher/dswexec.c
> @@ -613,7 +613,8 @@ AcpiDsExecEndOp (
>                   return_ACPI_STATUS (AE_OK);
>               }
>
> -            ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Method invocation, Op=%p\n", Op));
> +            ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
> +                "Method invocation, Op=%p\n", Op));
>
>               /*
>                * (AML_METHODCALL) Op->Asl.Value.Arg->Asl.Node contains
> diff --git a/src/acpica/source/components/dispatcher/dswload.c b/src/acpica/source/components/dispatcher/dswload.c
> index 291fced..d7c437a 100644
> --- a/src/acpica/source/components/dispatcher/dswload.c
> +++ b/src/acpica/source/components/dispatcher/dswload.c
> @@ -265,7 +265,7 @@ AcpiDsLoad1BeginOp (
>                * Target of Scope() not found. Generate an External for it, and
>                * insert the name into the namespace.
>                */
> -            AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_DEVICE, 0);
> +            AcpiDmAddOpToExternalList (Op, Path, ACPI_TYPE_DEVICE, 0, 0);
>               Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
>                          ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT,
>                          WalkState, &Node);
> diff --git a/src/acpica/source/components/events/evgpeblk.c b/src/acpica/source/components/events/evgpeblk.c
> index aed636f..4d45cf0 100644
> --- a/src/acpica/source/components/events/evgpeblk.c
> +++ b/src/acpica/source/components/events/evgpeblk.c
> @@ -169,10 +169,9 @@ AcpiEvInstallGpeBlock (
>           return_ACPI_STATUS (Status);
>       }
>
> -    GpeXruptBlock = AcpiEvGetGpeXruptBlock (InterruptNumber);
> -    if (!GpeXruptBlock)
> +    Status = AcpiEvGetGpeXruptBlock (InterruptNumber, &GpeXruptBlock);
> +    if (ACPI_FAILURE (Status))
>       {
> -        Status = AE_NO_MEMORY;
>           goto UnlockAndExit;
>       }
>
> @@ -200,7 +199,7 @@ AcpiEvInstallGpeBlock (
>
>
>   UnlockAndExit:
> -    Status = AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
> +    (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
>       return_ACPI_STATUS (Status);
>   }
>
> diff --git a/src/acpica/source/components/events/evgpeutil.c b/src/acpica/source/components/events/evgpeutil.c
> index fd0d717..57a2385 100644
> --- a/src/acpica/source/components/events/evgpeutil.c
> +++ b/src/acpica/source/components/events/evgpeutil.c
> @@ -289,8 +289,9 @@ AcpiEvGetGpeDevice (
>    * FUNCTION:    AcpiEvGetGpeXruptBlock
>    *
>    * PARAMETERS:  InterruptNumber             - Interrupt for a GPE block
> + *              GpeXruptBlock               - Where the block is returned
>    *
> - * RETURN:      A GPE interrupt block
> + * RETURN:      Status
>    *
>    * DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt
>    *              block per unique interrupt level used for GPEs. Should be
> @@ -299,9 +300,10 @@ AcpiEvGetGpeDevice (
>    *
>    ******************************************************************************/
>
> -ACPI_GPE_XRUPT_INFO *
> +ACPI_STATUS
>   AcpiEvGetGpeXruptBlock (
> -    UINT32                  InterruptNumber)
> +    UINT32                  InterruptNumber,
> +    ACPI_GPE_XRUPT_INFO     **GpeXruptBlock)
>   {
>       ACPI_GPE_XRUPT_INFO     *NextGpeXrupt;
>       ACPI_GPE_XRUPT_INFO     *GpeXrupt;
> @@ -319,7 +321,8 @@ AcpiEvGetGpeXruptBlock (
>       {
>           if (NextGpeXrupt->InterruptNumber == InterruptNumber)
>           {
> -            return_PTR (NextGpeXrupt);
> +            *GpeXruptBlock = NextGpeXrupt;
> +            return_ACPI_STATUS (AE_OK);
>           }
>
>           NextGpeXrupt = NextGpeXrupt->Next;
> @@ -330,7 +333,7 @@ AcpiEvGetGpeXruptBlock (
>       GpeXrupt = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_XRUPT_INFO));
>       if (!GpeXrupt)
>       {
> -        return_PTR (NULL);
> +        return_ACPI_STATUS (AE_NO_MEMORY);
>       }
>
>       GpeXrupt->InterruptNumber = InterruptNumber;
> @@ -353,6 +356,7 @@ AcpiEvGetGpeXruptBlock (
>       {
>           AcpiGbl_GpeXruptListHead = GpeXrupt;
>       }
> +
>       AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
>
>       /* Install new interrupt handler if not SCI_INT */
> @@ -363,14 +367,15 @@ AcpiEvGetGpeXruptBlock (
>                       AcpiEvGpeXruptHandler, GpeXrupt);
>           if (ACPI_FAILURE (Status))
>           {
> -            ACPI_ERROR ((AE_INFO,
> +            ACPI_EXCEPTION ((AE_INFO, Status,
>                   "Could not install GPE interrupt handler at level 0x%X",
>                   InterruptNumber));
> -            return_PTR (NULL);
> +            return_ACPI_STATUS (Status);
>           }
>       }
>
> -    return_PTR (GpeXrupt);
> +    *GpeXruptBlock = GpeXrupt;
> +    return_ACPI_STATUS (AE_OK);
>   }
>
>
> diff --git a/src/acpica/source/components/executer/exresnte.c b/src/acpica/source/components/executer/exresnte.c
> index 3c0565c..6100be0 100644
> --- a/src/acpica/source/components/executer/exresnte.c
> +++ b/src/acpica/source/components/executer/exresnte.c
> @@ -206,8 +206,8 @@ AcpiExResolveNodeToValue (
>
>       if (!SourceDesc)
>       {
> -        ACPI_ERROR ((AE_INFO, "No object attached to node %p",
> -            Node));
> +        ACPI_ERROR ((AE_INFO, "No object attached to node [%4.4s] %p",
> +            Node->Name.Ascii, Node));
>           return_ACPI_STATUS (AE_AML_NO_OPERAND);
>       }
>
> diff --git a/src/acpica/source/components/namespace/nsxfeval.c b/src/acpica/source/components/namespace/nsxfeval.c
> index d8b3480..881945e 100644
> --- a/src/acpica/source/components/namespace/nsxfeval.c
> +++ b/src/acpica/source/components/namespace/nsxfeval.c
> @@ -164,7 +164,7 @@ AcpiEvaluateObjectTyped (
>       ACPI_OBJECT_TYPE        ReturnType)
>   {
>       ACPI_STATUS             Status;
> -    BOOLEAN                 MustFree = FALSE;
> +    BOOLEAN                 FreeBufferOnError = FALSE;
>
>
>       ACPI_FUNCTION_TRACE (AcpiEvaluateObjectTyped);
> @@ -179,12 +179,13 @@ AcpiEvaluateObjectTyped (
>
>       if (ReturnBuffer->Length == ACPI_ALLOCATE_BUFFER)
>       {
> -        MustFree = TRUE;
> +        FreeBufferOnError = TRUE;
>       }
>
>       /* Evaluate the object */
>
> -    Status = AcpiEvaluateObject (Handle, Pathname, ExternalParams, ReturnBuffer);
> +    Status = AcpiEvaluateObject (Handle, Pathname,
> +        ExternalParams, ReturnBuffer);
>       if (ACPI_FAILURE (Status))
>       {
>           return_ACPI_STATUS (Status);
> @@ -219,13 +220,14 @@ AcpiEvaluateObjectTyped (
>           AcpiUtGetTypeName (((ACPI_OBJECT *) ReturnBuffer->Pointer)->Type),
>           AcpiUtGetTypeName (ReturnType)));
>
> -    if (MustFree)
> +    if (FreeBufferOnError)
>       {
>           /*
> -         * Caller used ACPI_ALLOCATE_BUFFER, free the return buffer.
> +         * Free a buffer created via ACPI_ALLOCATE_BUFFER.
>            * Note: We use AcpiOsFree here because AcpiOsAllocate was used
> -         * to allocate the buffer. This purposefully bypasses the internal
> -         * allocation tracking mechanism (if it is enabled).
> +         * to allocate the buffer. This purposefully bypasses the
> +         * (optionally enabled) allocation tracking mechanism since we
> +         * only want to track internal allocations.
>            */
>           AcpiOsFree (ReturnBuffer->Pointer);
>           ReturnBuffer->Pointer = NULL;
> diff --git a/src/acpica/source/components/parser/psopinfo.c b/src/acpica/source/components/parser/psopinfo.c
> index 9b97f74..f614f6b 100644
> --- a/src/acpica/source/components/parser/psopinfo.c
> +++ b/src/acpica/source/components/parser/psopinfo.c
> @@ -148,6 +148,10 @@ const ACPI_OPCODE_INFO *
>   AcpiPsGetOpcodeInfo (
>       UINT16                  Opcode)
>   {
> +#ifdef ACPI_DEBUG_OUTPUT
> +    const char              *OpcodeName = "Unknown AML opcode";
> +#endif
> +
>       ACPI_FUNCTION_NAME (PsGetOpcodeInfo);
>
>
> @@ -169,10 +173,56 @@ AcpiPsGetOpcodeInfo (
>           return (&AcpiGbl_AmlOpInfo [AcpiGbl_LongOpIndex [(UINT8) Opcode]]);
>       }
>
> +#if defined ACPI_ASL_COMPILER && defined ACPI_DEBUG_OUTPUT
> +#include "asldefine.h"
> +
> +    switch (Opcode)
> +    {
> +    case AML_RAW_DATA_BYTE:
> +        OpcodeName = "-Raw Data Byte-";
> +        break;
> +
> +    case AML_RAW_DATA_WORD:
> +        OpcodeName = "-Raw Data Word-";
> +        break;
> +
> +    case AML_RAW_DATA_DWORD:
> +        OpcodeName = "-Raw Data Dword-";
> +        break;
> +
> +    case AML_RAW_DATA_QWORD:
> +        OpcodeName = "-Raw Data Qword-";
> +        break;
> +
> +    case AML_RAW_DATA_BUFFER:
> +        OpcodeName = "-Raw Data Buffer-";
> +        break;
> +
> +    case AML_RAW_DATA_CHAIN:
> +        OpcodeName = "-Raw Data Buffer Chain-";
> +        break;
> +
> +    case AML_PACKAGE_LENGTH:
> +        OpcodeName = "-Package Length-";
> +        break;
> +
> +    case AML_UNASSIGNED_OPCODE:
> +        OpcodeName = "-Unassigned Opcode-";
> +        break;
> +
> +    case AML_DEFAULT_ARG_OP:
> +        OpcodeName = "-Default Arg-";
> +        break;
> +
> +    default:
> +        break;
> +    }
> +#endif
> +
>       /* Unknown AML opcode */
>
>       ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
> -        "Unknown AML opcode [%4.4X]\n", Opcode));
> +        "%s [%4.4X]\n", OpcodeName, Opcode));
>
>       return (&AcpiGbl_AmlOpInfo [_UNK]);
>   }
> diff --git a/src/acpica/source/components/tables/tbfadt.c b/src/acpica/source/components/tables/tbfadt.c
> index d90baba..5f7bab5 100644
> --- a/src/acpica/source/components/tables/tbfadt.c
> +++ b/src/acpica/source/components/tables/tbfadt.c
> @@ -137,13 +137,15 @@ AcpiTbConvertFadt (
>       void);
>
>   static void
> -AcpiTbValidateFadt (
> -    void);
> -
> -static void
>   AcpiTbSetupFadtRegisters (
>       void);
>
> +static UINT64
> +AcpiTbSelectAddress (
> +    char                    *RegisterName,
> +    UINT32                  Address32,
> +    UINT64                  Address64);
> +
>
>   /* Table for conversion of FADT to common internal format and FADT validation */
>
> @@ -266,6 +268,7 @@ static ACPI_FADT_PM_INFO    FadtPmInfoTable[] =
>    *              SpaceId             - ACPI Space ID for this register
>    *              ByteWidth           - Width of this register
>    *              Address             - Address of the register
> + *              RegisterName        - ASCII name of the ACPI register
>    *
>    * RETURN:      None
>    *
> @@ -317,6 +320,72 @@ AcpiTbInitGenericAddress (
>
>   /*******************************************************************************
>    *
> + * FUNCTION:    AcpiTbSelectAddress
> + *
> + * PARAMETERS:  RegisterName        - ASCII name of the ACPI register
> + *              Address32           - 32-bit address of the register
> + *              Address64           - 64-bit address of the register
> + *
> + * RETURN:      The resolved 64-bit address
> + *
> + * DESCRIPTION: Select between 32-bit and 64-bit versions of addresses within
> + *              the FADT. Used for the FACS and DSDT addresses.
> + *
> + * NOTES:
> + *
> + * Check for FACS and DSDT address mismatches. An address mismatch between
> + * the 32-bit and 64-bit address fields (FIRMWARE_CTRL/X_FIRMWARE_CTRL and
> + * DSDT/X_DSDT) could be a corrupted address field or it might indicate
> + * the presence of two FACS or two DSDT tables.
> + *
> + * November 2013:
> + * By default, as per the ACPICA specification, a valid 64-bit address is
> + * used regardless of the value of the 32-bit address. However, this
> + * behavior can be overridden via the AcpiGbl_Use32BitFadtAddresses flag.
> + *
> + ******************************************************************************/
> +
> +static UINT64
> +AcpiTbSelectAddress (
> +    char                    *RegisterName,
> +    UINT32                  Address32,
> +    UINT64                  Address64)
> +{
> +
> +    if (!Address64)
> +    {
> +        /* 64-bit address is zero, use 32-bit address */
> +
> +        return ((UINT64) Address32);
> +    }
> +
> +    if (Address32 &&
> +       (Address64 != (UINT64) Address32))
> +    {
> +        /* Address mismatch between 32-bit and 64-bit versions */
> +
> +        ACPI_BIOS_WARNING ((AE_INFO,
> +            "32/64X %s address mismatch in FADT: "
> +            "0x%8.8X/0x%8.8X%8.8X, using %u-bit address",
> +            RegisterName, Address32, ACPI_FORMAT_UINT64 (Address64),
> +            AcpiGbl_Use32BitFadtAddresses ? 32 : 64));
> +
> +        /* 32-bit address override */
> +
> +        if (AcpiGbl_Use32BitFadtAddresses)
> +        {
> +            return ((UINT64) Address32);
> +        }
> +    }
> +
> +    /* Default is to use the 64-bit address */
> +
> +    return (Address64);
> +}
> +
> +
> +/*******************************************************************************
> + *
>    * FUNCTION:    AcpiTbParseFadt
>    *
>    * PARAMETERS:  TableIndex          - Index for the FADT
> @@ -437,10 +506,6 @@ AcpiTbCreateLocalFadt (
>
>       AcpiTbConvertFadt ();
>
> -    /* Validate FADT values now, before we make any changes */
> -
> -    AcpiTbValidateFadt ();
> -
>       /* Initialize the global ACPI register structures */
>
>       AcpiTbSetupFadtRegisters ();
> @@ -451,33 +516,43 @@ AcpiTbCreateLocalFadt (
>    *
>    * FUNCTION:    AcpiTbConvertFadt
>    *
> - * PARAMETERS:  None, uses AcpiGbl_FADT
> + * PARAMETERS:  None - AcpiGbl_FADT is used.
>    *
>    * RETURN:      None
>    *
>    * DESCRIPTION: Converts all versions of the FADT to a common internal format.
> - *              Expand 32-bit addresses to 64-bit as necessary.
> + *              Expand 32-bit addresses to 64-bit as necessary. Also validate
> + *              important fields within the FADT.
>    *
> - * NOTE:        AcpiGbl_FADT must be of size (ACPI_TABLE_FADT),
> - *              and must contain a copy of the actual FADT.
> + * NOTE:        AcpiGbl_FADT must be of size (ACPI_TABLE_FADT), and must
> + *              contain a copy of the actual BIOS-provided FADT.
>    *
>    * Notes on 64-bit register addresses:
>    *
>    * After this FADT conversion, later ACPICA code will only use the 64-bit "X"
>    * fields of the FADT for all ACPI register addresses.
>    *
> - * The 64-bit "X" fields are optional extensions to the original 32-bit FADT
> + * 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 if the corresponding X field is zero.
> + * 32-bit V1.0 fields to the 64-bit X fields if the the 64-bit X field is
> + * originally zero.
>    *
> - * For ACPI 1.0 FADTs, all 32-bit address fields are expanded to the
> - * corresponding "X" fields in the internal FADT.
> + * 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
> + * common FADT.
>    *
>    * For ACPI 2.0+ FADTs, all valid (non-zero) 32-bit address fields are expanded
> - * to the corresponding 64-bit X fields. For compatibility with other ACPI
> - * implementations, we ignore the 64-bit field if the 32-bit field is valid,
> - * regardless of whether the host OS is 32-bit or 64-bit.
> + * to the corresponding 64-bit X fields, if the 64-bit field is originally
> + * zero. Adhering to the ACPI specification, we completely ignore the 32-bit
> + * field if the 64-bit field is valid, regardless of whether the host OS is
> + * 32-bit or 64-bit.
> + *
> + * Possible additional checks:
> + *  (AcpiGbl_FADT.Pm1EventLength >= 4)
> + *  (AcpiGbl_FADT.Pm1ControlLength >= 2)
> + *  (AcpiGbl_FADT.PmTimerLength >= 4)
> + *  Gpe block lengths must be multiple of 2
>    *
>    ******************************************************************************/
>
> @@ -485,25 +560,14 @@ static void
>   AcpiTbConvertFadt (
>       void)
>   {
> +    char                    *Name;
>       ACPI_GENERIC_ADDRESS    *Address64;
>       UINT32                  Address32;
> +    UINT8                   Length;
>       UINT32                  i;
>
>
>       /*
> -     * Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary.
> -     * Later code will always use the X 64-bit field.
> -     */
> -    if (!AcpiGbl_FADT.XFacs)
> -    {
> -        AcpiGbl_FADT.XFacs = (UINT64) AcpiGbl_FADT.Facs;
> -    }
> -    if (!AcpiGbl_FADT.XDsdt)
> -    {
> -        AcpiGbl_FADT.XDsdt = (UINT64) AcpiGbl_FADT.Dsdt;
> -    }
> -
> -    /*
>        * For ACPI 1.0 FADTs (revision 1 or 2), ensure that reserved fields which
>        * should be zero are indeed zero. This will workaround BIOSs that
>        * inadvertently place values in these fields.
> @@ -530,113 +594,14 @@ AcpiTbConvertFadt (
>       AcpiGbl_FADT.Header.Length = sizeof (ACPI_TABLE_FADT);
>
>       /*
> -     * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X"
> -     * generic address structures as necessary. Later code will always use
> -     * the 64-bit address structures.
> -     *
> -     * March 2009:
> -     * We now always use the 32-bit address if it is valid (non-null). This
> -     * is not in accordance with the ACPI specification which states that
> -     * the 64-bit address supersedes the 32-bit version, but we do this for
> -     * compatibility with other ACPI implementations. Most notably, in the
> -     * case where both the 32 and 64 versions are non-null, we use the 32-bit
> -     * version. This is the only address that is guaranteed to have been
> -     * tested by the BIOS manufacturer.
> -     */
> -    for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++)
> -    {
> -        Address32 = *ACPI_ADD_PTR (UINT32,
> -            &AcpiGbl_FADT, FadtInfoTable[i].Address32);
> -
> -        Address64 = ACPI_ADD_PTR (ACPI_GENERIC_ADDRESS,
> -            &AcpiGbl_FADT, FadtInfoTable[i].Address64);
> -
> -        /*
> -         * If both 32- and 64-bit addresses are valid (non-zero),
> -         * they must match.
> -         */
> -        if (Address64->Address && Address32 &&
> -           (Address64->Address != (UINT64) Address32))
> -        {
> -            ACPI_BIOS_ERROR ((AE_INFO,
> -                "32/64X address mismatch in FADT/%s: "
> -                "0x%8.8X/0x%8.8X%8.8X, using 32",
> -                FadtInfoTable[i].Name, Address32,
> -                ACPI_FORMAT_UINT64 (Address64->Address)));
> -        }
> -
> -        /* Always use 32-bit address if it is valid (non-null) */
> -
> -        if (Address32)
> -        {
> -            /*
> -             * Copy the 32-bit address to the 64-bit GAS structure. The
> -             * Space ID is always I/O for 32-bit legacy address fields
> -             */
> -            AcpiTbInitGenericAddress (Address64, ACPI_ADR_SPACE_SYSTEM_IO,
> -                *ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT, FadtInfoTable[i].Length),
> -                (UINT64) Address32, FadtInfoTable[i].Name);
> -        }
> -    }
> -}
> -
> -
> -/*******************************************************************************
> - *
> - * FUNCTION:    AcpiTbValidateFadt
> - *
> - * PARAMETERS:  Table           - Pointer to the FADT to be validated
> - *
> - * RETURN:      None
> - *
> - * DESCRIPTION: Validate various important fields within the FADT. If a problem
> - *              is found, issue a message, but no status is returned.
> - *              Used by both the table manager and the disassembler.
> - *
> - * Possible additional checks:
> - * (AcpiGbl_FADT.Pm1EventLength >= 4)
> - * (AcpiGbl_FADT.Pm1ControlLength >= 2)
> - * (AcpiGbl_FADT.PmTimerLength >= 4)
> - * Gpe block lengths must be multiple of 2
> - *
> - ******************************************************************************/
> -
> -static void
> -AcpiTbValidateFadt (
> -    void)
> -{
> -    char                    *Name;
> -    ACPI_GENERIC_ADDRESS    *Address64;
> -    UINT8                   Length;
> -    UINT32                  i;
> -
> -
> -    /*
> -     * Check for FACS and DSDT address mismatches. An address mismatch between
> -     * the 32-bit and 64-bit address fields (FIRMWARE_CTRL/X_FIRMWARE_CTRL and
> -     * DSDT/X_DSDT) would indicate the presence of two FACS or two DSDT tables.
> +     * Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary.
> +     * Later ACPICA code will always use the X 64-bit field.
>        */
> -    if (AcpiGbl_FADT.Facs &&
> -        (AcpiGbl_FADT.XFacs != (UINT64) AcpiGbl_FADT.Facs))
> -    {
> -        ACPI_BIOS_WARNING ((AE_INFO,
> -            "32/64X FACS address mismatch in FADT - "
> -            "0x%8.8X/0x%8.8X%8.8X, using 32",
> -            AcpiGbl_FADT.Facs, ACPI_FORMAT_UINT64 (AcpiGbl_FADT.XFacs)));
> +    AcpiGbl_FADT.XFacs = AcpiTbSelectAddress ("FACS",
> +        AcpiGbl_FADT.Facs, AcpiGbl_FADT.XFacs);
>
> -        AcpiGbl_FADT.XFacs = (UINT64) AcpiGbl_FADT.Facs;
> -    }
> -
> -    if (AcpiGbl_FADT.Dsdt &&
> -        (AcpiGbl_FADT.XDsdt != (UINT64) AcpiGbl_FADT.Dsdt))
> -    {
> -        ACPI_BIOS_WARNING ((AE_INFO,
> -            "32/64X DSDT address mismatch in FADT - "
> -            "0x%8.8X/0x%8.8X%8.8X, using 32",
> -            AcpiGbl_FADT.Dsdt, ACPI_FORMAT_UINT64 (AcpiGbl_FADT.XDsdt)));
> -
> -        AcpiGbl_FADT.XDsdt = (UINT64) AcpiGbl_FADT.Dsdt;
> -    }
> +    AcpiGbl_FADT.XDsdt = AcpiTbSelectAddress ("DSDT",
> +        AcpiGbl_FADT.Dsdt, AcpiGbl_FADT.XDsdt);
>
>       /* If Hardware Reduced flag is set, we are all done */
>
> @@ -650,16 +615,82 @@ AcpiTbValidateFadt (
>       for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++)
>       {
>           /*
> -         * Generate pointer to the 64-bit address, get the register
> -         * length (width) and the register name
> +         * Get the 32-bit and 64-bit addresses, as well as the register
> +         * length and register name.
>            */
> +        Address32 = *ACPI_ADD_PTR (UINT32,
> +            &AcpiGbl_FADT, FadtInfoTable[i].Address32);
> +
>           Address64 = ACPI_ADD_PTR (ACPI_GENERIC_ADDRESS,
> -                        &AcpiGbl_FADT, FadtInfoTable[i].Address64);
> +            &AcpiGbl_FADT, FadtInfoTable[i].Address64);
> +
>           Length = *ACPI_ADD_PTR (UINT8,
> -                        &AcpiGbl_FADT, FadtInfoTable[i].Length);
> +            &AcpiGbl_FADT, FadtInfoTable[i].Length);
> +
>           Name = FadtInfoTable[i].Name;
>
>           /*
> +         * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X"
> +         * generic address structures as necessary. Later code will always use
> +         * the 64-bit address structures.
> +         *
> +         * November 2013:
> +         * Now always use the 64-bit address if it is valid (non-zero), in
> +         * accordance with the ACPI specification which states that a 64-bit
> +         * address supersedes the 32-bit version. This behavior can be
> +         * overridden by the AcpiGbl_Use32BitFadtAddresses flag.
> +         *
> +         * During 64-bit address construction and verification,
> +         * these cases are handled:
> +         *
> +         * Address32 zero, Address64 [don't care]   - Use Address64
> +         *
> +         * Address32 non-zero, Address64 zero       - Copy/use Address32
> +         * Address32 non-zero == Address64 non-zero - Use Address64
> +         * Address32 non-zero != Address64 non-zero - Warning, use Address64
> +         *
> +         * Override: if AcpiGbl_Use32BitFadtAddresses is TRUE, and:
> +         * Address32 non-zero != Address64 non-zero - Warning, copy/use Address32
> +         *
> +         * Note: SpaceId is always I/O for 32-bit legacy address fields
> +         */
> +        if (Address32)
> +        {
> +            if (!Address64->Address)
> +            {
> +                /* 64-bit address is zero, use 32-bit address */
> +
> +                AcpiTbInitGenericAddress (Address64,
> +                    ACPI_ADR_SPACE_SYSTEM_IO,
> +                    *ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT,
> +                        FadtInfoTable[i].Length),
> +                    (UINT64) Address32, Name);
> +            }
> +            else if (Address64->Address != (UINT64) Address32)
> +            {
> +                /* Address mismatch */
> +
> +                ACPI_BIOS_WARNING ((AE_INFO,
> +                    "32/64X address mismatch in FADT/%s: "
> +                    "0x%8.8X/0x%8.8X%8.8X, using %u-bit address",
> +                    Name, Address32,
> +                    ACPI_FORMAT_UINT64 (Address64->Address),
> +                    AcpiGbl_Use32BitFadtAddresses ? 32 : 64));
> +
> +                if (AcpiGbl_Use32BitFadtAddresses)
> +                {
> +                    /* 32-bit address override */
> +
> +                    AcpiTbInitGenericAddress (Address64,
> +                        ACPI_ADR_SPACE_SYSTEM_IO,
> +                        *ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT,
> +                            FadtInfoTable[i].Length),
> +                        (UINT64) Address32, Name);
> +                }
> +            }
> +        }
> +
> +        /*
>            * For each extended field, check for length mismatch between the
>            * legacy length field and the corresponding 64-bit X length field.
>            * Note: If the legacy length field is > 0xFF bits, ignore this
> diff --git a/src/acpica/source/components/tables/tbutils.c b/src/acpica/source/components/tables/tbutils.c
> index 1d4a538..97aaef2 100644
> --- a/src/acpica/source/components/tables/tbutils.c
> +++ b/src/acpica/source/components/tables/tbutils.c
> @@ -125,6 +125,10 @@
>
>   /* Local prototypes */
>
> +static ACPI_STATUS
> +AcpiTbValidateXsdt (
> +    ACPI_PHYSICAL_ADDRESS   Address);
> +
>   static ACPI_PHYSICAL_ADDRESS
>   AcpiTbGetRootTableEntry (
>       UINT8                   *TableEntry,
> @@ -425,7 +429,7 @@ AcpiTbGetRootTableEntry (
>        * Get the table physical address (32-bit for RSDT, 64-bit for XSDT):
>        * Note: Addresses are 32-bit aligned (not 64) in both RSDT and XSDT
>        */
> -    if (TableEntrySize == sizeof (UINT32))
> +    if (TableEntrySize == ACPI_RSDT_ENTRY_SIZE)
>       {
>           /*
>            * 32-bit platform, RSDT: Return 32-bit table entry
> @@ -460,6 +464,92 @@ AcpiTbGetRootTableEntry (
>
>   /*******************************************************************************
>    *
> + * FUNCTION:    AcpiTbValidateXsdt
> + *
> + * PARAMETERS:  Address             - Physical address of the XSDT (from RSDP)
> + *
> + * RETURN:      Status. AE_OK if the table appears to be valid.
> + *
> + * DESCRIPTION: Validate an XSDT to ensure that it is of minimum size and does
> + *              not contain any NULL entries. A problem that is seen in the
> + *              field is that the XSDT exists, but is actually useless because
> + *              of one or more (or all) NULL entries.
> + *
> + ******************************************************************************/
> +
> +static ACPI_STATUS
> +AcpiTbValidateXsdt (
> +    ACPI_PHYSICAL_ADDRESS   XsdtAddress)
> +{
> +    ACPI_TABLE_HEADER       *Table;
> +    UINT8                   *NextEntry;
> +    ACPI_PHYSICAL_ADDRESS   Address;
> +    UINT32                  Length;
> +    UINT32                  EntryCount;
> +    ACPI_STATUS             Status;
> +    UINT32                  i;
> +
> +
> +    /* Get the XSDT length */
> +
> +    Table = AcpiOsMapMemory (XsdtAddress, sizeof (ACPI_TABLE_HEADER));
> +    if (!Table)
> +    {
> +        return (AE_NO_MEMORY);
> +    }
> +
> +    Length = Table->Length;
> +    AcpiOsUnmapMemory (Table, sizeof (ACPI_TABLE_HEADER));
> +
> +    /*
> +     * Minimum XSDT length is the size of the standard ACPI header
> +     * plus one physical address entry
> +     */
> +    if (Length < (sizeof (ACPI_TABLE_HEADER) + ACPI_XSDT_ENTRY_SIZE))
> +    {
> +        return (AE_INVALID_TABLE_LENGTH);
> +    }
> +
> +    /* Map the entire XSDT */
> +
> +    Table = AcpiOsMapMemory (XsdtAddress, Length);
> +    if (!Table)
> +    {
> +        return (AE_NO_MEMORY);
> +    }
> +
> +    /* Get the number of entries and pointer to first entry */
> +
> +    Status = AE_OK;
> +    NextEntry = ACPI_ADD_PTR (UINT8, Table, sizeof (ACPI_TABLE_HEADER));
> +    EntryCount = (UINT32) ((Table->Length - sizeof (ACPI_TABLE_HEADER)) /
> +        ACPI_XSDT_ENTRY_SIZE);
> +
> +    /* Validate each entry (physical address) within the XSDT */
> +
> +    for (i = 0; i < EntryCount; i++)
> +    {
> +        Address = AcpiTbGetRootTableEntry (NextEntry, ACPI_XSDT_ENTRY_SIZE);
> +        if (!Address)
> +        {
> +            /* Detected a NULL entry, XSDT is invalid */
> +
> +            Status = AE_NULL_ENTRY;
> +            break;
> +        }
> +
> +        NextEntry += ACPI_XSDT_ENTRY_SIZE;
> +    }
> +
> +    /* Unmap table */
> +
> +    AcpiOsUnmapMemory (Table, Length);
> +    return (Status);
> +}
> +
> +
> +/*******************************************************************************
> + *
>    * FUNCTION:    AcpiTbParseRootTable
>    *
>    * PARAMETERS:  Rsdp                    - Pointer to the RSDP
> @@ -493,9 +583,8 @@ AcpiTbParseRootTable (
>       ACPI_FUNCTION_TRACE (TbParseRootTable);
>
>
> -    /*
> -     * Map the entire RSDP and extract the address of the RSDT or XSDT
> -     */
> +    /* Map the entire RSDP and extract the address of the RSDT or XSDT */
> +
>       Rsdp = AcpiOsMapMemory (RsdpAddress, sizeof (ACPI_TABLE_RSDP));
>       if (!Rsdp)
>       {
> @@ -505,24 +594,26 @@ AcpiTbParseRootTable (
>       AcpiTbPrintTableHeader (RsdpAddress,
>           ACPI_CAST_PTR (ACPI_TABLE_HEADER, Rsdp));
>
> -    /* Differentiate between RSDT and XSDT root tables */
> +    /* Use XSDT if present and not overridden. Otherwise, use RSDT */
>
> -    if (Rsdp->Revision > 1 && Rsdp->XsdtPhysicalAddress)
> +    if ((Rsdp->Revision > 1) &&
> +        Rsdp->XsdtPhysicalAddress &&
> +        !AcpiGbl_DoNotUseXsdt)
>       {
>           /*
> -         * Root table is an XSDT (64-bit physical addresses). We must use the
> -         * XSDT if the revision is > 1 and the XSDT pointer is present, as per
> -         * the ACPI specification.
> +         * RSDP contains an XSDT (64-bit physical addresses). We must use
> +         * the XSDT if the revision is > 1 and the XSDT pointer is present,
> +         * as per the ACPI specification.
>            */
>           Address = (ACPI_PHYSICAL_ADDRESS) Rsdp->XsdtPhysicalAddress;
> -        TableEntrySize = sizeof (UINT64);
> +        TableEntrySize = ACPI_XSDT_ENTRY_SIZE;
>       }
>       else
>       {
>           /* Root table is an RSDT (32-bit physical addresses) */
>
>           Address = (ACPI_PHYSICAL_ADDRESS) Rsdp->RsdtPhysicalAddress;
> -        TableEntrySize = sizeof (UINT32);
> +        TableEntrySize = ACPI_RSDT_ENTRY_SIZE;
>       }
>
>       /*
> @@ -531,6 +622,24 @@ AcpiTbParseRootTable (
>        */
>       AcpiOsUnmapMemory (Rsdp, sizeof (ACPI_TABLE_RSDP));
>
> +    /*
> +     * If it is present and used, validate the XSDT for access/size
> +     * and ensure that all table entries are at least non-NULL
> +     */
> +    if (TableEntrySize == ACPI_XSDT_ENTRY_SIZE)
> +    {
> +        Status = AcpiTbValidateXsdt (Address);
> +        if (ACPI_FAILURE (Status))
> +        {
> +            ACPI_BIOS_WARNING ((AE_INFO, "XSDT is invalid (%s), using RSDT",
> +                AcpiFormatException (Status)));
> +
> +            /* Fall back to the RSDT */
> +
> +            Address = (ACPI_PHYSICAL_ADDRESS) Rsdp->RsdtPhysicalAddress;
> +            TableEntrySize = ACPI_RSDT_ENTRY_SIZE;
> +        }
> +    }
>
>       /* Map the RSDT/XSDT table header to get the full table length */
>
> @@ -542,12 +651,14 @@ AcpiTbParseRootTable (
>
>       AcpiTbPrintTableHeader (Address, Table);
>
> -    /* Get the length of the full table, verify length and map entire table */
> -
> +    /*
> +     * Validate length of the table, and map entire table.
> +     * Minimum length table must contain at least one entry.
> +     */
>       Length = Table->Length;
>       AcpiOsUnmapMemory (Table, sizeof (ACPI_TABLE_HEADER));
>
> -    if (Length < sizeof (ACPI_TABLE_HEADER))
> +    if (Length < (sizeof (ACPI_TABLE_HEADER) + TableEntrySize))
>       {
>           ACPI_BIOS_ERROR ((AE_INFO,
>               "Invalid table length 0x%X in RSDT/XSDT", Length));
> @@ -569,22 +680,21 @@ AcpiTbParseRootTable (
>           return_ACPI_STATUS (Status);
>       }
>
> -    /* Calculate the number of tables described in the root table */
> +    /* Get the number of entries and pointer to first entry */
>
>       TableCount = (UINT32) ((Table->Length - sizeof (ACPI_TABLE_HEADER)) /
>           TableEntrySize);
> +    TableEntry = ACPI_ADD_PTR (UINT8, Table, sizeof (ACPI_TABLE_HEADER));
>
>       /*
>        * First two entries in the table array are reserved for the DSDT
>        * and FACS, which are not actually present in the RSDT/XSDT - they
>        * come from the FADT
>        */
> -    TableEntry = ACPI_CAST_PTR (UINT8, Table) + sizeof (ACPI_TABLE_HEADER);
>       AcpiGbl_RootTableList.CurrentTableCount = 2;
>
> -    /*
> -     * Initialize the root table array from the RSDT/XSDT
> -     */
> +    /* Initialize the root table array from the RSDT/XSDT */
> +
>       for (i = 0; i < TableCount; i++)
>       {
>           if (AcpiGbl_RootTableList.CurrentTableCount >=
> @@ -626,7 +736,7 @@ AcpiTbParseRootTable (
>           AcpiTbInstallTable (AcpiGbl_RootTableList.Tables[i].Address,
>               NULL, i);
>
> -        /* Special case for FADT - get the DSDT and FACS */
> +        /* Special case for FADT - validate it then get the DSDT and FACS */
>
>           if (ACPI_COMPARE_NAME (
>                   &AcpiGbl_RootTableList.Tables[i].Signature, ACPI_SIG_FADT))
> diff --git a/src/acpica/source/components/utilities/utaddress.c b/src/acpica/source/components/utilities/utaddress.c
> index 7c0197b..38069cc 100644
> --- a/src/acpica/source/components/utilities/utaddress.c
> +++ b/src/acpica/source/components/utilities/utaddress.c
> @@ -320,10 +320,11 @@ AcpiUtCheckAddressRange (
>       while (RangeInfo)
>       {
>           /*
> -         * Check if the requested Address/Length overlaps this AddressRange.
> -         * Four cases to consider:
> +         * Check if the requested address/length overlaps this
> +         * address range. There are four cases to consider:
>            *
> -         * 1) Input address/length is contained completely in the address range
> +         * 1) Input address/length is contained completely in the
> +         *    address range
>            * 2) Input address/length overlaps range at the range start
>            * 3) Input address/length overlaps range at the range end
>            * 4) Input address/length completely encompasses the range
> @@ -339,10 +340,13 @@ AcpiUtCheckAddressRange (
>                   Pathname = AcpiNsGetExternalPathname (RangeInfo->RegionNode);
>
>                   ACPI_WARNING ((AE_INFO,
> -                    "0x%p-0x%p %s conflicts with Region %s %d",
> +                    "%s range 0x%p-0x%p conflicts with OpRegion 0x%p-0x%p (%s)",
> +                    AcpiUtGetRegionName (SpaceId),
>                       ACPI_CAST_PTR (void, Address),
>                       ACPI_CAST_PTR (void, EndAddress),
> -                    AcpiUtGetRegionName (SpaceId), Pathname, OverlapCount));
> +                    ACPI_CAST_PTR (void, RangeInfo->StartAddress),
> +                    ACPI_CAST_PTR (void, RangeInfo->EndAddress),
> +                    Pathname));
>                   ACPI_FREE (Pathname);
>               }
>           }
> diff --git a/src/acpica/source/components/utilities/utalloc.c b/src/acpica/source/components/utilities/utalloc.c
> index 5c672fd..cf14068 100644
> --- a/src/acpica/source/components/utilities/utalloc.c
> +++ b/src/acpica/source/components/utilities/utalloc.c
> @@ -396,9 +396,13 @@ AcpiUtInitializeBuffer (
>           return (AE_BUFFER_OVERFLOW);
>
>       case ACPI_ALLOCATE_BUFFER:
> -
> -        /* Allocate a new buffer */
> -
> +        /*
> +         * Allocate a new buffer. We directectly call AcpiOsAllocate here to
> +         * purposefully bypass the (optionally enabled) internal allocation
> +         * tracking mechanism since we only want to track internal
> +         * allocations. Note: The caller should use AcpiOsFree to free this
> +         * buffer created via ACPI_ALLOCATE_BUFFER.
> +         */
>           Buffer->Pointer = AcpiOsAllocate (RequiredLength);
>           break;
>
> diff --git a/src/acpica/source/components/utilities/utcache.c b/src/acpica/source/components/utilities/utcache.c
> index 2280027..3a89cd6 100644
> --- a/src/acpica/source/components/utilities/utcache.c
> +++ b/src/acpica/source/components/utilities/utcache.c
> @@ -358,13 +358,13 @@ AcpiOsAcquireObject (
>
>       if (!Cache)
>       {
> -        return (NULL);
> +        return_PTR (NULL);
>       }
>
>       Status = AcpiUtAcquireMutex (ACPI_MTX_CACHES);
>       if (ACPI_FAILURE (Status))
>       {
> -        return (NULL);
> +        return_PTR (NULL);
>       }
>
>       ACPI_MEM_TRACKING (Cache->Requests++);
> @@ -387,7 +387,7 @@ AcpiOsAcquireObject (
>           Status = AcpiUtReleaseMutex (ACPI_MTX_CACHES);
>           if (ACPI_FAILURE (Status))
>           {
> -            return (NULL);
> +            return_PTR (NULL);
>           }
>
>           /* Clear (zero) the previously used Object */
> @@ -412,16 +412,16 @@ AcpiOsAcquireObject (
>           Status = AcpiUtReleaseMutex (ACPI_MTX_CACHES);
>           if (ACPI_FAILURE (Status))
>           {
> -            return (NULL);
> +            return_PTR (NULL);
>           }
>
>           Object = ACPI_ALLOCATE_ZEROED (Cache->ObjectSize);
>           if (!Object)
>           {
> -            return (NULL);
> +            return_PTR (NULL);
>           }
>       }
>
> -    return (Object);
> +    return_PTR (Object);
>   }
>   #endif /* ACPI_USE_LOCAL_CACHE */
> diff --git a/src/acpica/source/components/utilities/utdebug.c b/src/acpica/source/components/utilities/utdebug.c
> index 0a57f76..eeff454 100644
> --- a/src/acpica/source/components/utilities/utdebug.c
> +++ b/src/acpica/source/components/utilities/utdebug.c
> @@ -292,9 +292,9 @@ AcpiDebugPrint (
>        */
>       AcpiOsPrintf ("%9s-%04ld ", ModuleName, LineNumber);
>
> -#ifdef ACPI_EXEC_APP
> +#ifdef ACPI_APPLICATION
>       /*
> -     * For AcpiExec only, emit the thread ID and nesting level.
> +     * For AcpiExec/iASL only, emit the thread ID and nesting level.
>        * Note: nesting level is really only useful during a single-thread
>        * execution. Otherwise, multiple threads will keep resetting the
>        * level.
> diff --git a/src/acpica/source/components/utilities/utxfinit.c b/src/acpica/source/components/utilities/utxfinit.c
> index 9ee0309..3d04a15 100644
> --- a/src/acpica/source/components/utilities/utxfinit.c
> +++ b/src/acpica/source/components/utilities/utxfinit.c
> @@ -203,8 +203,16 @@ AcpiInitializeSubsystem (
>
>       /* If configured, initialize the AML debugger */
>
> -    ACPI_DEBUGGER_EXEC (Status = AcpiDbInitialize ());
> -    return_ACPI_STATUS (Status);
> +#ifdef ACPI_DEBUGGER
> +    Status = AcpiDbInitialize ();
> +    if (ACPI_FAILURE (Status))
> +    {
> +        ACPI_EXCEPTION ((AE_INFO, Status, "During Debugger initialization"));
> +        return_ACPI_STATUS (Status);
> +    }
> +#endif
> +
> +    return_ACPI_STATUS (AE_OK);
>   }
>
>   ACPI_EXPORT_SYMBOL_INIT (AcpiInitializeSubsystem)
> diff --git a/src/acpica/source/include/acdisasm.h b/src/acpica/source/include/acdisasm.h
> index 571efce..a640af0 100644
> --- a/src/acpica/source/include/acdisasm.h
> +++ b/src/acpica/source/include/acdisasm.h
> @@ -141,14 +141,14 @@ typedef const struct acpi_dmtable_info
>
>   } ACPI_DMTABLE_INFO;
>
> +/* Values for Flags field above */
> +
>   #define DT_LENGTH                       0x01    /* Field is a subtable length */
>   #define DT_FLAG                         0x02    /* Field is a flag value */
>   #define DT_NON_ZERO                     0x04    /* Field must be non-zero */
> -
> -/* TBD: Not used at this time */
> -
> -#define DT_OPTIONAL                     0x08
> -#define DT_COUNT                        0x10
> +#define DT_OPTIONAL                     0x08    /* Field is optional */
> +#define DT_DESCRIBES_OPTIONAL           0x10    /* Field describes an optional field (length, etc.) */
> +#define DT_COUNT                        0x20    /* Currently not used */
>
>   /*
>    * Values for Opcode above.
> @@ -219,6 +219,7 @@ typedef enum
>       ACPI_DMT_HESTNTYP,
>       ACPI_DMT_IVRS,
>       ACPI_DMT_MADT,
> +    ACPI_DMT_PCCT,
>       ACPI_DMT_PMTT,
>       ACPI_DMT_SLIC,
>       ACPI_DMT_SRAT,
> @@ -316,6 +317,7 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDbg2Device[];
>   extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDbg2Addr[];
>   extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDbg2Size[];
>   extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDbg2Name[];
> +extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDbg2OemData[];
>   extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDbgp[];
>   extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDmar[];
>   extern ACPI_DMTABLE_INFO        AcpiDmTableInfoDmarHdr[];
> @@ -396,6 +398,7 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPmtt1a[];
>   extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPmtt2[];
>   extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPmttHdr[];
>   extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcct[];
> +extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcctHdr[];
>   extern ACPI_DMTABLE_INFO        AcpiDmTableInfoPcct0[];
>   extern ACPI_DMTABLE_INFO        AcpiDmTableInfoRsdp1[];
>   extern ACPI_DMTABLE_INFO        AcpiDmTableInfoRsdp2[];
> @@ -740,11 +743,19 @@ AcpiDmClearExternalFileList (
>       void);
>
>   void
> -AcpiDmAddToExternalList (
> +AcpiDmAddOpToExternalList (
>       ACPI_PARSE_OBJECT       *Op,
>       char                    *Path,
>       UINT8                   Type,
> -    UINT32                  Value);
> +    UINT32                  Value,
> +    UINT16                  Flags);
> +
> +void
> +AcpiDmAddNodeToExternalList (
> +    ACPI_NAMESPACE_NODE     *Node,
> +    UINT8                   Type,
> +    UINT32                  Value,
> +    UINT16                  Flags);
>
>   void
>   AcpiDmAddExternalsToNamespace (
> diff --git a/src/acpica/source/include/acevents.h b/src/acpica/source/include/acevents.h
> index 3205113..ff94961 100644
> --- a/src/acpica/source/include/acevents.h
> +++ b/src/acpica/source/include/acevents.h
> @@ -278,9 +278,10 @@ AcpiEvGetGpeDevice (
>       ACPI_GPE_BLOCK_INFO     *GpeBlock,
>       void                    *Context);
>
> -ACPI_GPE_XRUPT_INFO *
> +ACPI_STATUS
>   AcpiEvGetGpeXruptBlock (
> -    UINT32                  InterruptNumber);
> +    UINT32                  InterruptNumber,
> +    ACPI_GPE_XRUPT_INFO     **GpeXruptBlock);
>
>   ACPI_STATUS
>   AcpiEvDeleteGpeXrupt (
> diff --git a/src/acpica/source/include/acglobal.h b/src/acpica/source/include/acglobal.h
> index b9ebec5..16dc0ad 100644
> --- a/src/acpica/source/include/acglobal.h
> +++ b/src/acpica/source/include/acglobal.h
> @@ -193,6 +193,25 @@ UINT8       ACPI_INIT_GLOBAL (AcpiGbl_EnableAmlDebugObject, FALSE);
>   UINT8       ACPI_INIT_GLOBAL (AcpiGbl_CopyDsdtLocally, FALSE);
>
>   /*
> + * Optionally ignore an XSDT if present and use the RSDT instead.
> + * Although the ACPI specification requires that an XSDT be used instead
> + * of the RSDT, the XSDT has been found to be corrupt or ill-formed on
> + * some machines. Default behavior is to use the XSDT if present.
> + */
> +UINT8       ACPI_INIT_GLOBAL (AcpiGbl_DoNotUseXsdt, FALSE);
> +
> +
> +/*
> + * Optionally use 32-bit FADT addresses if and when there is a conflict
> + * (address mismatch) between the 32-bit and 64-bit versions of the
> + * address. Although ACPICA adheres to the ACPI specification which
> + * requires the use of the corresponding 64-bit address if it is non-zero,
> + * some machines have been found to have a corrupted non-zero 64-bit
> + * address. Default is FALSE, do not favor the 32-bit addresses.
> + */
> +UINT8       ACPI_INIT_GLOBAL (AcpiGbl_Use32BitFadtAddresses, FALSE);
> +
> +/*
>    * Optionally truncate I/O addresses to 16 bits. Provides compatibility
>    * with other ACPI implementations. NOTE: During ACPICA initialization,
>    * this value is set to TRUE if any Windows OSI strings have been
> @@ -564,6 +583,19 @@ ACPI_EXTERN UINT32                      AcpiGbl_SizeOfAcpiObjects;
>
>   /*****************************************************************************
>    *
> + * Application globals
> + *
> + ****************************************************************************/
> +
> +#ifdef ACPI_APPLICATION
> +
> +ACPI_FILE   ACPI_INIT_GLOBAL (AcpiGbl_DebugFile, NULL);
> +
> +#endif /* ACPI_APPLICATION */
> +
> +
> +/*****************************************************************************
> + *
>    * Info/help support
>    *
>    ****************************************************************************/
> diff --git a/src/acpica/source/include/aclocal.h b/src/acpica/source/include/aclocal.h
> index 37c46b2..f2f4c1e 100644
> --- a/src/acpica/source/include/aclocal.h
> +++ b/src/acpica/source/include/aclocal.h
> @@ -1290,17 +1290,17 @@ typedef struct acpi_external_list
>       struct acpi_external_list   *Next;
>       UINT32                      Value;
>       UINT16                      Length;
> +    UINT16                      Flags;
>       UINT8                       Type;
> -    UINT8                       Flags;
> -    BOOLEAN                     Resolved;
> -    BOOLEAN                     Emitted;
>
>   } ACPI_EXTERNAL_LIST;
>
>   /* Values for Flags field above */
>
> -#define ACPI_IPATH_ALLOCATED        0x01
> -#define ACPI_FROM_REFERENCE_FILE    0x02
> +#define ACPI_EXT_RESOLVED_REFERENCE         0x01    /* Object was resolved during cross ref */
> +#define ACPI_EXT_ORIGIN_FROM_FILE           0x02    /* External came from a file */
> +#define ACPI_EXT_INTERNAL_PATH_ALLOCATED    0x04    /* Deallocate internal path on completion */
> +#define ACPI_EXT_EXTERNAL_EMITTED           0x08    /* External() statement has been emitted */
>
>
>   typedef struct acpi_external_file
> diff --git a/src/acpica/source/include/acpixf.h b/src/acpica/source/include/acpixf.h
> index ea0ff78..86a2643 100644
> --- a/src/acpica/source/include/acpixf.h
> +++ b/src/acpica/source/include/acpixf.h
> @@ -119,7 +119,7 @@
>
>   /* Current ACPICA subsystem version in YYYYMMDD format */
>
> -#define ACPI_CA_VERSION                 0x20131115
> +#define ACPI_CA_VERSION                 0x20131218
>
>   #include "acconfig.h"
>   #include "actypes.h"
> @@ -142,17 +142,19 @@ extern UINT32               AcpiDbgLayer;
>
>   /* ACPICA runtime options */
>
> -extern UINT8                AcpiGbl_EnableInterpreterSlack;
>   extern UINT8                AcpiGbl_AllMethodsSerialized;
> -extern UINT8                AcpiGbl_CreateOsiMethod;
> -extern UINT8                AcpiGbl_UseDefaultRegisterWidths;
> -extern ACPI_NAME            AcpiGbl_TraceMethodName;
> -extern UINT32               AcpiGbl_TraceFlags;
> -extern UINT8                AcpiGbl_EnableAmlDebugObject;
>   extern UINT8                AcpiGbl_CopyDsdtLocally;
> -extern UINT8                AcpiGbl_TruncateIoAddresses;
> +extern UINT8                AcpiGbl_CreateOsiMethod;
>   extern UINT8                AcpiGbl_DisableAutoRepair;
>   extern UINT8                AcpiGbl_DisableSsdtTableLoad;
> +extern UINT8                AcpiGbl_DoNotUseXsdt;
> +extern UINT8                AcpiGbl_EnableAmlDebugObject;
> +extern UINT8                AcpiGbl_EnableInterpreterSlack;
> +extern UINT32               AcpiGbl_TraceFlags;
> +extern ACPI_NAME            AcpiGbl_TraceMethodName;
> +extern UINT8                AcpiGbl_TruncateIoAddresses;
> +extern UINT8                AcpiGbl_Use32BitFadtAddresses;
> +extern UINT8                AcpiGbl_UseDefaultRegisterWidths;
>
>
>   /*
> diff --git a/src/acpica/source/include/actbl.h b/src/acpica/source/include/actbl.h
> index 77ae82c..c1ba0e9 100644
> --- a/src/acpica/source/include/actbl.h
> +++ b/src/acpica/source/include/actbl.h
> @@ -275,6 +275,9 @@ typedef struct acpi_table_xsdt
>
>   } ACPI_TABLE_XSDT;
>
> +#define ACPI_RSDT_ENTRY_SIZE        (sizeof (UINT32))
> +#define ACPI_XSDT_ENTRY_SIZE        (sizeof (UINT64))
> +
>
>   /*******************************************************************************
>    *
> diff --git a/src/acpica/source/include/actbl1.h b/src/acpica/source/include/actbl1.h
> index 883547c..0476fa5 100644
> --- a/src/acpica/source/include/actbl1.h
> +++ b/src/acpica/source/include/actbl1.h
> @@ -596,7 +596,7 @@ typedef struct acpi_hest_aer_common
>       UINT8                   Enabled;
>       UINT32                  RecordsToPreallocate;
>       UINT32                  MaxSectionsPerRecord;
> -    UINT32                  Bus;
> +    UINT32                  Bus;                    /* Bus and Segment numbers */
>       UINT16                  Device;
>       UINT16                  Function;
>       UINT16                  DeviceControl;
> @@ -613,6 +613,14 @@ typedef struct acpi_hest_aer_common
>   #define ACPI_HEST_FIRMWARE_FIRST        (1)
>   #define ACPI_HEST_GLOBAL                (1<<1)
>
> +/*
> + * Macros to access the bus/segment numbers in Bus field above:
> + *  Bus number is encoded in bits 7:0
> + *  Segment number is encoded in bits 23:8
> + */
> +#define ACPI_HEST_BUS(Bus)              ((Bus) & 0xFF)
> +#define ACPI_HEST_SEGMENT(Bus)          (((Bus) >> 8) & 0xFFFF)
> +
>
>   /* Hardware Error Notification */
>
> diff --git a/src/acpica/source/include/actbl2.h b/src/acpica/source/include/actbl2.h
> index 3479648..1443d24 100644
> --- a/src/acpica/source/include/actbl2.h
> +++ b/src/acpica/source/include/actbl2.h
> @@ -445,6 +445,14 @@ typedef struct acpi_table_dbg2
>   } ACPI_TABLE_DBG2;
>
>
> +typedef struct acpi_dbg2_header
> +{
> +    UINT32                  InfoOffset;
> +    UINT32                  InfoCount;
> +
> +} ACPI_DBG2_HEADER;
> +
> +
>   /* Debug Device Information Subtable */
>
>   typedef struct acpi_dbg2_device
> diff --git a/src/acpica/source/include/actbl3.h b/src/acpica/source/include/actbl3.h
> index 85ff620..51ab879 100644
> --- a/src/acpica/source/include/actbl3.h
> +++ b/src/acpica/source/include/actbl3.h
> @@ -512,8 +512,7 @@ typedef struct acpi_table_pcct
>   {
>       ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
>       UINT32                  Flags;
> -    UINT32                  Latency;
> -    UINT32                  Reserved;
> +    UINT64                  Reserved;
>
>   } ACPI_TABLE_PCCT;
>
> @@ -521,8 +520,16 @@ typedef struct acpi_table_pcct
>
>   #define ACPI_PCCT_DOORBELL              1
>
> +/* Values for subtable type in ACPI_SUBTABLE_HEADER */
> +
> +enum AcpiPcctType
> +{
> +    ACPI_PCCT_TYPE_GENERIC_SUBSPACE     = 0,
> +    ACPI_PCCT_TYPE_RESERVED             = 1     /* 1 and greater are reserved */
> +};
> +
>   /*
> - * PCCT subtables
> + * PCCT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
>    */
>
>   /* 0: Generic Communications Subspace */
> @@ -536,6 +543,9 @@ typedef struct acpi_pcct_subspace
>       ACPI_GENERIC_ADDRESS    DoorbellRegister;
>       UINT64                  PreserveMask;
>       UINT64                  WriteMask;
> +    UINT32                  Latency;
> +    UINT32                  MaxAccessRate;
> +    UINT16                  MinTurnaroundTime;
>
>   } ACPI_PCCT_SUBSPACE;
>
> diff --git a/src/acpica/source/include/actypes.h b/src/acpica/source/include/actypes.h
> index 072b946..b134fc2 100644
> --- a/src/acpica/source/include/actypes.h
> +++ b/src/acpica/source/include/actypes.h
> @@ -1026,8 +1026,8 @@ typedef struct acpi_object_list
>    * Miscellaneous common Data Structures used by the interfaces
>    */
>   #define ACPI_NO_BUFFER              0
> -#define ACPI_ALLOCATE_BUFFER        (ACPI_SIZE) (-1)
> -#define ACPI_ALLOCATE_LOCAL_BUFFER  (ACPI_SIZE) (-2)
> +#define ACPI_ALLOCATE_BUFFER        (ACPI_SIZE) (-1)    /* Let ACPICA allocate buffer */
> +#define ACPI_ALLOCATE_LOCAL_BUFFER  (ACPI_SIZE) (-2)    /* For internal use only (enables tracking) */
>
>   typedef struct acpi_buffer
>   {
> @@ -1036,10 +1036,6 @@ typedef struct acpi_buffer
>
>   } ACPI_BUFFER;
>
> -/* Free a buffer created in an ACPI_BUFFER via ACPI_ALLOCATE_LOCAL_BUFFER */
> -
> -#define ACPI_FREE_BUFFER(b)         ACPI_FREE(b.Pointer)
> -
>
>   /*
>    * NameType for AcpiGetName
> diff --git a/src/acpica/source/include/platform/acenv.h b/src/acpica/source/include/platform/acenv.h
> index 3838e79..79ae6aa 100644
> --- a/src/acpica/source/include/platform/acenv.h
> +++ b/src/acpica/source/include/platform/acenv.h
> @@ -169,13 +169,14 @@
>   #endif
>
>   /*
> - * AcpiBin/AcpiDump/AcpiSrc/AcpiXtract configuration. All single
> + * AcpiBin/AcpiDump/AcpiSrc/AcpiXtract/Example configuration. All single
>    * threaded, with no debug output.
>    */
> -#if (defined ACPI_BIN_APP)   || \
> -    (defined ACPI_DUMP_APP)  || \
> -    (defined ACPI_SRC_APP)   || \
> -    (defined ACPI_XTRACT_APP)
> +#if (defined ACPI_BIN_APP)      || \
> +    (defined ACPI_DUMP_APP)     || \
> +    (defined ACPI_SRC_APP)      || \
> +    (defined ACPI_XTRACT_APP)   || \
> +    (defined ACPI_EXAMPLE_APP)
>   #define ACPI_APPLICATION
>   #define ACPI_SINGLE_THREADED
>   #endif
> @@ -468,4 +469,13 @@ typedef char *va_list;
>
>   #endif /* ACPI_USE_SYSTEM_CLIBRARY */
>
> +#ifndef ACPI_FILE
> +#ifdef ACPI_APPLICATION
> +#include <stdio.h>
> +#define ACPI_FILE              FILE *
> +#else
> +#define ACPI_FILE              void *
> +#endif /* ACPI_APPLICATION */
> +#endif /* ACPI_FILE */
> +
>   #endif /* __ACENV_H__ */
> diff --git a/src/acpica/source/include/platform/aclinux.h b/src/acpica/source/include/platform/aclinux.h
> index e806e59..2d04973 100644
> --- a/src/acpica/source/include/platform/aclinux.h
> +++ b/src/acpica/source/include/platform/aclinux.h
> @@ -329,14 +329,6 @@ EarlyAcpiOsUnmapMemory (
>       void __iomem            *Virt,
>       ACPI_SIZE               Size);
>
> -void
> -AcpiOsGpeCount (
> -    UINT32                  GpeNumber);
> -
> -void
> -AcpiOsFixedEventCount (
> -    UINT32                  FixedEventNumber);
> -
>   ACPI_STATUS
>   AcpiOsHotplugExecute (
>       ACPI_OSD_EXEC_CALLBACK  Function,
> diff --git a/src/acpica/source/os_specific/service_layers/osunixxf.c b/src/acpica/source/os_specific/service_layers/osunixxf.c
> index ad003c1..5e2c538 100644
> --- a/src/acpica/source/os_specific/service_layers/osunixxf.c
> +++ b/src/acpica/source/os_specific/service_layers/osunixxf.c
> @@ -137,7 +137,6 @@
>           ACPI_MODULE_NAME    ("osunixxf")
>
>
> -extern FILE                    *AcpiGbl_DebugFile;
>   FILE                           *AcpiGbl_OutputFile;
>   BOOLEAN                        AcpiGbl_DebugTimeout = FALSE;
>
> diff --git a/src/acpica/source/tools/acpiexec/aecommon.h b/src/acpica/source/tools/acpiexec/aecommon.h
> index 4083b69..8375bea 100644
> --- a/src/acpica/source/tools/acpiexec/aecommon.h
> +++ b/src/acpica/source/tools/acpiexec/aecommon.h
> @@ -135,7 +135,6 @@
>   #include <string.h>
>   #include <signal.h>
>
> -extern FILE                 *AcpiGbl_DebugFile;
>   extern BOOLEAN              AcpiGbl_IgnoreErrors;
>   extern UINT8                AcpiGbl_RegionFillValue;
>   extern UINT8                AcpiGbl_UseHwReducedFadt;
> diff --git a/src/acpica/source/tools/acpiexec/aehandlers.c b/src/acpica/source/tools/acpiexec/aehandlers.c
> index 294abea..fe1fb8c 100644
> --- a/src/acpica/source/tools/acpiexec/aehandlers.c
> +++ b/src/acpica/source/tools/acpiexec/aehandlers.c
> @@ -532,6 +532,8 @@ AeExceptionHandler (
>               NewAmlStatus = (ACPI_STATUS)
>                   ((ACPI_OBJECT *) ReturnObj.Pointer)->Integer.Value;
>
> +            /* Free a buffer created via ACPI_ALLOCATE_BUFFER */
> +
>               AcpiOsFree (ReturnObj.Pointer);
>           }
>       }
> @@ -1121,21 +1123,11 @@ AeInstallEarlyHandlers (
>           Status = AcpiDetachData (Handle, AeAttachedDataHandler);
>           AE_CHECK_OK (AcpiDetachData, Status);
>
> -        /* Test attach data at the root object */
> -
> -        Status = AcpiAttachData (ACPI_ROOT_OBJECT, AeAttachedDataHandler,
> -            AcpiGbl_RootNode);
> -        AE_CHECK_OK (AcpiAttachData, Status);
> -
> -        Status = AcpiAttachData (ACPI_ROOT_OBJECT, AeAttachedDataHandler2,
> -            AcpiGbl_RootNode);
> +        Status = AcpiAttachData (Handle, AeAttachedDataHandler, Handle);
>           AE_CHECK_OK (AcpiAttachData, Status);
>
>           /* Test support for multiple attaches */
>
> -        Status = AcpiAttachData (Handle, AeAttachedDataHandler, Handle);
> -        AE_CHECK_OK (AcpiAttachData, Status);
> -
>           Status = AcpiAttachData (Handle, AeAttachedDataHandler2, Handle);
>           AE_CHECK_OK (AcpiAttachData, Status);
>       }
>

Acked-by: Ivan Hu <ivan.hu at canonical.com>



More information about the fwts-devel mailing list