[ACPICA] Update to version 20180531. CORE-15222
authorThomas Faber <thomas.faber@reactos.org>
Thu, 25 Oct 2018 10:07:40 +0000 (12:07 +0200)
committerThomas Faber <thomas.faber@reactos.org>
Sun, 28 Oct 2018 14:28:34 +0000 (15:28 +0100)
63 files changed:
drivers/bus/acpi/acpica/dispatcher/dsargs.c
drivers/bus/acpi/acpica/dispatcher/dsdebug.c
drivers/bus/acpi/acpica/dispatcher/dsopcode.c
drivers/bus/acpi/acpica/dispatcher/dspkginit.c
drivers/bus/acpi/acpica/dispatcher/dswexec.c
drivers/bus/acpi/acpica/dispatcher/dswload.c
drivers/bus/acpi/acpica/dispatcher/dswscope.c
drivers/bus/acpi/acpica/events/evevent.c
drivers/bus/acpi/acpica/events/evgpe.c
drivers/bus/acpi/acpica/events/evgpeblk.c
drivers/bus/acpi/acpica/events/evrgnini.c
drivers/bus/acpi/acpica/events/evxface.c
drivers/bus/acpi/acpica/events/evxfgpe.c
drivers/bus/acpi/acpica/executer/exconfig.c
drivers/bus/acpi/acpica/executer/exconvrt.c
drivers/bus/acpi/acpica/executer/exdebug.c
drivers/bus/acpi/acpica/executer/exnames.c
drivers/bus/acpi/acpica/executer/exresop.c
drivers/bus/acpi/acpica/hardware/hwgpe.c
drivers/bus/acpi/acpica/hardware/hwsleep.c
drivers/bus/acpi/acpica/hardware/hwxfsleep.c
drivers/bus/acpi/acpica/include/acapps.h
drivers/bus/acpi/acpica/include/acdisasm.h
drivers/bus/acpi/acpica/include/acevents.h
drivers/bus/acpi/acpica/include/acmacros.h
drivers/bus/acpi/acpica/include/acnames.h
drivers/bus/acpi/acpica/include/acnamesp.h
drivers/bus/acpi/acpica/include/acopcode.h
drivers/bus/acpi/acpica/include/acoutput.h
drivers/bus/acpi/acpica/include/acpixf.h
drivers/bus/acpi/acpica/include/actbinfo.h
drivers/bus/acpi/acpica/include/actbl1.h
drivers/bus/acpi/acpica/include/actbl2.h
drivers/bus/acpi/acpica/include/actbl3.h
drivers/bus/acpi/acpica/include/actypes.h
drivers/bus/acpi/acpica/include/amlcode.h
drivers/bus/acpi/acpica/include/platform/aclinux.h
drivers/bus/acpi/acpica/namespace/nsdump.c
drivers/bus/acpi/acpica/namespace/nsdumpdv.c
drivers/bus/acpi/acpica/namespace/nseval.c
drivers/bus/acpi/acpica/namespace/nsinit.c
drivers/bus/acpi/acpica/namespace/nsload.c
drivers/bus/acpi/acpica/namespace/nsnames.c
drivers/bus/acpi/acpica/namespace/nsparse.c
drivers/bus/acpi/acpica/namespace/nsxfname.c
drivers/bus/acpi/acpica/parser/psargs.c
drivers/bus/acpi/acpica/parser/psloop.c
drivers/bus/acpi/acpica/parser/psobject.c
drivers/bus/acpi/acpica/parser/psparse.c
drivers/bus/acpi/acpica/parser/pstree.c
drivers/bus/acpi/acpica/parser/pswalk.c
drivers/bus/acpi/acpica/resources/rsdump.c
drivers/bus/acpi/acpica/tables/tbdata.c
drivers/bus/acpi/acpica/tables/tbinstal.c
drivers/bus/acpi/acpica/tables/tbxfload.c
drivers/bus/acpi/acpica/utilities/utbuffer.c
drivers/bus/acpi/acpica/utilities/utcache.c
drivers/bus/acpi/acpica/utilities/utdelete.c
drivers/bus/acpi/acpica/utilities/uterror.c
drivers/bus/acpi/acpica/utilities/utosi.c
drivers/bus/acpi/acpica/utilities/utprint.c
drivers/bus/acpi/acpica/utilities/utstring.c
drivers/bus/acpi/acpica/utilities/utxfinit.c

index fd68e27..da05c5e 100644 (file)
@@ -373,6 +373,7 @@ AcpiDsGetPackageArguments (
 
     Status = AcpiDsExecuteArguments (Node, Node,
         ObjDesc->Package.AmlLength, ObjDesc->Package.AmlStart);
+
     return_ACPI_STATUS (Status);
 }
 
index b4e6690..f962a61 100644 (file)
@@ -143,6 +143,7 @@ AcpiDsDumpMethodStack (
 
     ACPI_FUNCTION_TRACE (DsDumpMethodStack);
 
+
     /* Ignore control codes, they are not errors */
 
     if ((Status & AE_CODE_MASK) == AE_CODE_CONTROL)
@@ -212,8 +213,13 @@ AcpiDsDumpMethodStack (
                 Op->Common.Next = NULL;
 
 #ifdef ACPI_DISASSEMBLER
-                AcpiOsPrintf ("Failed at ");
-                AcpiDmDisassemble (NextWalkState, Op, ACPI_UINT32_MAX);
+                if (WalkState->MethodNode != AcpiGbl_RootNode)
+                {
+                    /* More verbose if not module-level code */
+
+                    AcpiOsPrintf ("Failed at ");
+                    AcpiDmDisassemble (NextWalkState, Op, ACPI_UINT32_MAX);
+                }
 #endif
                 Op->Common.Next = Next;
             }
index 086a9b3..309f011 100644 (file)
@@ -644,8 +644,8 @@ AcpiDsEvalDataObjectOperands (
     if (!Op->Common.Value.Arg)
     {
         ACPI_ERROR ((AE_INFO,
-            "Dispatch: Missing child while executing TermArg for %X",
-            Op->Common.AmlOpcode));
+            "Missing child while evaluating opcode %4.4X, Op %p",
+            Op->Common.AmlOpcode, Op));
         return_ACPI_STATUS (AE_OK);
     }
 
index 4a4ac47..56ab585 100644 (file)
@@ -47,6 +47,7 @@
 #include "amlcode.h"
 #include "acdispat.h"
 #include "acinterp.h"
+#include "acparser.h"
 
 
 #define _COMPONENT          ACPI_NAMESPACE
@@ -100,6 +101,7 @@ AcpiDsBuildInternalPackageObj (
     ACPI_PARSE_OBJECT       *Parent;
     ACPI_OPERAND_OBJECT     *ObjDesc = NULL;
     ACPI_STATUS             Status = AE_OK;
+    BOOLEAN                 ModuleLevelCode = FALSE;
     UINT16                  ReferenceCount;
     UINT32                  Index;
     UINT32                  i;
@@ -108,6 +110,13 @@ AcpiDsBuildInternalPackageObj (
     ACPI_FUNCTION_TRACE (DsBuildInternalPackageObj);
 
 
+    /* Check if we are executing module level code */
+
+    if (WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL)
+    {
+        ModuleLevelCode = TRUE;
+    }
+
     /* Find the parent of a possibly nested package */
 
     Parent = Op->Common.Parent;
@@ -142,25 +151,43 @@ AcpiDsBuildInternalPackageObj (
 
     /*
      * Allocate the element array (array of pointers to the individual
-     * objects) based on the NumElements parameter. Add an extra pointer slot
-     * so that the list is always null terminated.
+     * objects) if necessary. the count is based on the NumElements
+     * parameter. Add an extra pointer slot so that the list is always
+     * null terminated.
      */
-    ObjDesc->Package.Elements = ACPI_ALLOCATE_ZEROED (
-        ((ACPI_SIZE) ElementCount + 1) * sizeof (void *));
-
     if (!ObjDesc->Package.Elements)
     {
-        AcpiUtDeleteObjectDesc (ObjDesc);
-        return_ACPI_STATUS (AE_NO_MEMORY);
+        ObjDesc->Package.Elements = ACPI_ALLOCATE_ZEROED (
+            ((ACPI_SIZE) ElementCount + 1) * sizeof (void *));
+
+        if (!ObjDesc->Package.Elements)
+        {
+            AcpiUtDeleteObjectDesc (ObjDesc);
+            return_ACPI_STATUS (AE_NO_MEMORY);
+        }
+
+        ObjDesc->Package.Count = ElementCount;
     }
 
-    ObjDesc->Package.Count = ElementCount;
+    /* First arg is element count. Second arg begins the initializer list */
+
     Arg = Op->Common.Value.Arg;
     Arg = Arg->Common.Next;
 
-    if (Arg)
+    /*
+     * If we are executing module-level code, we will defer the
+     * full resolution of the package elements in order to support
+     * forward references from the elements. This provides
+     * compatibility with other ACPI implementations.
+     */
+    if (ModuleLevelCode)
     {
-        ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
+        ObjDesc->Package.AmlStart = WalkState->Aml;
+        ObjDesc->Package.AmlLength = 0;
+
+        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_PARSE,
+            "%s: Deferring resolution of Package elements\n",
+            ACPI_GET_FUNCTION_NAME));
     }
 
     /*
@@ -200,12 +227,17 @@ AcpiDsBuildInternalPackageObj (
                 ACPI_ERROR ((AE_INFO, "%-48s", "****DS namepath not found"));
             }
 
-            /*
-             * Initialize this package element. This function handles the
-             * resolution of named references within the package.
-             */
-            AcpiDsInitPackageElement (0, ObjDesc->Package.Elements[i],
-                NULL, &ObjDesc->Package.Elements[i]);
+            if (!ModuleLevelCode)
+            {
+                /*
+                 * Initialize this package element. This function handles the
+                 * resolution of named references within the package.
+                 * Forward references from module-level code are deferred
+                 * until all ACPI tables are loaded.
+                 */
+                AcpiDsInitPackageElement (0, ObjDesc->Package.Elements[i],
+                    NULL, &ObjDesc->Package.Elements[i]);
+            }
         }
 
         if (*ObjDescPtr)
@@ -275,15 +307,21 @@ AcpiDsBuildInternalPackageObj (
          * NumElements count.
          *
          * Note: this is not an error, the package is padded out
-         * with NULLs.
+         * with NULLs as per the ACPI specification.
          */
-        ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
-            "Package List length (%u) smaller than NumElements "
+        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,
+            "%s: Package List length (%u) smaller than NumElements "
             "count (%u), padded with null elements\n",
-            i, ElementCount));
+            ACPI_GET_FUNCTION_NAME, i, ElementCount));
+    }
+
+    /* Module-level packages will be resolved later */
+
+    if (!ModuleLevelCode)
+    {
+        ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
     }
 
-    ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
     Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjDesc);
     return_ACPI_STATUS (Status);
 }
@@ -373,11 +411,12 @@ AcpiDsResolvePackageElement (
     ACPI_OPERAND_OBJECT     **ElementPtr)
 {
     ACPI_STATUS             Status;
+    ACPI_STATUS             Status2;
     ACPI_GENERIC_STATE      ScopeInfo;
     ACPI_OPERAND_OBJECT     *Element = *ElementPtr;
     ACPI_NAMESPACE_NODE     *ResolvedNode;
     ACPI_NAMESPACE_NODE     *OriginalNode;
-    char                    *ExternalPath = NULL;
+    char                    *ExternalPath = "";
     ACPI_OBJECT_TYPE        Type;
 
 
@@ -388,6 +427,10 @@ AcpiDsResolvePackageElement (
 
     if (Element->Reference.Resolved)
     {
+        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_PARSE,
+            "%s: Package element is already resolved\n",
+            ACPI_GET_FUNCTION_NAME));
+
         return_VOID;
     }
 
@@ -395,21 +438,47 @@ AcpiDsResolvePackageElement (
 
     ScopeInfo.Scope.Node = Element->Reference.Node; /* Prefix node */
 
-    Status = AcpiNsLookup (&ScopeInfo,
-        (char *) Element->Reference.Aml,            /* Pointer to AML path */
+    Status = AcpiNsLookup (&ScopeInfo, (char *) Element->Reference.Aml,
         ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
         ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
         NULL, &ResolvedNode);
     if (ACPI_FAILURE (Status))
     {
-        Status = AcpiNsExternalizeName (ACPI_UINT32_MAX,
-            (char *) Element->Reference.Aml,
-            NULL, &ExternalPath);
+        if ((Status == AE_NOT_FOUND) && AcpiGbl_IgnorePackageResolutionErrors)
+        {
+            /*
+             * Optionally be silent about the NOT_FOUND case for the referenced
+             * name. Although this is potentially a serious problem,
+             * it can generate a lot of noise/errors on platforms whose
+             * firmware carries around a bunch of unused Package objects.
+             * To disable these errors, set this global to TRUE:
+             *     AcpiGbl_IgnorePackageResolutionErrors
+             *
+             * If the AML actually tries to use such a package, the unresolved
+             * element(s) will be replaced with NULL elements.
+             */
+
+            /* Referenced name not found, set the element to NULL */
+
+            AcpiUtRemoveReference (*ElementPtr);
+            *ElementPtr = NULL;
+            return_VOID;
+        }
+
+        Status2 = AcpiNsExternalizeName (ACPI_UINT32_MAX,
+            (char *) Element->Reference.Aml, NULL, &ExternalPath);
 
         ACPI_EXCEPTION ((AE_INFO, Status,
-            "Could not find/resolve named package element: %s", ExternalPath));
+            "While resolving a named reference package element - %s",
+            ExternalPath));
+        if (ACPI_SUCCESS (Status2))
+        {
+            ACPI_FREE (ExternalPath);
+        }
+
+        /* Could not resolve name, set the element to NULL */
 
-        ACPI_FREE (ExternalPath);
+        AcpiUtRemoveReference (*ElementPtr);
         *ElementPtr = NULL;
         return_VOID;
     }
@@ -423,24 +492,6 @@ AcpiDsResolvePackageElement (
         *ElementPtr = NULL;
         return_VOID;
     }
-#if 0
-    else if (ResolvedNode->Flags & ANOBJ_TEMPORARY)
-    {
-        /*
-         * A temporary node found here indicates that the reference is
-         * to a node that was created within this method. We are not
-         * going to allow it (especially if the package is returned
-         * from the method) -- the temporary node will be deleted out
-         * from under the method. (05/2017).
-         */
-        ACPI_ERROR ((AE_INFO,
-            "Package element refers to a temporary name [%4.4s], "
-            "inserting a NULL element",
-            ResolvedNode->Name.Ascii));
-        *ElementPtr = NULL;
-        return_VOID;
-    }
-#endif
 
     /*
      * Special handling for Alias objects. We need ResolvedNode to point
@@ -479,22 +530,6 @@ AcpiDsResolvePackageElement (
         return_VOID;
     }
 
-#if 0
-/* TBD - alias support */
-    /*
-     * Special handling for Alias objects. We need to setup the type
-     * and the Op->Common.Node to point to the Alias target. Note,
-     * Alias has at most one level of indirection internally.
-     */
-    Type = Op->Common.Node->Type;
-    if (Type == ACPI_TYPE_LOCAL_ALIAS)
-    {
-        Type = ObjDesc->Common.Type;
-        Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
-            Op->Common.Node->Object);
-    }
-#endif
-
     switch (Type)
     {
     /*
index 932fa4f..e3aa385 100644 (file)
@@ -615,8 +615,8 @@ AcpiDsExecEndOp (
         case AML_TYPE_CREATE_OBJECT:
 
             ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
-                "Executing CreateObject (Buffer/Package) Op=%p AMLPtr=%p\n",
-                Op, Op->Named.Data));
+                "Executing CreateObject (Buffer/Package) Op=%p Child=%p ParentOpcode=%4.4X\n",
+                Op, Op->Named.Value.Arg, Op->Common.Parent->Common.AmlOpcode));
 
             switch (Op->Common.Parent->Common.AmlOpcode)
             {
index c451b80..0b22207 100644 (file)
@@ -156,7 +156,7 @@ AcpiDsLoad1BeginOp (
     UINT32                  Flags;
 
 
-    ACPI_FUNCTION_TRACE (DsLoad1BeginOp);
+    ACPI_FUNCTION_TRACE_PTR (DsLoad1BeginOp, WalkState->Op);
 
 
     Op = WalkState->Op;
index 0d9df41..d94242e 100644 (file)
@@ -161,8 +161,7 @@ AcpiDsScopeStackPush (
     }
     else
     {
-        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
-            "[\\___] (%s)", "ROOT"));
+        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, ACPI_NAMESPACE_ROOT));
     }
 
     ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
@@ -220,15 +219,13 @@ AcpiDsScopeStackPop (
     NewScopeInfo = WalkState->ScopeInfo;
     if (NewScopeInfo)
     {
-        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
-            "[%4.4s] (%s)\n",
+        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "[%4.4s] (%s)\n",
             AcpiUtGetNodeName (NewScopeInfo->Scope.Node),
             AcpiUtGetTypeName (NewScopeInfo->Common.Value)));
     }
     else
     {
-        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
-            "[\\___] (ROOT)\n"));
+        ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "%s\n", ACPI_NAMESPACE_ROOT));
     }
 
     AcpiUtDeleteGenericState (ScopeInfo);
index f802e9b..cec39cb 100644 (file)
@@ -236,6 +236,7 @@ AcpiEvFixedEventDetect (
     UINT32                  FixedStatus;
     UINT32                  FixedEnable;
     UINT32                  i;
+    ACPI_STATUS             Status;
 
 
     ACPI_FUNCTION_NAME (EvFixedEventDetect);
@@ -245,8 +246,12 @@ AcpiEvFixedEventDetect (
      * Read the fixed feature status and enable registers, as all the cases
      * depend on their values. Ignore errors here.
      */
-    (void) AcpiHwRegisterRead (ACPI_REGISTER_PM1_STATUS, &FixedStatus);
-    (void) AcpiHwRegisterRead (ACPI_REGISTER_PM1_ENABLE, &FixedEnable);
+    Status = AcpiHwRegisterRead (ACPI_REGISTER_PM1_STATUS, &FixedStatus);
+    Status |= AcpiHwRegisterRead (ACPI_REGISTER_PM1_ENABLE, &FixedEnable);
+    if (ACPI_FAILURE (Status))
+    {
+        return (IntStatus);
+    }
 
     ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
         "Fixed Event Block: Enable %08X Status %08X\n",
index 34294c0..15e260a 100644 (file)
@@ -118,7 +118,7 @@ AcpiEvUpdateGpeEnableMask (
  *
  * RETURN:      Status
  *
- * DESCRIPTION: Clear a GPE of stale events and enable it.
+ * DESCRIPTION: Enable a GPE.
  *
  ******************************************************************************/
 
@@ -132,14 +132,6 @@ AcpiEvEnableGpe (
     ACPI_FUNCTION_TRACE (EvEnableGpe);
 
 
-    /* Clear the GPE (of stale events) */
-
-    Status = AcpiHwClearGpe (GpeEventInfo);
-    if (ACPI_FAILURE (Status))
-    {
-        return_ACPI_STATUS (Status);
-    }
-
     /* Enable the requested GPE */
 
     Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE);
@@ -434,17 +426,12 @@ UINT32
 AcpiEvGpeDetect (
     ACPI_GPE_XRUPT_INFO     *GpeXruptList)
 {
-    ACPI_STATUS             Status;
     ACPI_GPE_BLOCK_INFO     *GpeBlock;
     ACPI_NAMESPACE_NODE     *GpeDevice;
     ACPI_GPE_REGISTER_INFO  *GpeRegisterInfo;
     ACPI_GPE_EVENT_INFO     *GpeEventInfo;
     UINT32                  GpeNumber;
-    ACPI_GPE_HANDLER_INFO   *GpeHandlerInfo;
     UINT32                  IntStatus = ACPI_INTERRUPT_NOT_HANDLED;
-    UINT8                   EnabledStatusByte;
-    UINT64                  StatusReg;
-    UINT64                  EnableReg;
     ACPI_CPU_FLAGS          Flags;
     UINT32                  i;
     UINT32                  j;
@@ -500,105 +487,25 @@ AcpiEvGpeDetect (
                 continue;
             }
 
-            /* Read the Status Register */
-
-            Status = AcpiHwRead (&StatusReg, &GpeRegisterInfo->StatusAddress);
-            if (ACPI_FAILURE (Status))
-            {
-                goto UnlockAndExit;
-            }
-
-            /* Read the Enable Register */
-
-            Status = AcpiHwRead (&EnableReg, &GpeRegisterInfo->EnableAddress);
-            if (ACPI_FAILURE (Status))
-            {
-                goto UnlockAndExit;
-            }
-
-            ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
-                "Read registers for GPE %02X-%02X: Status=%02X, Enable=%02X, "
-                "RunEnable=%02X, WakeEnable=%02X\n",
-                GpeRegisterInfo->BaseGpeNumber,
-                GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
-                (UINT32) StatusReg, (UINT32) EnableReg,
-                GpeRegisterInfo->EnableForRun,
-                GpeRegisterInfo->EnableForWake));
-
-            /* Check if there is anything active at all in this register */
-
-            EnabledStatusByte = (UINT8) (StatusReg & EnableReg);
-            if (!EnabledStatusByte)
-            {
-                /* No active GPEs in this register, move on */
-
-                continue;
-            }
-
             /* Now look at the individual GPEs in this byte register */
 
             for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++)
             {
-                /* Examine one GPE bit */
+                /* Detect and dispatch one GPE bit */
 
                 GpeEventInfo = &GpeBlock->EventInfo[((ACPI_SIZE) i *
                     ACPI_GPE_REGISTER_WIDTH) + j];
                 GpeNumber = j + GpeRegisterInfo->BaseGpeNumber;
-
-                if (EnabledStatusByte & (1 << j))
-                {
-                    /* Invoke global event handler if present */
-
-                    AcpiGpeCount++;
-                    if (AcpiGbl_GlobalEventHandler)
-                    {
-                        AcpiGbl_GlobalEventHandler (ACPI_EVENT_TYPE_GPE,
-                            GpeDevice, GpeNumber,
-                            AcpiGbl_GlobalEventHandlerContext);
-                    }
-
-                    /* Found an active GPE */
-
-                    if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
-                        ACPI_GPE_DISPATCH_RAW_HANDLER)
-                    {
-                        /* Dispatch the event to a raw handler */
-
-                        GpeHandlerInfo = GpeEventInfo->Dispatch.Handler;
-
-                        /*
-                         * There is no protection around the namespace node
-                         * and the GPE handler to ensure a safe destruction
-                         * because:
-                         * 1. The namespace node is expected to always
-                         *    exist after loading a table.
-                         * 2. The GPE handler is expected to be flushed by
-                         *    AcpiOsWaitEventsComplete() before the
-                         *    destruction.
-                         */
-                        AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
-                        IntStatus |= GpeHandlerInfo->Address (
-                            GpeDevice, GpeNumber, GpeHandlerInfo->Context);
-                        Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
-                    }
-                    else
-                    {
-                        /*
-                         * Dispatch the event to a standard handler or
-                         * method.
-                         */
-                        IntStatus |= AcpiEvGpeDispatch (GpeDevice,
-                            GpeEventInfo, GpeNumber);
-                    }
-                }
+                AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
+                IntStatus |= AcpiEvDetectGpe (
+                    GpeDevice, GpeEventInfo, GpeNumber);
+                Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
             }
         }
 
         GpeBlock = GpeBlock->Next;
     }
 
-UnlockAndExit:
-
     AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
     return (IntStatus);
 }
@@ -784,6 +691,137 @@ AcpiEvFinishGpe (
 }
 
 
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiEvDetectGpe
+ *
+ * PARAMETERS:  GpeDevice           - Device node. NULL for GPE0/GPE1
+ *              GpeEventInfo        - Info for this GPE
+ *              GpeNumber           - Number relative to the parent GPE block
+ *
+ * RETURN:      INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED
+ *
+ * DESCRIPTION: Detect and dispatch a General Purpose Event to either a function
+ *              (e.g. EC) or method (e.g. _Lxx/_Exx) handler.
+ * NOTE:        GPE is W1C, so it is possible to handle a single GPE from both
+ *              task and irq context in parallel as long as the process to
+ *              detect and mask the GPE is atomic.
+ *              However the atomicity of ACPI_GPE_DISPATCH_RAW_HANDLER is
+ *              dependent on the raw handler itself.
+ *
+ ******************************************************************************/
+
+UINT32
+AcpiEvDetectGpe (
+    ACPI_NAMESPACE_NODE     *GpeDevice,
+    ACPI_GPE_EVENT_INFO     *GpeEventInfo,
+    UINT32                  GpeNumber)
+{
+    UINT32                  IntStatus = ACPI_INTERRUPT_NOT_HANDLED;
+    UINT8                   EnabledStatusByte;
+    UINT64                  StatusReg;
+    UINT64                  EnableReg;
+    UINT32                  RegisterBit;
+    ACPI_GPE_REGISTER_INFO  *GpeRegisterInfo;
+    ACPI_GPE_HANDLER_INFO   *GpeHandlerInfo;
+    ACPI_CPU_FLAGS          Flags;
+    ACPI_STATUS             Status;
+
+
+    ACPI_FUNCTION_TRACE (EvGpeDetect);
+
+
+    Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
+
+    /* Get the info block for the entire GPE register */
+
+    GpeRegisterInfo = GpeEventInfo->RegisterInfo;
+
+    /* Get the register bitmask for this GPE */
+
+    RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
+
+    /* GPE currently enabled (enable bit == 1)? */
+
+    Status = AcpiHwRead (&EnableReg, &GpeRegisterInfo->EnableAddress);
+    if (ACPI_FAILURE (Status))
+    {
+        goto ErrorExit;
+    }
+
+    /* GPE currently active (status bit == 1)? */
+
+    Status = AcpiHwRead (&StatusReg, &GpeRegisterInfo->StatusAddress);
+    if (ACPI_FAILURE (Status))
+    {
+        goto ErrorExit;
+    }
+
+    /* Check if there is anything active at all in this GPE */
+
+    ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
+        "Read registers for GPE %02X: Status=%02X, Enable=%02X, "
+        "RunEnable=%02X, WakeEnable=%02X\n",
+        GpeNumber,
+        (UINT32) (StatusReg & RegisterBit),
+        (UINT32) (EnableReg & RegisterBit),
+        GpeRegisterInfo->EnableForRun,
+        GpeRegisterInfo->EnableForWake));
+
+    EnabledStatusByte = (UINT8) (StatusReg & EnableReg);
+    if (!(EnabledStatusByte & RegisterBit))
+    {
+        goto ErrorExit;
+    }
+
+    /* Invoke global event handler if present */
+
+    AcpiGpeCount++;
+    if (AcpiGbl_GlobalEventHandler)
+    {
+        AcpiGbl_GlobalEventHandler (ACPI_EVENT_TYPE_GPE,
+            GpeDevice, GpeNumber,
+            AcpiGbl_GlobalEventHandlerContext);
+    }
+
+    /* Found an active GPE */
+
+    if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
+        ACPI_GPE_DISPATCH_RAW_HANDLER)
+    {
+        /* Dispatch the event to a raw handler */
+
+        GpeHandlerInfo = GpeEventInfo->Dispatch.Handler;
+
+        /*
+         * There is no protection around the namespace node
+         * and the GPE handler to ensure a safe destruction
+         * because:
+         * 1. The namespace node is expected to always
+         *    exist after loading a table.
+         * 2. The GPE handler is expected to be flushed by
+         *    AcpiOsWaitEventsComplete() before the
+         *    destruction.
+         */
+        AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
+        IntStatus |= GpeHandlerInfo->Address (
+            GpeDevice, GpeNumber, GpeHandlerInfo->Context);
+        Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
+    }
+    else
+    {
+        /* Dispatch the event to a standard handler or method. */
+
+        IntStatus |= AcpiEvGpeDispatch (GpeDevice,
+            GpeEventInfo, GpeNumber);
+    }
+
+ErrorExit:
+    AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
+    return (IntStatus);
+}
+
+
 /*******************************************************************************
  *
  * FUNCTION:    AcpiEvGpeDispatch
@@ -797,8 +835,6 @@ AcpiEvFinishGpe (
  * DESCRIPTION: Dispatch a General Purpose Event to either a function (e.g. EC)
  *              or method (e.g. _Lxx/_Exx) handler.
  *
- *              This function executes at interrupt level.
- *
  ******************************************************************************/
 
 UINT32
index 6c929e7..cded059 100644 (file)
@@ -477,7 +477,7 @@ ACPI_STATUS
 AcpiEvInitializeGpeBlock (
     ACPI_GPE_XRUPT_INFO     *GpeXruptInfo,
     ACPI_GPE_BLOCK_INFO     *GpeBlock,
-    void                    *Ignored)
+    void                    *Context)
 {
     ACPI_STATUS             Status;
     ACPI_GPE_EVENT_INFO     *GpeEventInfo;
@@ -485,6 +485,8 @@ AcpiEvInitializeGpeBlock (
     UINT32                  GpeIndex;
     UINT32                  i;
     UINT32                  j;
+    BOOLEAN                 *IsPollingNeeded = Context;
+    ACPI_ERROR_ONLY (UINT32 GpeNumber);
 
 
     ACPI_FUNCTION_TRACE (EvInitializeGpeBlock);
@@ -514,14 +516,14 @@ AcpiEvInitializeGpeBlock (
 
             GpeIndex = (i * ACPI_GPE_REGISTER_WIDTH) + j;
             GpeEventInfo = &GpeBlock->EventInfo[GpeIndex];
+            ACPI_ERROR_ONLY(GpeNumber = GpeBlock->BlockBaseNumber + GpeIndex);
+            GpeEventInfo->Flags |= ACPI_GPE_INITIALIZED;
 
             /*
              * Ignore GPEs that have no corresponding _Lxx/_Exx method
              * and GPEs that are used to wake the system
              */
-            if ((ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) == ACPI_GPE_DISPATCH_NONE) ||
-                (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) == ACPI_GPE_DISPATCH_HANDLER) ||
-                (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) == ACPI_GPE_DISPATCH_RAW_HANDLER) ||
+            if ((ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) != ACPI_GPE_DISPATCH_METHOD) ||
                 (GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE))
             {
                 continue;
@@ -532,10 +534,18 @@ AcpiEvInitializeGpeBlock (
             {
                 ACPI_EXCEPTION ((AE_INFO, Status,
                     "Could not enable GPE 0x%02X",
-                    GpeIndex + GpeBlock->BlockBaseNumber));
+                    GpeNumber));
                 continue;
             }
 
+            GpeEventInfo->Flags |= ACPI_GPE_AUTO_ENABLED;
+
+            if (IsPollingNeeded &&
+                ACPI_GPE_IS_POLLING_NEEDED (GpeEventInfo))
+            {
+                *IsPollingNeeded = TRUE;
+            }
+
             GpeEnabledCount++;
         }
     }
index 7ed8ae5..0ab23c1 100644 (file)
@@ -628,9 +628,12 @@ AcpiEvInitializeRegion (
                  * Node's object was replaced by this Method object and we
                  * saved the handler in the method object.
                  *
+                 * Note: Only used for the legacy MLC support. Will
+                 * be removed in the future.
+                 *
                  * See AcpiNsExecModuleCode
                  */
-                if (!AcpiGbl_ParseTableAsTermList &&
+                if (!AcpiGbl_ExecuteTablesAsMethods &&
                     ObjDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL)
                 {
                     HandlerObj = ObjDesc->Method.Dispatch.Handler;
index 1591847..79dc347 100644 (file)
@@ -1149,6 +1149,15 @@ AcpiRemoveGpeHandler (
         Handler->OriginallyEnabled)
     {
         (void) AcpiEvAddGpeReference (GpeEventInfo);
+        if (ACPI_GPE_IS_POLLING_NEEDED (GpeEventInfo))
+        {
+            /* Poll edge triggered GPEs to handle existing events */
+
+            AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
+            (void) AcpiEvDetectGpe (
+                GpeDevice, GpeEventInfo, GpeNumber);
+            Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
+        }
     }
 
     AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
index 2b6be57..0b1b22e 100644 (file)
@@ -80,6 +80,7 @@ AcpiUpdateAllGpes (
     void)
 {
     ACPI_STATUS             Status;
+    BOOLEAN                 IsPollingNeeded = FALSE;
 
 
     ACPI_FUNCTION_TRACE (AcpiUpdateAllGpes);
@@ -96,7 +97,8 @@ AcpiUpdateAllGpes (
         goto UnlockAndExit;
     }
 
-    Status = AcpiEvWalkGpeList (AcpiEvInitializeGpeBlock, NULL);
+    Status = AcpiEvWalkGpeList (AcpiEvInitializeGpeBlock,
+        &IsPollingNeeded);
     if (ACPI_SUCCESS (Status))
     {
         AcpiGbl_AllGpesInitialized = TRUE;
@@ -104,6 +106,13 @@ AcpiUpdateAllGpes (
 
 UnlockAndExit:
     (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
+
+    if (IsPollingNeeded && AcpiGbl_AllGpesInitialized)
+    {
+        /* Poll GPEs to handle already triggered events */
+
+        AcpiEvGpeDetect (AcpiGbl_GpeXruptListHead);
+    }
     return_ACPI_STATUS (Status);
 }
 
@@ -151,6 +160,16 @@ AcpiEnableGpe (
             ACPI_GPE_DISPATCH_NONE)
         {
             Status = AcpiEvAddGpeReference (GpeEventInfo);
+            if (ACPI_SUCCESS (Status) &&
+                ACPI_GPE_IS_POLLING_NEEDED (GpeEventInfo))
+            {
+                /* Poll edge-triggered GPEs to handle existing events */
+
+                AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
+                (void) AcpiEvDetectGpe (
+                    GpeDevice, GpeEventInfo, GpeNumber);
+                Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
+            }
         }
         else
         {
@@ -501,6 +520,16 @@ AcpiSetupGpeForWake (
         GpeEventInfo->Flags =
             (ACPI_GPE_DISPATCH_NOTIFY | ACPI_GPE_LEVEL_TRIGGERED);
     }
+    else if (GpeEventInfo->Flags & ACPI_GPE_AUTO_ENABLED)
+    {
+        /*
+         * A reference to this GPE has been added during the GPE block
+         * initialization, so drop it now to prevent the GPE from being
+         * permanently enabled and clear its ACPI_GPE_AUTO_ENABLED flag.
+         */
+        (void) AcpiEvRemoveGpeReference (GpeEventInfo);
+        GpeEventInfo->Flags &= ~~ACPI_GPE_AUTO_ENABLED;
+    }
 
     /*
      * If we already have an implicit notify on this GPE, add
index df6ff62..8646374 100644 (file)
@@ -233,6 +233,11 @@ AcpiExLoadTableOp (
         return_ACPI_STATUS (Status);
     }
 
+    /* Complete the initialization/resolution of package objects */
+
+    Status = AcpiNsWalkNamespace (ACPI_TYPE_PACKAGE, ACPI_ROOT_OBJECT,
+        ACPI_UINT32_MAX, 0, AcpiNsInitOnePackage, NULL, NULL, NULL);
+
     /* Parameter Data (optional) */
 
     if (ParameterNode)
@@ -506,6 +511,11 @@ AcpiExLoadOp (
         return_ACPI_STATUS (Status);
     }
 
+    /* Complete the initialization/resolution of package objects */
+
+    Status = AcpiNsWalkNamespace (ACPI_TYPE_PACKAGE, ACPI_ROOT_OBJECT,
+        ACPI_UINT32_MAX, 0, AcpiNsInitOnePackage, NULL, NULL, NULL);
+
     /* Store the DdbHandle into the Target operand */
 
     Status = AcpiExStore (DdbHandle, Target, WalkState);
@@ -558,6 +568,17 @@ AcpiExUnloadTable (
     ACPI_WARNING ((AE_INFO,
         "Received request to unload an ACPI table"));
 
+    /*
+     * May 2018: Unload is no longer supported for the following reasons:
+     * 1) A correct implementation on some hosts may not be possible.
+     * 2) Other ACPI implementations do not correctly/fully support it.
+     * 3) It requires host device driver support which does not exist.
+     *    (To properly support namespace unload out from underneath.)
+     * 4) This AML operator has never been seen in the field.
+     */
+    ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED,
+        "AML Unload operator is not supported"));
+
     /*
      * Validate the handle
      * Although the handle is partially validated in AcpiExReconfiguration()
index 2e33ac8..6c2bc9d 100644 (file)
@@ -649,6 +649,7 @@ AcpiExConvertToTargetType (
     switch (GET_CURRENT_ARG_TYPE (WalkState->OpInfo->RuntimeArgs))
     {
     case ARGI_SIMPLE_TARGET:
+    case ARGI_FIXED_TARGET:
     case ARGI_INTEGER_REF:      /* Handles Increment, Decrement cases */
 
         switch (DestinationType)
index e31b381..e340fb1 100644 (file)
@@ -96,15 +96,14 @@ AcpiExDoDebugObject (
         return_VOID;
     }
 
-    /* Null string or newline -- don't emit the line header */
+    /* Newline -- don't emit the line header */
 
     if (SourceDesc &&
         (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_OPERAND) &&
         (SourceDesc->Common.Type == ACPI_TYPE_STRING))
     {
-        if ((SourceDesc->String.Length == 0) ||
-                ((SourceDesc->String.Length == 1) &&
-                (*SourceDesc->String.Pointer == '\n')))
+        if ((SourceDesc->String.Length == 1) &&
+            (*SourceDesc->String.Pointer == '\n'))
         {
             AcpiOsPrintf ("\n");
             return_VOID;
index caab789..b4a2a64 100644 (file)
@@ -201,14 +201,11 @@ AcpiExNameSegment (
         return_ACPI_STATUS (AE_CTRL_PENDING);
     }
 
-    ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Bytes from stream:\n"));
-
     for (Index = 0;
         (Index < ACPI_NAME_SIZE) && (AcpiUtValidNameChar (*AmlAddress, 0));
         Index++)
     {
         CharBuf[Index] = *AmlAddress++;
-        ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "%c\n", CharBuf[Index]));
     }
 
 
@@ -222,9 +219,9 @@ AcpiExNameSegment (
 
         if (NameString)
         {
-            strcat (NameString, CharBuf);
             ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
-                "Appended to - %s\n", NameString));
+                "Appending NameSeg %s\n", CharBuf));
+            strcat (NameString, CharBuf);
         }
         else
         {
index f8e2c21..3453803 100644 (file)
@@ -321,6 +321,7 @@ AcpiExResolveOperands (
         case ARGI_OBJECT_REF:
         case ARGI_DEVICE_REF:
         case ARGI_TARGETREF:     /* Allows implicit conversion rules before store */
+        case ARGI_FIXED_TARGET:  /* No implicit conversion before store to target */
         case ARGI_SIMPLE_TARGET: /* Name, Local, or Arg - no implicit conversion  */
         case ARGI_STORE_TARGET:
 
index dff688d..788fc56 100644 (file)
@@ -550,7 +550,6 @@ AcpiHwDisableAllGpes (
 
 
     Status = AcpiEvWalkGpeList (AcpiHwDisableGpeBlock, NULL);
-    Status = AcpiEvWalkGpeList (AcpiHwClearGpeBlock, NULL);
     return_ACPI_STATUS (Status);
 }
 
index 5a89bfc..8fce247 100644 (file)
@@ -90,16 +90,8 @@ AcpiHwLegacySleep (
         return_ACPI_STATUS (Status);
     }
 
-    /* Clear all fixed and general purpose status bits */
-
-    Status = AcpiHwClearAcpiStatus ();
-    if (ACPI_FAILURE (Status))
-    {
-        return_ACPI_STATUS (Status);
-    }
-
     /*
-     * 1) Disable/Clear all GPEs
+     * 1) Disable all GPEs
      * 2) Enable all wakeup GPEs
      */
     Status = AcpiHwDisableAllGpes ();
@@ -319,7 +311,7 @@ AcpiHwLegacyWake (
      * might get fired there
      *
      * Restore the GPEs:
-     * 1) Disable/Clear all GPEs
+     * 1) Disable all GPEs
      * 2) Enable all runtime GPEs
      */
     Status = AcpiHwDisableAllGpes ();
index 8170f83..f6e3ec1 100644 (file)
@@ -229,7 +229,7 @@ AcpiEnterSleepStateS4bios (
     }
 
     /*
-     * 1) Disable/Clear all GPEs
+     * 1) Disable all GPEs
      * 2) Enable all wakeup GPEs
      */
     Status = AcpiHwDisableAllGpes ();
index 654ff55..0192ea7 100644 (file)
@@ -216,6 +216,10 @@ FlSplitInputPathname (
     char                    **OutDirectoryPath,
     char                    **OutFilename);
 
+char *
+FlGetFileBasename (
+    char                    *FilePathname);
+
 char *
 AdGenerateFilename (
     char                    *Prefix,
index 99448ec..e9b7a48 100644 (file)
@@ -341,6 +341,7 @@ extern ACPI_DMTABLE_INFO        AcpiDmTableInfoIort3a[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoIort3b[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoIort3c[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoIort4[];
+extern ACPI_DMTABLE_INFO        AcpiDmTableInfoIort5[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoIortAcc[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoIortHdr[];
 extern ACPI_DMTABLE_INFO        AcpiDmTableInfoIortMap[];
index de7b8c6..5559544 100644 (file)
 #define __ACEVENTS_H__
 
 
+/*
+ * Conditions to trigger post enabling GPE polling:
+ * It is not sufficient to trigger edge-triggered GPE with specific GPE
+ * chips, software need to poll once after enabling.
+ */
+#ifdef ACPI_USE_GPE_POLLING
+#define ACPI_GPE_IS_POLLING_NEEDED(__gpe__)             \
+    ((__gpe__)->RuntimeCount == 1 &&                    \
+     (__gpe__)->Flags & ACPI_GPE_INITIALIZED &&         \
+     ((__gpe__)->Flags & ACPI_GPE_XRUPT_TYPE_MASK) == ACPI_GPE_EDGE_TRIGGERED)
+#else
+#define ACPI_GPE_IS_POLLING_NEEDED(__gpe__)             FALSE
+#endif
+
+
 /*
  * evevent
  */
@@ -142,6 +157,12 @@ ACPI_STATUS
 AcpiEvFinishGpe (
     ACPI_GPE_EVENT_INFO     *GpeEventInfo);
 
+UINT32
+AcpiEvDetectGpe (
+    ACPI_NAMESPACE_NODE     *GpeDevice,
+    ACPI_GPE_EVENT_INFO     *GpeEventInfo,
+    UINT32                  GpeNumber);
+
 
 /*
  * evgpeblk - Upper-level GPE block support
index 1816c3f..b7aba87 100644 (file)
 #define ACPI_WARN_PREDEFINED(plist)         AcpiUtPredefinedWarning plist
 #define ACPI_INFO_PREDEFINED(plist)         AcpiUtPredefinedInfo plist
 #define ACPI_BIOS_ERROR_PREDEFINED(plist)   AcpiUtPredefinedBiosError plist
+#define ACPI_ERROR_ONLY(s)                  s
 
 #else
 
 /* No error messages */
 
-#define ACPI_ERROR_NAMESPACE(s, e)
+#define ACPI_ERROR_NAMESPACE(s, p, e)
 #define ACPI_ERROR_METHOD(s, n, p, e)
 #define ACPI_WARN_PREDEFINED(plist)
 #define ACPI_INFO_PREDEFINED(plist)
 #define ACPI_BIOS_ERROR_PREDEFINED(plist)
+#define ACPI_ERROR_ONLY(s)
 
 #endif /* ACPI_NO_ERROR_MESSAGES */
 
index 663c6b1..8ca7fc8 100644 (file)
 /* Definitions of the predefined namespace names  */
 
 #define ACPI_UNKNOWN_NAME       (UINT32) 0x3F3F3F3F     /* Unknown name is "????" */
-#define ACPI_ROOT_NAME          (UINT32) 0x5F5F5F5C     /* Root name is    "\___" */
-
 #define ACPI_PREFIX_MIXED       (UINT32) 0x69706341     /* "Acpi" */
 #define ACPI_PREFIX_LOWER       (UINT32) 0x69706361     /* "acpi" */
 
+/* Root name stuff */
+
+#define ACPI_ROOT_NAME          (UINT32) 0x5F5F5F5C     /* Root name is    "\___" */
+#define ACPI_ROOT_PATHNAME      "\\___"
+#define ACPI_NAMESPACE_ROOT     "Namespace Root"
 #define ACPI_NS_ROOT_PATH       "\\"
 
 #endif  /* __ACNAMES_H__  */
index c93d555..51d4d93 100644 (file)
@@ -96,6 +96,12 @@ ACPI_STATUS
 AcpiNsInitializeDevices (
     UINT32                  Flags);
 
+ACPI_STATUS
+AcpiNsInitOnePackage (
+    ACPI_HANDLE             ObjHandle,
+    UINT32                  Level,
+    void                    *Context,
+    void                    **ReturnValue);
 
 /*
  * nsload -  Namespace loading
index 7c544f7..1bd9135 100644 (file)
 #define ARGI_FIELD_OP                   ARGI_INVALID_OPCODE
 #define ARGI_FIND_SET_LEFT_BIT_OP       ARGI_LIST2 (ARGI_INTEGER,    ARGI_TARGETREF)
 #define ARGI_FIND_SET_RIGHT_BIT_OP      ARGI_LIST2 (ARGI_INTEGER,    ARGI_TARGETREF)
-#define ARGI_FROM_BCD_OP                ARGI_LIST2 (ARGI_INTEGER,    ARGI_TARGETREF)
+#define ARGI_FROM_BCD_OP                ARGI_LIST2 (ARGI_INTEGER,    ARGI_FIXED_TARGET)
 #define ARGI_IF_OP                      ARGI_INVALID_OPCODE
 #define ARGI_INCREMENT_OP               ARGI_LIST1 (ARGI_TARGETREF)
 #define ARGI_INDEX_FIELD_OP             ARGI_INVALID_OPCODE
 #define ARGI_SUBTRACT_OP                ARGI_LIST3 (ARGI_INTEGER,    ARGI_INTEGER,       ARGI_TARGETREF)
 #define ARGI_THERMAL_ZONE_OP            ARGI_INVALID_OPCODE
 #define ARGI_TIMER_OP                   ARG_NONE
-#define ARGI_TO_BCD_OP                  ARGI_LIST2 (ARGI_INTEGER,    ARGI_TARGETREF)
-#define ARGI_TO_BUFFER_OP               ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_TARGETREF)
-#define ARGI_TO_DEC_STR_OP              ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_TARGETREF)
-#define ARGI_TO_HEX_STR_OP              ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_TARGETREF)
-#define ARGI_TO_INTEGER_OP              ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_TARGETREF)
-#define ARGI_TO_STRING_OP               ARGI_LIST3 (ARGI_BUFFER,     ARGI_INTEGER,       ARGI_TARGETREF)
+#define ARGI_TO_BCD_OP                  ARGI_LIST2 (ARGI_INTEGER,    ARGI_FIXED_TARGET)
+#define ARGI_TO_BUFFER_OP               ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
+#define ARGI_TO_DEC_STR_OP              ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
+#define ARGI_TO_HEX_STR_OP              ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
+#define ARGI_TO_INTEGER_OP              ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
+#define ARGI_TO_STRING_OP               ARGI_LIST3 (ARGI_BUFFER,     ARGI_INTEGER,       ARGI_FIXED_TARGET)
 #define ARGI_UNLOAD_OP                  ARGI_LIST1 (ARGI_DDBHANDLE)
 #define ARGI_VAR_PACKAGE_OP             ARGI_LIST1 (ARGI_INTEGER)
 #define ARGI_WAIT_OP                    ARGI_LIST2 (ARGI_EVENT,      ARGI_INTEGER)
index a293675..a03003b 100644 (file)
 #define ACPI_LV_ALLOCATIONS         0x00100000
 #define ACPI_LV_FUNCTIONS           0x00200000
 #define ACPI_LV_OPTIMIZATIONS       0x00400000
-#define ACPI_LV_VERBOSITY2          0x00700000 | ACPI_LV_VERBOSITY1
+#define ACPI_LV_PARSE_TREES         0x00800000
+#define ACPI_LV_VERBOSITY2          0x00F00000 | ACPI_LV_VERBOSITY1
 #define ACPI_LV_ALL                 ACPI_LV_VERBOSITY2
 
 /* Trace verbosity level 3 [Threading, I/O, and Interrupts] */
 #define ACPI_DB_TABLES              ACPI_DEBUG_LEVEL (ACPI_LV_TABLES)
 #define ACPI_DB_FUNCTIONS           ACPI_DEBUG_LEVEL (ACPI_LV_FUNCTIONS)
 #define ACPI_DB_OPTIMIZATIONS       ACPI_DEBUG_LEVEL (ACPI_LV_OPTIMIZATIONS)
+#define ACPI_DB_PARSE_TREES         ACPI_DEBUG_LEVEL (ACPI_LV_PARSE_TREES)
 #define ACPI_DB_VALUES              ACPI_DEBUG_LEVEL (ACPI_LV_VALUES)
 #define ACPI_DB_OBJECTS             ACPI_DEBUG_LEVEL (ACPI_LV_OBJECTS)
 #define ACPI_DB_ALLOCATIONS         ACPI_DEBUG_LEVEL (ACPI_LV_ALLOCATIONS)
index 8242adf..ebf5981 100644 (file)
@@ -46,7 +46,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20180105
+#define ACPI_CA_VERSION                 0x20180531
 
 #include "acconfig.h"
 #include "actypes.h"
@@ -194,15 +194,18 @@ ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_DoNotUseXsdt, FALSE);
 
 /*
  * Optionally support group module level code.
+ * NOTE, this is essentially obsolete and will be removed soon
+ * (01/2018).
  */
 ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_GroupModuleLevelCode, FALSE);
 
 /*
- * Optionally support module level code by parsing the entire table as
- * a TermList. Default is FALSE, do not execute entire table until some
- * lock order issues are fixed.
+ * Optionally support module level code by parsing an entire table as
+ * a method as it is loaded. Default is TRUE.
+ * NOTE, this is essentially obsolete and will be removed soon
+ * (01/2018).
  */
-ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_ParseTableAsTermList, FALSE);
+ACPI_INIT_GLOBAL (UINT8,            AcpiGbl_ExecuteTablesAsMethods, TRUE);
 
 /*
  * Optionally use 32-bit FADT addresses if and when there is a conflict
@@ -268,6 +271,16 @@ ACPI_INIT_GLOBAL (BOOLEAN,          AcpiGbl_ReducedHardware, FALSE);
  */
 ACPI_INIT_GLOBAL (UINT32,           AcpiGbl_MaxLoopIterations, ACPI_MAX_LOOP_TIMEOUT);
 
+/*
+ * Optionally ignore AE_NOT_FOUND errors from named reference package elements
+ * during DSDT/SSDT table loading. This reduces error "noise" in platforms
+ * whose firmware is carrying around a bunch of unused package objects that
+ * refer to non-existent named objects. However, If the AML actually tries to
+ * use such a package, the unresolved element(s) will be replaced with NULL
+ * elements.
+ */
+ACPI_INIT_GLOBAL (BOOLEAN,          AcpiGbl_IgnorePackageResolutionErrors, FALSE);
+
 /*
  * This mechanism is used to trace a specified AML method. The method is
  * traced each time it is executed.
index 6c0d997..8a1fd74 100644 (file)
 #define ACPI_IORT3_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU,f)
 #define ACPI_IORT3A_OFFSET(f)           (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU_GSI,f)
 #define ACPI_IORT4_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU_V3,f)
+#define ACPI_IORT5_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_IORT_PMCG,f)
 #define ACPI_IORTA_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_IORT_MEMORY_ACCESS,f)
 #define ACPI_IORTH_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_IORT_NODE,f)
 #define ACPI_IORTM_OFFSET(f)            (UINT16) ACPI_OFFSET (ACPI_IORT_ID_MAPPING,f)
index cc83db5..b76195f 100644 (file)
 
 /*******************************************************************************
  *
- * Additional ACPI Tables (1)
+ * Additional ACPI Tables
  *
  * These tables are not consumed directly by the ACPICA subsystem, but are
  * included here to support device drivers and the AML disassembler.
  *
- * The tables in this file are fully defined within the ACPI specification.
- *
  ******************************************************************************/
 
 
  * file. Useful because they make it more difficult to inadvertently type in
  * the wrong signature.
  */
+#define ACPI_SIG_ASF            "ASF!"      /* Alert Standard Format table */
 #define ACPI_SIG_BERT           "BERT"      /* Boot Error Record Table */
+#define ACPI_SIG_BGRT           "BGRT"      /* Boot Graphics Resource Table */
+#define ACPI_SIG_BOOT           "BOOT"      /* Simple Boot Flag Table */
 #define ACPI_SIG_CPEP           "CPEP"      /* Corrected Platform Error Polling table */
+#define ACPI_SIG_CSRT           "CSRT"      /* Core System Resource Table */
+#define ACPI_SIG_DBG2           "DBG2"      /* Debug Port table type 2 */
+#define ACPI_SIG_DBGP           "DBGP"      /* Debug Port table */
+#define ACPI_SIG_DMAR           "DMAR"      /* DMA Remapping table */
+#define ACPI_SIG_DRTM           "DRTM"      /* Dynamic Root of Trust for Measurement table */
 #define ACPI_SIG_ECDT           "ECDT"      /* Embedded Controller Boot Resources Table */
 #define ACPI_SIG_EINJ           "EINJ"      /* Error Injection table */
 #define ACPI_SIG_ERST           "ERST"      /* Error Record Serialization Table */
-#define ACPI_SIG_HMAT           "HMAT"      /* Heterogeneous Memory Attributes Table */
+#define ACPI_SIG_FPDT           "FPDT"      /* Firmware Performance Data Table */
+#define ACPI_SIG_GTDT           "GTDT"      /* Generic Timer Description Table */
 #define ACPI_SIG_HEST           "HEST"      /* Hardware Error Source Table */
-#define ACPI_SIG_MADT           "APIC"      /* Multiple APIC Description Table */
-#define ACPI_SIG_MSCT           "MSCT"      /* Maximum System Characteristics Table */
-#define ACPI_SIG_PDTT           "PDTT"      /* Platform Debug Trigger Table */
-#define ACPI_SIG_PPTT           "PPTT"      /* Processor Properties Topology Table */
-#define ACPI_SIG_SBST           "SBST"      /* Smart Battery Specification Table */
-#define ACPI_SIG_SDEV           "SDEV"      /* Secure Devices table */
-#define ACPI_SIG_SLIT           "SLIT"      /* System Locality Distance Information Table */
-#define ACPI_SIG_SRAT           "SRAT"      /* System Resource Affinity Table */
-#define ACPI_SIG_NFIT           "NFIT"      /* NVDIMM Firmware Interface Table */
+#define ACPI_SIG_HMAT           "HMAT"      /* Heterogeneous Memory Attributes Table */
+#define ACPI_SIG_HPET           "HPET"      /* High Precision Event Timer table */
+#define ACPI_SIG_IBFT           "IBFT"      /* iSCSI Boot Firmware Table */
+
+#define ACPI_SIG_S3PT           "S3PT"      /* S3 Performance (sub)Table */
+#define ACPI_SIG_PCCS           "PCC"       /* PCC Shared Memory Region */
 
 
+/* Reserved table signatures */
+
+#define ACPI_SIG_MATR           "MATR"      /* Memory Address Translation Table */
+#define ACPI_SIG_MSDM           "MSDM"      /* Microsoft Data Management Table */
+
+/*
+ * These tables have been seen in the field, but no definition has been found
+ */
+#ifdef ACPI_UNDEFINED_TABLES
+#define ACPI_SIG_ATKG           "ATKG"
+#define ACPI_SIG_GSCI           "GSCI"      /* GMCH SCI table */
+#define ACPI_SIG_IEIT           "IEIT"
+#endif
+
 /*
  * All tables must be byte-packed to match the ACPI specification, since
  * the tables are provided by the system BIOS.
@@ -130,6 +148,146 @@ typedef struct acpi_whea_header
 } ACPI_WHEA_HEADER;
 
 
+/*******************************************************************************
+ *
+ * ASF - Alert Standard Format table (Signature "ASF!")
+ *       Revision 0x10
+ *
+ * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_asf
+{
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+
+} ACPI_TABLE_ASF;
+
+
+/* ASF subtable header */
+
+typedef struct acpi_asf_header
+{
+    UINT8                   Type;
+    UINT8                   Reserved;
+    UINT16                  Length;
+
+} ACPI_ASF_HEADER;
+
+
+/* Values for Type field above */
+
+enum AcpiAsfType
+{
+    ACPI_ASF_TYPE_INFO          = 0,
+    ACPI_ASF_TYPE_ALERT         = 1,
+    ACPI_ASF_TYPE_CONTROL       = 2,
+    ACPI_ASF_TYPE_BOOT          = 3,
+    ACPI_ASF_TYPE_ADDRESS       = 4,
+    ACPI_ASF_TYPE_RESERVED      = 5
+};
+
+/*
+ * ASF subtables
+ */
+
+/* 0: ASF Information */
+
+typedef struct acpi_asf_info
+{
+    ACPI_ASF_HEADER         Header;
+    UINT8                   MinResetValue;
+    UINT8                   MinPollInterval;
+    UINT16                  SystemId;
+    UINT32                  MfgId;
+    UINT8                   Flags;
+    UINT8                   Reserved2[3];
+
+} ACPI_ASF_INFO;
+
+/* Masks for Flags field above */
+
+#define ACPI_ASF_SMBUS_PROTOCOLS    (1)
+
+
+/* 1: ASF Alerts */
+
+typedef struct acpi_asf_alert
+{
+    ACPI_ASF_HEADER         Header;
+    UINT8                   AssertMask;
+    UINT8                   DeassertMask;
+    UINT8                   Alerts;
+    UINT8                   DataLength;
+
+} ACPI_ASF_ALERT;
+
+typedef struct acpi_asf_alert_data
+{
+    UINT8                   Address;
+    UINT8                   Command;
+    UINT8                   Mask;
+    UINT8                   Value;
+    UINT8                   SensorType;
+    UINT8                   Type;
+    UINT8                   Offset;
+    UINT8                   SourceType;
+    UINT8                   Severity;
+    UINT8                   SensorNumber;
+    UINT8                   Entity;
+    UINT8                   Instance;
+
+} ACPI_ASF_ALERT_DATA;
+
+
+/* 2: ASF Remote Control */
+
+typedef struct acpi_asf_remote
+{
+    ACPI_ASF_HEADER         Header;
+    UINT8                   Controls;
+    UINT8                   DataLength;
+    UINT16                  Reserved2;
+
+} ACPI_ASF_REMOTE;
+
+typedef struct acpi_asf_control_data
+{
+    UINT8                   Function;
+    UINT8                   Address;
+    UINT8                   Command;
+    UINT8                   Value;
+
+} ACPI_ASF_CONTROL_DATA;
+
+
+/* 3: ASF RMCP Boot Options */
+
+typedef struct acpi_asf_rmcp
+{
+    ACPI_ASF_HEADER         Header;
+    UINT8                   Capabilities[7];
+    UINT8                   CompletionCode;
+    UINT32                  EnterpriseId;
+    UINT8                   Command;
+    UINT16                  Parameter;
+    UINT16                  BootOptions;
+    UINT16                  OemParameters;
+
+} ACPI_ASF_RMCP;
+
+
+/* 4: ASF Address */
+
+typedef struct acpi_asf_address
+{
+    ACPI_ASF_HEADER         Header;
+    UINT8                   EpromAddress;
+    UINT8                   Devices;
+
+} ACPI_ASF_ADDRESS;
+
+
 /*******************************************************************************
  *
  * BERT - Boot Error Record Table (ACPI 4.0)
@@ -183,6 +341,49 @@ enum AcpiBertErrorSeverity
  */
 
 
+/*******************************************************************************
+ *
+ * BGRT - Boot Graphics Resource Table (ACPI 5.0)
+ *        Version 1
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_bgrt
+{
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    UINT16                  Version;
+    UINT8                   Status;
+    UINT8                   ImageType;
+    UINT64                  ImageAddress;
+    UINT32                  ImageOffsetX;
+    UINT32                  ImageOffsetY;
+
+} ACPI_TABLE_BGRT;
+
+/* Flags for Status field above */
+
+#define ACPI_BGRT_DISPLAYED                 (1)
+#define ACPI_BGRT_ORIENTATION_OFFSET        (3 << 1)
+
+
+/*******************************************************************************
+ *
+ * BOOT - Simple Boot Flag Table
+ *        Version 1
+ *
+ * Conforms to the "Simple Boot Flag Specification", Version 2.1
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_boot
+{
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    UINT8                   CmosIndex;          /* Index in CMOS RAM for the boot register */
+    UINT8                   Reserved[3];
+
+} ACPI_TABLE_BOOT;
+
+
 /*******************************************************************************
  *
  * CPEP - Corrected Platform Error Polling table (ACPI 4.0)
@@ -212,1725 +413,1522 @@ typedef struct acpi_cpep_polling
 
 /*******************************************************************************
  *
- * ECDT - Embedded Controller Boot Resources Table
- *        Version 1
+ * CSRT - Core System Resource Table
+ *        Version 0
+ *
+ * Conforms to the "Core System Resource Table (CSRT)", November 14, 2011
  *
  ******************************************************************************/
 
-typedef struct acpi_table_ecdt
+typedef struct acpi_table_csrt
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    ACPI_GENERIC_ADDRESS    Control;            /* Address of EC command/status register */
-    ACPI_GENERIC_ADDRESS    Data;               /* Address of EC data register */
-    UINT32                  Uid;                /* Unique ID - must be same as the EC _UID method */
-    UINT8                   Gpe;                /* The GPE for the EC */
-    UINT8                   Id[1];              /* Full namepath of the EC in the ACPI namespace */
 
-} ACPI_TABLE_ECDT;
+} ACPI_TABLE_CSRT;
 
 
-/*******************************************************************************
- *
- * EINJ - Error Injection Table (ACPI 4.0)
- *        Version 1
- *
- ******************************************************************************/
+/* Resource Group subtable */
 
-typedef struct acpi_table_einj
+typedef struct acpi_csrt_group
 {
-    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT32                  HeaderLength;
-    UINT8                   Flags;
-    UINT8                   Reserved[3];
-    UINT32                  Entries;
+    UINT32                  Length;
+    UINT32                  VendorId;
+    UINT32                  SubvendorId;
+    UINT16                  DeviceId;
+    UINT16                  SubdeviceId;
+    UINT16                  Revision;
+    UINT16                  Reserved;
+    UINT32                  SharedInfoLength;
 
-} ACPI_TABLE_EINJ;
+    /* Shared data immediately follows (Length = SharedInfoLength) */
 
+} ACPI_CSRT_GROUP;
 
-/* EINJ Injection Instruction Entries (actions) */
+/* Shared Info subtable */
 
-typedef struct acpi_einj_entry
+typedef struct acpi_csrt_shared_info
 {
-    ACPI_WHEA_HEADER        WheaHeader;         /* Common header for WHEA tables */
-
-} ACPI_EINJ_ENTRY;
+    UINT16                  MajorVersion;
+    UINT16                  MinorVersion;
+    UINT32                  MmioBaseLow;
+    UINT32                  MmioBaseHigh;
+    UINT32                  GsiInterrupt;
+    UINT8                   InterruptPolarity;
+    UINT8                   InterruptMode;
+    UINT8                   NumChannels;
+    UINT8                   DmaAddressWidth;
+    UINT16                  BaseRequestLine;
+    UINT16                  NumHandshakeSignals;
+    UINT32                  MaxBlockSize;
 
-/* Masks for Flags field above */
+    /* Resource descriptors immediately follow (Length = Group Length - SharedInfoLength) */
 
-#define ACPI_EINJ_PRESERVE          (1)
+} ACPI_CSRT_SHARED_INFO;
 
-/* Values for Action field above */
+/* Resource Descriptor subtable */
 
-enum AcpiEinjActions
+typedef struct acpi_csrt_descriptor
 {
-    ACPI_EINJ_BEGIN_OPERATION               = 0,
-    ACPI_EINJ_GET_TRIGGER_TABLE             = 1,
-    ACPI_EINJ_SET_ERROR_TYPE                = 2,
-    ACPI_EINJ_GET_ERROR_TYPE                = 3,
-    ACPI_EINJ_END_OPERATION                 = 4,
-    ACPI_EINJ_EXECUTE_OPERATION             = 5,
-    ACPI_EINJ_CHECK_BUSY_STATUS             = 6,
-    ACPI_EINJ_GET_COMMAND_STATUS            = 7,
-    ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS   = 8,
-    ACPI_EINJ_GET_EXECUTE_TIMINGS           = 9,
-    ACPI_EINJ_ACTION_RESERVED               = 10,    /* 10 and greater are reserved */
-    ACPI_EINJ_TRIGGER_ERROR                 = 0xFF   /* Except for this value */
-};
+    UINT32                  Length;
+    UINT16                  Type;
+    UINT16                  Subtype;
+    UINT32                  Uid;
 
-/* Values for Instruction field above */
+    /* Resource-specific information immediately follows */
 
-enum AcpiEinjInstructions
-{
-    ACPI_EINJ_READ_REGISTER         = 0,
-    ACPI_EINJ_READ_REGISTER_VALUE   = 1,
-    ACPI_EINJ_WRITE_REGISTER        = 2,
-    ACPI_EINJ_WRITE_REGISTER_VALUE  = 3,
-    ACPI_EINJ_NOOP                  = 4,
-    ACPI_EINJ_FLUSH_CACHELINE       = 5,
-    ACPI_EINJ_INSTRUCTION_RESERVED  = 6     /* 6 and greater are reserved */
-};
+} ACPI_CSRT_DESCRIPTOR;
 
-typedef struct acpi_einj_error_type_with_addr
+
+/* Resource Types */
+
+#define ACPI_CSRT_TYPE_INTERRUPT    0x0001
+#define ACPI_CSRT_TYPE_TIMER        0x0002
+#define ACPI_CSRT_TYPE_DMA          0x0003
+
+/* Resource Subtypes */
+
+#define ACPI_CSRT_XRUPT_LINE        0x0000
+#define ACPI_CSRT_XRUPT_CONTROLLER  0x0001
+#define ACPI_CSRT_TIMER             0x0000
+#define ACPI_CSRT_DMA_CHANNEL       0x0000
+#define ACPI_CSRT_DMA_CONTROLLER    0x0001
+
+
+/*******************************************************************************
+ *
+ * DBG2 - Debug Port Table 2
+ *        Version 0 (Both main table and subtables)
+ *
+ * Conforms to "Microsoft Debug Port Table 2 (DBG2)", December 10, 2015
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_dbg2
 {
-    UINT32                  ErrorType;
-    UINT32                  VendorStructOffset;
-    UINT32                  Flags;
-    UINT32                  ApicId;
-    UINT64                  Address;
-    UINT64                  Range;
-    UINT32                  PcieId;
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    UINT32                  InfoOffset;
+    UINT32                  InfoCount;
 
-} ACPI_EINJ_ERROR_TYPE_WITH_ADDR;
+} ACPI_TABLE_DBG2;
 
-typedef struct acpi_einj_vendor
+
+typedef struct acpi_dbg2_header
 {
-    UINT32                  Length;
-    UINT32                  PcieId;
-    UINT16                  VendorId;
-    UINT16                  DeviceId;
-    UINT8                   RevisionId;
-    UINT8                   Reserved[3];
+    UINT32                  InfoOffset;
+    UINT32                  InfoCount;
 
-} ACPI_EINJ_VENDOR;
+} ACPI_DBG2_HEADER;
 
 
-/* EINJ Trigger Error Action Table */
+/* Debug Device Information Subtable */
 
-typedef struct acpi_einj_trigger
+typedef struct acpi_dbg2_device
 {
-    UINT32                  HeaderSize;
-    UINT32                  Revision;
-    UINT32                  TableSize;
-    UINT32                  EntryCount;
+    UINT8                   Revision;
+    UINT16                  Length;
+    UINT8                   RegisterCount;      /* Number of BaseAddress registers */
+    UINT16                  NamepathLength;
+    UINT16                  NamepathOffset;
+    UINT16                  OemDataLength;
+    UINT16                  OemDataOffset;
+    UINT16                  PortType;
+    UINT16                  PortSubtype;
+    UINT16                  Reserved;
+    UINT16                  BaseAddressOffset;
+    UINT16                  AddressSizeOffset;
+    /*
+     * Data that follows:
+     *    BaseAddress (required) - Each in 12-byte Generic Address Structure format.
+     *    AddressSize (required) - Array of UINT32 sizes corresponding to each BaseAddress register.
+     *    Namepath    (required) - Null terminated string. Single dot if not supported.
+     *    OemData     (optional) - Length is OemDataLength.
+     */
+} ACPI_DBG2_DEVICE;
 
-} ACPI_EINJ_TRIGGER;
+/* Types for PortType field above */
 
-/* Command status return values */
+#define ACPI_DBG2_SERIAL_PORT       0x8000
+#define ACPI_DBG2_1394_PORT         0x8001
+#define ACPI_DBG2_USB_PORT          0x8002
+#define ACPI_DBG2_NET_PORT          0x8003
 
-enum AcpiEinjCommandStatus
-{
-    ACPI_EINJ_SUCCESS               = 0,
-    ACPI_EINJ_FAILURE               = 1,
-    ACPI_EINJ_INVALID_ACCESS        = 2,
-    ACPI_EINJ_STATUS_RESERVED       = 3     /* 3 and greater are reserved */
-};
+/* Subtypes for PortSubtype field above */
 
+#define ACPI_DBG2_16550_COMPATIBLE  0x0000
+#define ACPI_DBG2_16550_SUBSET      0x0001
+#define ACPI_DBG2_ARM_PL011         0x0003
+#define ACPI_DBG2_ARM_SBSA_32BIT    0x000D
+#define ACPI_DBG2_ARM_SBSA_GENERIC  0x000E
+#define ACPI_DBG2_ARM_DCC           0x000F
+#define ACPI_DBG2_BCM2835           0x0010
 
-/* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */
+#define ACPI_DBG2_1394_STANDARD     0x0000
 
-#define ACPI_EINJ_PROCESSOR_CORRECTABLE     (1)
-#define ACPI_EINJ_PROCESSOR_UNCORRECTABLE   (1<<1)
-#define ACPI_EINJ_PROCESSOR_FATAL           (1<<2)
-#define ACPI_EINJ_MEMORY_CORRECTABLE        (1<<3)
-#define ACPI_EINJ_MEMORY_UNCORRECTABLE      (1<<4)
-#define ACPI_EINJ_MEMORY_FATAL              (1<<5)
-#define ACPI_EINJ_PCIX_CORRECTABLE          (1<<6)
-#define ACPI_EINJ_PCIX_UNCORRECTABLE        (1<<7)
-#define ACPI_EINJ_PCIX_FATAL                (1<<8)
-#define ACPI_EINJ_PLATFORM_CORRECTABLE      (1<<9)
-#define ACPI_EINJ_PLATFORM_UNCORRECTABLE    (1<<10)
-#define ACPI_EINJ_PLATFORM_FATAL            (1<<11)
-#define ACPI_EINJ_VENDOR_DEFINED            (1<<31)
+#define ACPI_DBG2_USB_XHCI          0x0000
+#define ACPI_DBG2_USB_EHCI          0x0001
 
 
 /*******************************************************************************
  *
- * ERST - Error Record Serialization Table (ACPI 4.0)
+ * DBGP - Debug Port table
  *        Version 1
  *
+ * Conforms to the "Debug Port Specification", Version 1.00, 2/9/2000
+ *
  ******************************************************************************/
 
-typedef struct acpi_table_erst
+typedef struct acpi_table_dbgp
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT32                  HeaderLength;
-    UINT32                  Reserved;
-    UINT32                  Entries;
+    UINT8                   Type;               /* 0=full 16550, 1=subset of 16550 */
+    UINT8                   Reserved[3];
+    ACPI_GENERIC_ADDRESS    DebugPort;
 
-} ACPI_TABLE_ERST;
+} ACPI_TABLE_DBGP;
 
 
-/* ERST Serialization Entries (actions) */
+/*******************************************************************************
+ *
+ * DMAR - DMA Remapping table
+ *        Version 1
+ *
+ * Conforms to "Intel Virtualization Technology for Directed I/O",
+ * Version 2.3, October 2014
+ *
+ ******************************************************************************/
 
-typedef struct acpi_erst_entry
+typedef struct acpi_table_dmar
 {
-    ACPI_WHEA_HEADER        WheaHeader;         /* Common header for WHEA tables */
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    UINT8                   Width;              /* Host Address Width */
+    UINT8                   Flags;
+    UINT8                   Reserved[10];
 
-} ACPI_ERST_ENTRY;
+} ACPI_TABLE_DMAR;
 
 /* Masks for Flags field above */
 
-#define ACPI_ERST_PRESERVE          (1)
+#define ACPI_DMAR_INTR_REMAP        (1)
+#define ACPI_DMAR_X2APIC_OPT_OUT    (1<<1)
+#define ACPI_DMAR_X2APIC_MODE       (1<<2)
 
-/* Values for Action field above */
 
-enum AcpiErstActions
+/* DMAR subtable header */
+
+typedef struct acpi_dmar_header
 {
-    ACPI_ERST_BEGIN_WRITE           = 0,
-    ACPI_ERST_BEGIN_READ            = 1,
-    ACPI_ERST_BEGIN_CLEAR           = 2,
-    ACPI_ERST_END                   = 3,
-    ACPI_ERST_SET_RECORD_OFFSET     = 4,
-    ACPI_ERST_EXECUTE_OPERATION     = 5,
-    ACPI_ERST_CHECK_BUSY_STATUS     = 6,
-    ACPI_ERST_GET_COMMAND_STATUS    = 7,
-    ACPI_ERST_GET_RECORD_ID         = 8,
-    ACPI_ERST_SET_RECORD_ID         = 9,
-    ACPI_ERST_GET_RECORD_COUNT      = 10,
-    ACPI_ERST_BEGIN_DUMMY_WRIITE    = 11,
-    ACPI_ERST_NOT_USED              = 12,
-    ACPI_ERST_GET_ERROR_RANGE       = 13,
-    ACPI_ERST_GET_ERROR_LENGTH      = 14,
-    ACPI_ERST_GET_ERROR_ATTRIBUTES  = 15,
-    ACPI_ERST_EXECUTE_TIMINGS       = 16,
-    ACPI_ERST_ACTION_RESERVED       = 17    /* 17 and greater are reserved */
-};
+    UINT16                  Type;
+    UINT16                  Length;
 
-/* Values for Instruction field above */
+} ACPI_DMAR_HEADER;
 
-enum AcpiErstInstructions
-{
-    ACPI_ERST_READ_REGISTER         = 0,
-    ACPI_ERST_READ_REGISTER_VALUE   = 1,
-    ACPI_ERST_WRITE_REGISTER        = 2,
-    ACPI_ERST_WRITE_REGISTER_VALUE  = 3,
-    ACPI_ERST_NOOP                  = 4,
-    ACPI_ERST_LOAD_VAR1             = 5,
-    ACPI_ERST_LOAD_VAR2             = 6,
-    ACPI_ERST_STORE_VAR1            = 7,
-    ACPI_ERST_ADD                   = 8,
-    ACPI_ERST_SUBTRACT              = 9,
-    ACPI_ERST_ADD_VALUE             = 10,
-    ACPI_ERST_SUBTRACT_VALUE        = 11,
-    ACPI_ERST_STALL                 = 12,
-    ACPI_ERST_STALL_WHILE_TRUE      = 13,
-    ACPI_ERST_SKIP_NEXT_IF_TRUE     = 14,
-    ACPI_ERST_GOTO                  = 15,
-    ACPI_ERST_SET_SRC_ADDRESS_BASE  = 16,
-    ACPI_ERST_SET_DST_ADDRESS_BASE  = 17,
-    ACPI_ERST_MOVE_DATA             = 18,
-    ACPI_ERST_INSTRUCTION_RESERVED  = 19    /* 19 and greater are reserved */
-};
-
-/* Command status return values */
+/* Values for subtable type in ACPI_DMAR_HEADER */
 
-enum AcpiErstCommandStatus
+enum AcpiDmarType
 {
-    ACPI_ERST_SUCESS                = 0,
-    ACPI_ERST_NO_SPACE              = 1,
-    ACPI_ERST_NOT_AVAILABLE         = 2,
-    ACPI_ERST_FAILURE               = 3,
-    ACPI_ERST_RECORD_EMPTY          = 4,
-    ACPI_ERST_NOT_FOUND             = 5,
-    ACPI_ERST_STATUS_RESERVED       = 6     /* 6 and greater are reserved */
+    ACPI_DMAR_TYPE_HARDWARE_UNIT        = 0,
+    ACPI_DMAR_TYPE_RESERVED_MEMORY      = 1,
+    ACPI_DMAR_TYPE_ROOT_ATS             = 2,
+    ACPI_DMAR_TYPE_HARDWARE_AFFINITY    = 3,
+    ACPI_DMAR_TYPE_NAMESPACE            = 4,
+    ACPI_DMAR_TYPE_RESERVED             = 5     /* 5 and greater are reserved */
 };
 
 
-/* Error Record Serialization Information */
+/* DMAR Device Scope structure */
 
-typedef struct acpi_erst_info
+typedef struct acpi_dmar_device_scope
 {
-    UINT16                  Signature;          /* Should be "ER" */
-    UINT8                   Data[48];
-
-} ACPI_ERST_INFO;
+    UINT8                   EntryType;
+    UINT8                   Length;
+    UINT16                  Reserved;
+    UINT8                   EnumerationId;
+    UINT8                   Bus;
 
+} ACPI_DMAR_DEVICE_SCOPE;
 
-/*******************************************************************************
- *
- * HEST - Hardware Error Source Table (ACPI 4.0)
- *        Version 1
- *
- ******************************************************************************/
+/* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE - device types */
 
-typedef struct acpi_table_hest
+enum AcpiDmarScopeType
 {
-    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT32                  ErrorSourceCount;
-
-} ACPI_TABLE_HEST;
-
-
-/* HEST subtable header */
+    ACPI_DMAR_SCOPE_TYPE_NOT_USED       = 0,
+    ACPI_DMAR_SCOPE_TYPE_ENDPOINT       = 1,
+    ACPI_DMAR_SCOPE_TYPE_BRIDGE         = 2,
+    ACPI_DMAR_SCOPE_TYPE_IOAPIC         = 3,
+    ACPI_DMAR_SCOPE_TYPE_HPET           = 4,
+    ACPI_DMAR_SCOPE_TYPE_NAMESPACE      = 5,
+    ACPI_DMAR_SCOPE_TYPE_RESERVED       = 6     /* 6 and greater are reserved */
+};
 
-typedef struct acpi_hest_header
+typedef struct acpi_dmar_pci_path
 {
-    UINT16                  Type;
-    UINT16                  SourceId;
-
-} ACPI_HEST_HEADER;
+    UINT8                   Device;
+    UINT8                   Function;
 
-
-/* Values for Type field above for subtables */
-
-enum AcpiHestTypes
-{
-    ACPI_HEST_TYPE_IA32_CHECK           = 0,
-    ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1,
-    ACPI_HEST_TYPE_IA32_NMI             = 2,
-    ACPI_HEST_TYPE_NOT_USED3            = 3,
-    ACPI_HEST_TYPE_NOT_USED4            = 4,
-    ACPI_HEST_TYPE_NOT_USED5            = 5,
-    ACPI_HEST_TYPE_AER_ROOT_PORT        = 6,
-    ACPI_HEST_TYPE_AER_ENDPOINT         = 7,
-    ACPI_HEST_TYPE_AER_BRIDGE           = 8,
-    ACPI_HEST_TYPE_GENERIC_ERROR        = 9,
-    ACPI_HEST_TYPE_GENERIC_ERROR_V2     = 10,
-    ACPI_HEST_TYPE_IA32_DEFERRED_CHECK  = 11,
-    ACPI_HEST_TYPE_RESERVED             = 12    /* 12 and greater are reserved */
-};
+} ACPI_DMAR_PCI_PATH;
 
 
 /*
- * HEST substructures contained in subtables
+ * DMAR Subtables, correspond to Type in ACPI_DMAR_HEADER
  */
 
-/*
- * IA32 Error Bank(s) - Follows the ACPI_HEST_IA_MACHINE_CHECK and
- * ACPI_HEST_IA_CORRECTED structures.
- */
-typedef struct acpi_hest_ia_error_bank
-{
-    UINT8                   BankNumber;
-    UINT8                   ClearStatusOnInit;
-    UINT8                   StatusFormat;
-    UINT8                   Reserved;
-    UINT32                  ControlRegister;
-    UINT64                  ControlData;
-    UINT32                  StatusRegister;
-    UINT32                  AddressRegister;
-    UINT32                  MiscRegister;
-
-} ACPI_HEST_IA_ERROR_BANK;
-
-
-/* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
+/* 0: Hardware Unit Definition */
 
-typedef struct acpi_hest_aer_common
+typedef struct acpi_dmar_hardware_unit
 {
-    UINT16                  Reserved1;
+    ACPI_DMAR_HEADER        Header;
     UINT8                   Flags;
-    UINT8                   Enabled;
-    UINT32                  RecordsToPreallocate;
-    UINT32                  MaxSectionsPerRecord;
-    UINT32                  Bus;                    /* Bus and Segment numbers */
-    UINT16                  Device;
-    UINT16                  Function;
-    UINT16                  DeviceControl;
-    UINT16                  Reserved2;
-    UINT32                  UncorrectableMask;
-    UINT32                  UncorrectableSeverity;
-    UINT32                  CorrectableMask;
-    UINT32                  AdvancedCapabilities;
-
-} ACPI_HEST_AER_COMMON;
-
-/* Masks for HEST Flags fields */
-
-#define ACPI_HEST_FIRMWARE_FIRST        (1)
-#define ACPI_HEST_GLOBAL                (1<<1)
-#define ACPI_HEST_GHES_ASSIST           (1<<2)
-
-/*
- * Macros to access the bus/segment numbers in Bus field above:
- *  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)
+    UINT8                   Reserved;
+    UINT16                  Segment;
+    UINT64                  Address;            /* Register Base Address */
 
+} ACPI_DMAR_HARDWARE_UNIT;
 
-/* Hardware Error Notification */
+/* Masks for Flags field above */
 
-typedef struct acpi_hest_notify
-{
-    UINT8                   Type;
-    UINT8                   Length;
-    UINT16                  ConfigWriteEnable;
-    UINT32                  PollInterval;
-    UINT32                  Vector;
-    UINT32                  PollingThresholdValue;
-    UINT32                  PollingThresholdWindow;
-    UINT32                  ErrorThresholdValue;
-    UINT32                  ErrorThresholdWindow;
+#define ACPI_DMAR_INCLUDE_ALL       (1)
 
-} ACPI_HEST_NOTIFY;
 
-/* Values for Notify Type field above */
+/* 1: Reserved Memory Defininition */
 
-enum AcpiHestNotifyTypes
+typedef struct acpi_dmar_reserved_memory
 {
-    ACPI_HEST_NOTIFY_POLLED             = 0,
-    ACPI_HEST_NOTIFY_EXTERNAL           = 1,
-    ACPI_HEST_NOTIFY_LOCAL              = 2,
-    ACPI_HEST_NOTIFY_SCI                = 3,
-    ACPI_HEST_NOTIFY_NMI                = 4,
-    ACPI_HEST_NOTIFY_CMCI               = 5,    /* ACPI 5.0 */
-    ACPI_HEST_NOTIFY_MCE                = 6,    /* ACPI 5.0 */
-    ACPI_HEST_NOTIFY_GPIO               = 7,    /* ACPI 6.0 */
-    ACPI_HEST_NOTIFY_SEA                = 8,    /* ACPI 6.1 */
-    ACPI_HEST_NOTIFY_SEI                = 9,    /* ACPI 6.1 */
-    ACPI_HEST_NOTIFY_GSIV               = 10,   /* ACPI 6.1 */
-    ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED = 11,   /* ACPI 6.2 */
-    ACPI_HEST_NOTIFY_RESERVED           = 12    /* 12 and greater are reserved */
-};
+    ACPI_DMAR_HEADER        Header;
+    UINT16                  Reserved;
+    UINT16                  Segment;
+    UINT64                  BaseAddress;        /* 4K aligned base address */
+    UINT64                  EndAddress;         /* 4K aligned limit address */
 
-/* Values for ConfigWriteEnable bitfield above */
+} ACPI_DMAR_RESERVED_MEMORY;
 
-#define ACPI_HEST_TYPE                  (1)
-#define ACPI_HEST_POLL_INTERVAL         (1<<1)
-#define ACPI_HEST_POLL_THRESHOLD_VALUE  (1<<2)
-#define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
-#define ACPI_HEST_ERR_THRESHOLD_VALUE   (1<<4)
-#define ACPI_HEST_ERR_THRESHOLD_WINDOW  (1<<5)
+/* Masks for Flags field above */
 
+#define ACPI_DMAR_ALLOW_ALL         (1)
 
-/*
- * HEST subtables
- */
 
-/* 0: IA32 Machine Check Exception */
+/* 2: Root Port ATS Capability Reporting Structure */
 
-typedef struct acpi_hest_ia_machine_check
+typedef struct acpi_dmar_atsr
 {
-    ACPI_HEST_HEADER        Header;
-    UINT16                  Reserved1;
-    UINT8                   Flags;              /* See flags ACPI_HEST_GLOBAL, etc. above */
-    UINT8                   Enabled;
-    UINT32                  RecordsToPreallocate;
-    UINT32                  MaxSectionsPerRecord;
-    UINT64                  GlobalCapabilityData;
-    UINT64                  GlobalControlData;
-    UINT8                   NumHardwareBanks;
-    UINT8                   Reserved3[7];
-
-} ACPI_HEST_IA_MACHINE_CHECK;
-
+    ACPI_DMAR_HEADER        Header;
+    UINT8                   Flags;
+    UINT8                   Reserved;
+    UINT16                  Segment;
 
-/* 1: IA32 Corrected Machine Check */
+} ACPI_DMAR_ATSR;
 
-typedef struct acpi_hest_ia_corrected
-{
-    ACPI_HEST_HEADER        Header;
-    UINT16                  Reserved1;
-    UINT8                   Flags;              /* See flags ACPI_HEST_GLOBAL, etc. above */
-    UINT8                   Enabled;
-    UINT32                  RecordsToPreallocate;
-    UINT32                  MaxSectionsPerRecord;
-    ACPI_HEST_NOTIFY        Notify;
-    UINT8                   NumHardwareBanks;
-    UINT8                   Reserved2[3];
+/* Masks for Flags field above */
 
-} ACPI_HEST_IA_CORRECTED;
+#define ACPI_DMAR_ALL_PORTS         (1)
 
 
-/* 2: IA32 Non-Maskable Interrupt */
+/* 3: Remapping Hardware Static Affinity Structure */
 
-typedef struct acpi_hest_ia_nmi
+typedef struct acpi_dmar_rhsa
 {
-    ACPI_HEST_HEADER        Header;
+    ACPI_DMAR_HEADER        Header;
     UINT32                  Reserved;
-    UINT32                  RecordsToPreallocate;
-    UINT32                  MaxSectionsPerRecord;
-    UINT32                  MaxRawDataLength;
+    UINT64                  BaseAddress;
+    UINT32                  ProximityDomain;
 
-} ACPI_HEST_IA_NMI;
+} ACPI_DMAR_RHSA;
 
 
-/* 3,4,5: Not used */
+/* 4: ACPI Namespace Device Declaration Structure */
 
-/* 6: PCI Express Root Port AER */
-
-typedef struct acpi_hest_aer_root
+typedef struct acpi_dmar_andd
 {
-    ACPI_HEST_HEADER        Header;
-    ACPI_HEST_AER_COMMON    Aer;
-    UINT32                  RootErrorCommand;
+    ACPI_DMAR_HEADER        Header;
+    UINT8                   Reserved[3];
+    UINT8                   DeviceNumber;
+    char                    DeviceName[1];
 
-} ACPI_HEST_AER_ROOT;
+} ACPI_DMAR_ANDD;
 
 
-/* 7: PCI Express AER (AER Endpoint) */
+/*******************************************************************************
+ *
+ * DRTM - Dynamic Root of Trust for Measurement table
+ * Conforms to "TCG D-RTM Architecture" June 17 2013, Version 1.0.0
+ * Table version 1
+ *
+ ******************************************************************************/
 
-typedef struct acpi_hest_aer
+typedef struct acpi_table_drtm
 {
-    ACPI_HEST_HEADER        Header;
-    ACPI_HEST_AER_COMMON    Aer;
-
-} ACPI_HEST_AER;
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    UINT64                  EntryBaseAddress;
+    UINT64                  EntryLength;
+    UINT32                  EntryAddress32;
+    UINT64                  EntryAddress64;
+    UINT64                  ExitAddress;
+    UINT64                  LogAreaAddress;
+    UINT32                  LogAreaLength;
+    UINT64                  ArchDependentAddress;
+    UINT32                  Flags;
 
+} ACPI_TABLE_DRTM;
 
-/* 8: PCI Express/PCI-X Bridge AER */
-
-typedef struct acpi_hest_aer_bridge
-{
-    ACPI_HEST_HEADER        Header;
-    ACPI_HEST_AER_COMMON    Aer;
-    UINT32                  UncorrectableMask2;
-    UINT32                  UncorrectableSeverity2;
-    UINT32                  AdvancedCapabilities2;
+/* Flag Definitions for above */
 
-} ACPI_HEST_AER_BRIDGE;
+#define ACPI_DRTM_ACCESS_ALLOWED            (1)
+#define ACPI_DRTM_ENABLE_GAP_CODE           (1<<1)
+#define ACPI_DRTM_INCOMPLETE_MEASUREMENTS   (1<<2)
+#define ACPI_DRTM_AUTHORITY_ORDER           (1<<3)
 
 
-/* 9: Generic Hardware Error Source */
+/* 1) Validated Tables List (64-bit addresses) */
 
-typedef struct acpi_hest_generic
+typedef struct acpi_drtm_vtable_list
 {
-    ACPI_HEST_HEADER        Header;
-    UINT16                  RelatedSourceId;
-    UINT8                   Reserved;
-    UINT8                   Enabled;
-    UINT32                  RecordsToPreallocate;
-    UINT32                  MaxSectionsPerRecord;
-    UINT32                  MaxRawDataLength;
-    ACPI_GENERIC_ADDRESS    ErrorStatusAddress;
-    ACPI_HEST_NOTIFY        Notify;
-    UINT32                  ErrorBlockLength;
+    UINT32                  ValidatedTableCount;
+    UINT64                  ValidatedTables[1];
 
-} ACPI_HEST_GENERIC;
+} ACPI_DRTM_VTABLE_LIST;
 
+/* 2) Resources List (of Resource Descriptors) */
 
-/* 10: Generic Hardware Error Source, version 2 */
+/* Resource Descriptor */
 
-typedef struct acpi_hest_generic_v2
+typedef struct acpi_drtm_resource
 {
-    ACPI_HEST_HEADER        Header;
-    UINT16                  RelatedSourceId;
-    UINT8                   Reserved;
-    UINT8                   Enabled;
-    UINT32                  RecordsToPreallocate;
-    UINT32                  MaxSectionsPerRecord;
-    UINT32                  MaxRawDataLength;
-    ACPI_GENERIC_ADDRESS    ErrorStatusAddress;
-    ACPI_HEST_NOTIFY        Notify;
-    UINT32                  ErrorBlockLength;
-    ACPI_GENERIC_ADDRESS    ReadAckRegister;
-    UINT64                  ReadAckPreserve;
-    UINT64                  ReadAckWrite;
-
-} ACPI_HEST_GENERIC_V2;
-
-
-/* Generic Error Status block */
-
-typedef struct acpi_hest_generic_status
-{
-    UINT32                  BlockStatus;
-    UINT32                  RawDataOffset;
-    UINT32                  RawDataLength;
-    UINT32                  DataLength;
-    UINT32                  ErrorSeverity;
-
-} ACPI_HEST_GENERIC_STATUS;
-
-/* Values for BlockStatus flags above */
-
-#define ACPI_HEST_UNCORRECTABLE             (1)
-#define ACPI_HEST_CORRECTABLE               (1<<1)
-#define ACPI_HEST_MULTIPLE_UNCORRECTABLE    (1<<2)
-#define ACPI_HEST_MULTIPLE_CORRECTABLE      (1<<3)
-#define ACPI_HEST_ERROR_ENTRY_COUNT         (0xFF<<4) /* 8 bits, error count */
+    UINT8                   Size[7];
+    UINT8                   Type;
+    UINT64                  Address;
 
+} ACPI_DRTM_RESOURCE;
 
-/* Generic Error Data entry */
-
-typedef struct acpi_hest_generic_data
+typedef struct acpi_drtm_resource_list
 {
-    UINT8                   SectionType[16];
-    UINT32                  ErrorSeverity;
-    UINT16                  Revision;
-    UINT8                   ValidationBits;
-    UINT8                   Flags;
-    UINT32                  ErrorDataLength;
-    UINT8                   FruId[16];
-    UINT8                   FruText[20];
+    UINT32                  ResourceCount;
+    ACPI_DRTM_RESOURCE      Resources[1];
 
-} ACPI_HEST_GENERIC_DATA;
+} ACPI_DRTM_RESOURCE_LIST;
 
-/* Extension for revision 0x0300 */
+/* 3) Platform-specific Identifiers List */
 
-typedef struct acpi_hest_generic_data_v300
+typedef struct acpi_drtm_dps_id
 {
-    UINT8                   SectionType[16];
-    UINT32                  ErrorSeverity;
-    UINT16                  Revision;
-    UINT8                   ValidationBits;
-    UINT8                   Flags;
-    UINT32                  ErrorDataLength;
-    UINT8                   FruId[16];
-    UINT8                   FruText[20];
-    UINT64                  TimeStamp;
+    UINT32                  DpsIdLength;
+    UINT8                   DpsId[16];
 
-} ACPI_HEST_GENERIC_DATA_V300;
+} ACPI_DRTM_DPS_ID;
 
-/* Values for ErrorSeverity above */
 
-#define ACPI_HEST_GEN_ERROR_RECOVERABLE     0
-#define ACPI_HEST_GEN_ERROR_FATAL           1
-#define ACPI_HEST_GEN_ERROR_CORRECTED       2
-#define ACPI_HEST_GEN_ERROR_NONE            3
-
-/* Flags for ValidationBits above */
-
-#define ACPI_HEST_GEN_VALID_FRU_ID          (1)
-#define ACPI_HEST_GEN_VALID_FRU_STRING      (1<<1)
-#define ACPI_HEST_GEN_VALID_TIMESTAMP       (1<<2)
-
-
-/* 11: IA32 Deferred Machine Check Exception (ACPI 6.2) */
+/*******************************************************************************
+ *
+ * ECDT - Embedded Controller Boot Resources Table
+ *        Version 1
+ *
+ ******************************************************************************/
 
-typedef struct acpi_hest_ia_deferred_check
+typedef struct acpi_table_ecdt
 {
-    ACPI_HEST_HEADER        Header;
-    UINT16                  Reserved1;
-    UINT8                   Flags;              /* See flags ACPI_HEST_GLOBAL, etc. above */
-    UINT8                   Enabled;
-    UINT32                  RecordsToPreallocate;
-    UINT32                  MaxSectionsPerRecord;
-    ACPI_HEST_NOTIFY        Notify;
-    UINT8                   NumHardwareBanks;
-    UINT8                   Reserved2[3];
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    ACPI_GENERIC_ADDRESS    Control;            /* Address of EC command/status register */
+    ACPI_GENERIC_ADDRESS    Data;               /* Address of EC data register */
+    UINT32                  Uid;                /* Unique ID - must be same as the EC _UID method */
+    UINT8                   Gpe;                /* The GPE for the EC */
+    UINT8                   Id[1];              /* Full namepath of the EC in the ACPI namespace */
 
-} ACPI_HEST_IA_DEFERRED_CHECK;
+} ACPI_TABLE_ECDT;
 
 
 /*******************************************************************************
  *
- * HMAT - Heterogeneous Memory Attributes Table (ACPI 6.2)
+ * EINJ - Error Injection Table (ACPI 4.0)
  *        Version 1
  *
  ******************************************************************************/
 
-typedef struct acpi_table_hmat
+typedef struct acpi_table_einj
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT32                  Reserved;
+    UINT32                  HeaderLength;
+    UINT8                   Flags;
+    UINT8                   Reserved[3];
+    UINT32                  Entries;
 
-} ACPI_TABLE_HMAT;
+} ACPI_TABLE_EINJ;
 
 
-/* Values for HMAT structure types */
-
-enum AcpiHmatType
-{
-    ACPI_HMAT_TYPE_ADDRESS_RANGE        = 0,   /* Memory subystem address range */
-    ACPI_HMAT_TYPE_LOCALITY             = 1,   /* System locality latency and bandwidth information */
-    ACPI_HMAT_TYPE_CACHE                = 2,   /* Memory side cache information */
-    ACPI_HMAT_TYPE_RESERVED             = 3    /* 3 and greater are reserved */
-};
+/* EINJ Injection Instruction Entries (actions) */
 
-typedef struct acpi_hmat_structure
+typedef struct acpi_einj_entry
 {
-    UINT16                  Type;
-    UINT16                  Reserved;
-    UINT32                  Length;
+    ACPI_WHEA_HEADER        WheaHeader;         /* Common header for WHEA tables */
 
-} ACPI_HMAT_STRUCTURE;
+} ACPI_EINJ_ENTRY;
 
+/* Masks for Flags field above */
 
-/*
- * HMAT Structures, correspond to Type in ACPI_HMAT_STRUCTURE
- */
+#define ACPI_EINJ_PRESERVE          (1)
 
-/* 0: Memory subystem address range */
+/* Values for Action field above */
 
-typedef struct acpi_hmat_address_range
+enum AcpiEinjActions
 {
-    ACPI_HMAT_STRUCTURE     Header;
-    UINT16                  Flags;
-    UINT16                  Reserved1;
-    UINT32                  ProcessorPD;            /* Processor proximity domain */
-    UINT32                  MemoryPD;               /* Memory proximity domain */
-    UINT32                  Reserved2;
-    UINT64                  PhysicalAddressBase;    /* Physical address range base */
-    UINT64                  PhysicalAddressLength;  /* Physical address range length */
-
-} ACPI_HMAT_ADDRESS_RANGE;
-
-/* Masks for Flags field above */
-
-#define ACPI_HMAT_PROCESSOR_PD_VALID    (1)     /* 1: ProcessorPD field is valid */
-#define ACPI_HMAT_MEMORY_PD_VALID       (1<<1)  /* 1: MemoryPD field is valid */
-#define ACPI_HMAT_RESERVATION_HINT      (1<<2)  /* 1: Reservation hint */
-
+    ACPI_EINJ_BEGIN_OPERATION               = 0,
+    ACPI_EINJ_GET_TRIGGER_TABLE             = 1,
+    ACPI_EINJ_SET_ERROR_TYPE                = 2,
+    ACPI_EINJ_GET_ERROR_TYPE                = 3,
+    ACPI_EINJ_END_OPERATION                 = 4,
+    ACPI_EINJ_EXECUTE_OPERATION             = 5,
+    ACPI_EINJ_CHECK_BUSY_STATUS             = 6,
+    ACPI_EINJ_GET_COMMAND_STATUS            = 7,
+    ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS   = 8,
+    ACPI_EINJ_GET_EXECUTE_TIMINGS           = 9,
+    ACPI_EINJ_ACTION_RESERVED               = 10,    /* 10 and greater are reserved */
+    ACPI_EINJ_TRIGGER_ERROR                 = 0xFF   /* Except for this value */
+};
 
-/* 1: System locality latency and bandwidth information */
+/* Values for Instruction field above */
 
-typedef struct acpi_hmat_locality
+enum AcpiEinjInstructions
 {
-    ACPI_HMAT_STRUCTURE     Header;
-    UINT8                   Flags;
-    UINT8                   DataType;
-    UINT16                  Reserved1;
-    UINT32                  NumberOfInitiatorPDs;
-    UINT32                  NumberOfTargetPDs;
-    UINT32                  Reserved2;
-    UINT64                  EntryBaseUnit;
-
-} ACPI_HMAT_LOCALITY;
-
-/* Masks for Flags field above */
-
-#define ACPI_HMAT_MEMORY_HIERARCHY  (0x0F)
+    ACPI_EINJ_READ_REGISTER         = 0,
+    ACPI_EINJ_READ_REGISTER_VALUE   = 1,
+    ACPI_EINJ_WRITE_REGISTER        = 2,
+    ACPI_EINJ_WRITE_REGISTER_VALUE  = 3,
+    ACPI_EINJ_NOOP                  = 4,
+    ACPI_EINJ_FLUSH_CACHELINE       = 5,
+    ACPI_EINJ_INSTRUCTION_RESERVED  = 6     /* 6 and greater are reserved */
+};
 
-/* Values for Memory Hierarchy flag */
+typedef struct acpi_einj_error_type_with_addr
+{
+    UINT32                  ErrorType;
+    UINT32                  VendorStructOffset;
+    UINT32                  Flags;
+    UINT32                  ApicId;
+    UINT64                  Address;
+    UINT64                  Range;
+    UINT32                  PcieId;
 
-#define ACPI_HMAT_MEMORY            0
-#define ACPI_HMAT_LAST_LEVEL_CACHE  1
-#define ACPI_HMAT_1ST_LEVEL_CACHE   2
-#define ACPI_HMAT_2ND_LEVEL_CACHE   3
-#define ACPI_HMAT_3RD_LEVEL_CACHE   4
+} ACPI_EINJ_ERROR_TYPE_WITH_ADDR;
 
-/* Values for DataType field above */
+typedef struct acpi_einj_vendor
+{
+    UINT32                  Length;
+    UINT32                  PcieId;
+    UINT16                  VendorId;
+    UINT16                  DeviceId;
+    UINT8                   RevisionId;
+    UINT8                   Reserved[3];
 
-#define ACPI_HMAT_ACCESS_LATENCY    0
-#define ACPI_HMAT_READ_LATENCY      1
-#define ACPI_HMAT_WRITE_LATENCY     2
-#define ACPI_HMAT_ACCESS_BANDWIDTH  3
-#define ACPI_HMAT_READ_BANDWIDTH    4
-#define ACPI_HMAT_WRITE_BANDWIDTH   5
+} ACPI_EINJ_VENDOR;
 
 
-/* 2: Memory side cache information */
+/* EINJ Trigger Error Action Table */
 
-typedef struct acpi_hmat_cache
+typedef struct acpi_einj_trigger
 {
-    ACPI_HMAT_STRUCTURE     Header;
-    UINT32                  MemoryPD;
-    UINT32                  Reserved1;
-    UINT64                  CacheSize;
-    UINT32                  CacheAttributes;
-    UINT16                  Reserved2;
-    UINT16                  NumberOfSMBIOSHandles;
-
-} ACPI_HMAT_CACHE;
+    UINT32                  HeaderSize;
+    UINT32                  Revision;
+    UINT32                  TableSize;
+    UINT32                  EntryCount;
 
-/* Masks for CacheAttributes field above */
+} ACPI_EINJ_TRIGGER;
 
-#define ACPI_HMAT_TOTAL_CACHE_LEVEL     (0x0000000F)
-#define ACPI_HMAT_CACHE_LEVEL           (0x000000F0)
-#define ACPI_HMAT_CACHE_ASSOCIATIVITY   (0x00000F00)
-#define ACPI_HMAT_WRITE_POLICY          (0x0000F000)
-#define ACPI_HMAT_CACHE_LINE_SIZE       (0xFFFF0000)
+/* Command status return values */
 
-/* Values for cache associativity flag */
+enum AcpiEinjCommandStatus
+{
+    ACPI_EINJ_SUCCESS               = 0,
+    ACPI_EINJ_FAILURE               = 1,
+    ACPI_EINJ_INVALID_ACCESS        = 2,
+    ACPI_EINJ_STATUS_RESERVED       = 3     /* 3 and greater are reserved */
+};
 
-#define ACPI_HMAT_CA_NONE                     (0)
-#define ACPI_HMAT_CA_DIRECT_MAPPED            (1)
-#define ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING   (2)
 
-/* Values for write policy flag */
+/* Error types returned from ACPI_EINJ_GET_ERROR_TYPE (bitfield) */
 
-#define ACPI_HMAT_CP_NONE   (0)
-#define ACPI_HMAT_CP_WB     (1)
-#define ACPI_HMAT_CP_WT     (2)
+#define ACPI_EINJ_PROCESSOR_CORRECTABLE     (1)
+#define ACPI_EINJ_PROCESSOR_UNCORRECTABLE   (1<<1)
+#define ACPI_EINJ_PROCESSOR_FATAL           (1<<2)
+#define ACPI_EINJ_MEMORY_CORRECTABLE        (1<<3)
+#define ACPI_EINJ_MEMORY_UNCORRECTABLE      (1<<4)
+#define ACPI_EINJ_MEMORY_FATAL              (1<<5)
+#define ACPI_EINJ_PCIX_CORRECTABLE          (1<<6)
+#define ACPI_EINJ_PCIX_UNCORRECTABLE        (1<<7)
+#define ACPI_EINJ_PCIX_FATAL                (1<<8)
+#define ACPI_EINJ_PLATFORM_CORRECTABLE      (1<<9)
+#define ACPI_EINJ_PLATFORM_UNCORRECTABLE    (1<<10)
+#define ACPI_EINJ_PLATFORM_FATAL            (1<<11)
+#define ACPI_EINJ_VENDOR_DEFINED            (1<<31)
 
 
 /*******************************************************************************
  *
- * MADT - Multiple APIC Description Table
- *        Version 3
+ * ERST - Error Record Serialization Table (ACPI 4.0)
+ *        Version 1
  *
  ******************************************************************************/
 
-typedef struct acpi_table_madt
+typedef struct acpi_table_erst
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT32                  Address;            /* Physical address of local APIC */
-    UINT32                  Flags;
+    UINT32                  HeaderLength;
+    UINT32                  Reserved;
+    UINT32                  Entries;
+
+} ACPI_TABLE_ERST;
 
-} ACPI_TABLE_MADT;
 
-/* Masks for Flags field above */
+/* ERST Serialization Entries (actions) */
 
-#define ACPI_MADT_PCAT_COMPAT       (1)         /* 00: System also has dual 8259s */
+typedef struct acpi_erst_entry
+{
+    ACPI_WHEA_HEADER        WheaHeader;         /* Common header for WHEA tables */
 
-/* Values for PCATCompat flag */
+} ACPI_ERST_ENTRY;
 
-#define ACPI_MADT_DUAL_PIC          1
-#define ACPI_MADT_MULTIPLE_APIC     0
+/* Masks for Flags field above */
 
+#define ACPI_ERST_PRESERVE          (1)
 
-/* Values for MADT subtable type in ACPI_SUBTABLE_HEADER */
+/* Values for Action field above */
 
-enum AcpiMadtType
+enum AcpiErstActions
 {
-    ACPI_MADT_TYPE_LOCAL_APIC               = 0,
-    ACPI_MADT_TYPE_IO_APIC                  = 1,
-    ACPI_MADT_TYPE_INTERRUPT_OVERRIDE       = 2,
-    ACPI_MADT_TYPE_NMI_SOURCE               = 3,
-    ACPI_MADT_TYPE_LOCAL_APIC_NMI           = 4,
-    ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE      = 5,
-    ACPI_MADT_TYPE_IO_SAPIC                 = 6,
-    ACPI_MADT_TYPE_LOCAL_SAPIC              = 7,
-    ACPI_MADT_TYPE_INTERRUPT_SOURCE         = 8,
-    ACPI_MADT_TYPE_LOCAL_X2APIC             = 9,
-    ACPI_MADT_TYPE_LOCAL_X2APIC_NMI         = 10,
-    ACPI_MADT_TYPE_GENERIC_INTERRUPT        = 11,
-    ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR      = 12,
-    ACPI_MADT_TYPE_GENERIC_MSI_FRAME        = 13,
-    ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR    = 14,
-    ACPI_MADT_TYPE_GENERIC_TRANSLATOR       = 15,
-    ACPI_MADT_TYPE_RESERVED                 = 16    /* 16 and greater are reserved */
+    ACPI_ERST_BEGIN_WRITE           = 0,
+    ACPI_ERST_BEGIN_READ            = 1,
+    ACPI_ERST_BEGIN_CLEAR           = 2,
+    ACPI_ERST_END                   = 3,
+    ACPI_ERST_SET_RECORD_OFFSET     = 4,
+    ACPI_ERST_EXECUTE_OPERATION     = 5,
+    ACPI_ERST_CHECK_BUSY_STATUS     = 6,
+    ACPI_ERST_GET_COMMAND_STATUS    = 7,
+    ACPI_ERST_GET_RECORD_ID         = 8,
+    ACPI_ERST_SET_RECORD_ID         = 9,
+    ACPI_ERST_GET_RECORD_COUNT      = 10,
+    ACPI_ERST_BEGIN_DUMMY_WRIITE    = 11,
+    ACPI_ERST_NOT_USED              = 12,
+    ACPI_ERST_GET_ERROR_RANGE       = 13,
+    ACPI_ERST_GET_ERROR_LENGTH      = 14,
+    ACPI_ERST_GET_ERROR_ATTRIBUTES  = 15,
+    ACPI_ERST_EXECUTE_TIMINGS       = 16,
+    ACPI_ERST_ACTION_RESERVED       = 17    /* 17 and greater are reserved */
 };
 
+/* Values for Instruction field above */
 
-/*
- * MADT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
- */
-
-/* 0: Processor Local APIC */
-
-typedef struct acpi_madt_local_apic
+enum AcpiErstInstructions
 {
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT8                   ProcessorId;        /* ACPI processor id */
-    UINT8                   Id;                 /* Processor's local APIC id */
-    UINT32                  LapicFlags;
-
-} ACPI_MADT_LOCAL_APIC;
-
+    ACPI_ERST_READ_REGISTER         = 0,
+    ACPI_ERST_READ_REGISTER_VALUE   = 1,
+    ACPI_ERST_WRITE_REGISTER        = 2,
+    ACPI_ERST_WRITE_REGISTER_VALUE  = 3,
+    ACPI_ERST_NOOP                  = 4,
+    ACPI_ERST_LOAD_VAR1             = 5,
+    ACPI_ERST_LOAD_VAR2             = 6,
+    ACPI_ERST_STORE_VAR1            = 7,
+    ACPI_ERST_ADD                   = 8,
+    ACPI_ERST_SUBTRACT              = 9,
+    ACPI_ERST_ADD_VALUE             = 10,
+    ACPI_ERST_SUBTRACT_VALUE        = 11,
+    ACPI_ERST_STALL                 = 12,
+    ACPI_ERST_STALL_WHILE_TRUE      = 13,
+    ACPI_ERST_SKIP_NEXT_IF_TRUE     = 14,
+    ACPI_ERST_GOTO                  = 15,
+    ACPI_ERST_SET_SRC_ADDRESS_BASE  = 16,
+    ACPI_ERST_SET_DST_ADDRESS_BASE  = 17,
+    ACPI_ERST_MOVE_DATA             = 18,
+    ACPI_ERST_INSTRUCTION_RESERVED  = 19    /* 19 and greater are reserved */
+};
 
-/* 1: IO APIC */
+/* Command status return values */
 
-typedef struct acpi_madt_io_apic
+enum AcpiErstCommandStatus
 {
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT8                   Id;                 /* I/O APIC ID */
-    UINT8                   Reserved;           /* Reserved - must be zero */
-    UINT32                  Address;            /* APIC physical address */
-    UINT32                  GlobalIrqBase;      /* Global system interrupt where INTI lines start */
-
-} ACPI_MADT_IO_APIC;
+    ACPI_ERST_SUCESS                = 0,
+    ACPI_ERST_NO_SPACE              = 1,
+    ACPI_ERST_NOT_AVAILABLE         = 2,
+    ACPI_ERST_FAILURE               = 3,
+    ACPI_ERST_RECORD_EMPTY          = 4,
+    ACPI_ERST_NOT_FOUND             = 5,
+    ACPI_ERST_STATUS_RESERVED       = 6     /* 6 and greater are reserved */
+};
 
 
-/* 2: Interrupt Override */
+/* Error Record Serialization Information */
 
-typedef struct acpi_madt_interrupt_override
+typedef struct acpi_erst_info
 {
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT8                   Bus;                /* 0 - ISA */
-    UINT8                   SourceIrq;          /* Interrupt source (IRQ) */
-    UINT32                  GlobalIrq;          /* Global system interrupt */
-    UINT16                  IntiFlags;
+    UINT16                  Signature;          /* Should be "ER" */
+    UINT8                   Data[48];
 
-} ACPI_MADT_INTERRUPT_OVERRIDE;
+} ACPI_ERST_INFO;
 
 
-/* 3: NMI Source */
+/*******************************************************************************
+ *
+ * FPDT - Firmware Performance Data Table (ACPI 5.0)
+ *        Version 1
+ *
+ ******************************************************************************/
 
-typedef struct acpi_madt_nmi_source
+typedef struct acpi_table_fpdt
 {
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT16                  IntiFlags;
-    UINT32                  GlobalIrq;          /* Global system interrupt */
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
 
-} ACPI_MADT_NMI_SOURCE;
+} ACPI_TABLE_FPDT;
 
 
-/* 4: Local APIC NMI */
+/* FPDT subtable header (Performance Record Structure) */
 
-typedef struct acpi_madt_local_apic_nmi
+typedef struct acpi_fpdt_header
 {
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT8                   ProcessorId;        /* ACPI processor id */
-    UINT16                  IntiFlags;
-    UINT8                   Lint;               /* LINTn to which NMI is connected */
-
-} ACPI_MADT_LOCAL_APIC_NMI;
+    UINT16                  Type;
+    UINT8                   Length;
+    UINT8                   Revision;
 
+} ACPI_FPDT_HEADER;
 
-/* 5: Address Override */
+/* Values for Type field above */
 
-typedef struct acpi_madt_local_apic_override
+enum AcpiFpdtType
 {
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT16                  Reserved;           /* Reserved, must be zero */
-    UINT64                  Address;            /* APIC physical address */
+    ACPI_FPDT_TYPE_BOOT                 = 0,
+    ACPI_FPDT_TYPE_S3PERF               = 1
+};
 
-} ACPI_MADT_LOCAL_APIC_OVERRIDE;
 
+/*
+ * FPDT subtables
+ */
 
-/* 6: I/O Sapic */
+/* 0: Firmware Basic Boot Performance Record */
 
-typedef struct acpi_madt_io_sapic
+typedef struct acpi_fpdt_boot_pointer
 {
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT8                   Id;                 /* I/O SAPIC ID */
-    UINT8                   Reserved;           /* Reserved, must be zero */
-    UINT32                  GlobalIrqBase;      /* Global interrupt for SAPIC start */
-    UINT64                  Address;            /* SAPIC physical address */
+    ACPI_FPDT_HEADER        Header;
+    UINT8                   Reserved[4];
+    UINT64                  Address;
 
-} ACPI_MADT_IO_SAPIC;
+} ACPI_FPDT_BOOT_POINTER;
 
 
-/* 7: Local Sapic */
+/* 1: S3 Performance Table Pointer Record */
 
-typedef struct acpi_madt_local_sapic
+typedef struct acpi_fpdt_s3pt_pointer
 {
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT8                   ProcessorId;        /* ACPI processor id */
-    UINT8                   Id;                 /* SAPIC ID */
-    UINT8                   Eid;                /* SAPIC EID */
-    UINT8                   Reserved[3];        /* Reserved, must be zero */
-    UINT32                  LapicFlags;
-    UINT32                  Uid;                /* Numeric UID - ACPI 3.0 */
-    char                    UidString[1];       /* String UID  - ACPI 3.0 */
-
-} ACPI_MADT_LOCAL_SAPIC;
+    ACPI_FPDT_HEADER        Header;
+    UINT8                   Reserved[4];
+    UINT64                  Address;
 
+} ACPI_FPDT_S3PT_POINTER;
 
-/* 8: Platform Interrupt Source */
 
-typedef struct acpi_madt_interrupt_source
+/*
+ * S3PT - S3 Performance Table. This table is pointed to by the
+ * S3 Pointer Record above.
+ */
+typedef struct acpi_table_s3pt
 {
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT16                  IntiFlags;
-    UINT8                   Type;               /* 1=PMI, 2=INIT, 3=corrected */
-    UINT8                   Id;                 /* Processor ID */
-    UINT8                   Eid;                /* Processor EID */
-    UINT8                   IoSapicVector;      /* Vector value for PMI interrupts */
-    UINT32                  GlobalIrq;          /* Global system interrupt */
-    UINT32                  Flags;              /* Interrupt Source Flags */
-
-} ACPI_MADT_INTERRUPT_SOURCE;
+    UINT8                   Signature[4]; /* "S3PT" */
+    UINT32                  Length;
 
-/* Masks for Flags field above */
+} ACPI_TABLE_S3PT;
 
-#define ACPI_MADT_CPEI_OVERRIDE     (1)
 
+/*
+ * S3PT Subtables (Not part of the actual FPDT)
+ */
 
-/* 9: Processor Local X2APIC (ACPI 4.0) */
+/* Values for Type field in S3PT header */
 
-typedef struct acpi_madt_local_x2apic
+enum AcpiS3ptType
 {
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT16                  Reserved;           /* Reserved - must be zero */
-    UINT32                  LocalApicId;        /* Processor x2APIC ID  */
-    UINT32                  LapicFlags;
-    UINT32                  Uid;                /* ACPI processor UID */
-
-} ACPI_MADT_LOCAL_X2APIC;
+    ACPI_S3PT_TYPE_RESUME               = 0,
+    ACPI_S3PT_TYPE_SUSPEND              = 1,
+    ACPI_FPDT_BOOT_PERFORMANCE          = 2
+};
 
+typedef struct acpi_s3pt_resume
+{
+    ACPI_FPDT_HEADER        Header;
+    UINT32                  ResumeCount;
+    UINT64                  FullResume;
+    UINT64                  AverageResume;
 
-/* 10: Local X2APIC NMI (ACPI 4.0) */
+} ACPI_S3PT_RESUME;
 
-typedef struct acpi_madt_local_x2apic_nmi
+typedef struct acpi_s3pt_suspend
 {
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT16                  IntiFlags;
-    UINT32                  Uid;                /* ACPI processor UID */
-    UINT8                   Lint;               /* LINTn to which NMI is connected */
-    UINT8                   Reserved[3];        /* Reserved - must be zero */
+    ACPI_FPDT_HEADER        Header;
+    UINT64                  SuspendStart;
+    UINT64                  SuspendEnd;
 
-} ACPI_MADT_LOCAL_X2APIC_NMI;
+} ACPI_S3PT_SUSPEND;
 
 
-/* 11: Generic Interrupt (ACPI 5.0 + ACPI 6.0 changes) */
-
-typedef struct acpi_madt_generic_interrupt
+/*
+ * FPDT Boot Performance Record (Not part of the actual FPDT)
+ */
+typedef struct acpi_fpdt_boot
 {
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT16                  Reserved;           /* Reserved - must be zero */
-    UINT32                  CpuInterfaceNumber;
-    UINT32                  Uid;
-    UINT32                  Flags;
-    UINT32                  ParkingVersion;
-    UINT32                  PerformanceInterrupt;
-    UINT64                  ParkedAddress;
-    UINT64                  BaseAddress;
-    UINT64                  GicvBaseAddress;
-    UINT64                  GichBaseAddress;
-    UINT32                  VgicInterrupt;
-    UINT64                  GicrBaseAddress;
-    UINT64                  ArmMpidr;
-    UINT8                   EfficiencyClass;
-    UINT8                   Reserved2[3];
-
-} ACPI_MADT_GENERIC_INTERRUPT;
-
-/* Masks for Flags field above */
+    ACPI_FPDT_HEADER        Header;
+    UINT8                   Reserved[4];
+    UINT64                  ResetEnd;
+    UINT64                  LoadStart;
+    UINT64                  StartupStart;
+    UINT64                  ExitServicesEntry;
+    UINT64                  ExitServicesExit;
 
-/* ACPI_MADT_ENABLED                    (1)      Processor is usable if set */
-#define ACPI_MADT_PERFORMANCE_IRQ_MODE  (1<<1)  /* 01: Performance Interrupt Mode */
-#define ACPI_MADT_VGIC_IRQ_MODE         (1<<2)  /* 02: VGIC Maintenance Interrupt mode */
+} ACPI_FPDT_BOOT;
 
 
-/* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */
+/*******************************************************************************
+ *
+ * GTDT - Generic Timer Description Table (ACPI 5.1)
+ *        Version 2
+ *
+ ******************************************************************************/
 
-typedef struct acpi_madt_generic_distributor
+typedef struct acpi_table_gtdt
 {
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT16                  Reserved;           /* Reserved - must be zero */
-    UINT32                  GicId;
-    UINT64                  BaseAddress;
-    UINT32                  GlobalIrqBase;
-    UINT8                   Version;
-    UINT8                   Reserved2[3];       /* Reserved - must be zero */
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    UINT64                  CounterBlockAddresss;
+    UINT32                  Reserved;
+    UINT32                  SecureEl1Interrupt;
+    UINT32                  SecureEl1Flags;
+    UINT32                  NonSecureEl1Interrupt;
+    UINT32                  NonSecureEl1Flags;
+    UINT32                  VirtualTimerInterrupt;
+    UINT32                  VirtualTimerFlags;
+    UINT32                  NonSecureEl2Interrupt;
+    UINT32                  NonSecureEl2Flags;
+    UINT64                  CounterReadBlockAddress;
+    UINT32                  PlatformTimerCount;
+    UINT32                  PlatformTimerOffset;
 
-} ACPI_MADT_GENERIC_DISTRIBUTOR;
+} ACPI_TABLE_GTDT;
 
-/* Values for Version field above */
+/* Flag Definitions: Timer Block Physical Timers and Virtual timers */
 
-enum AcpiMadtGicVersion
-{
-    ACPI_MADT_GIC_VERSION_NONE          = 0,
-    ACPI_MADT_GIC_VERSION_V1            = 1,
-    ACPI_MADT_GIC_VERSION_V2            = 2,
-    ACPI_MADT_GIC_VERSION_V3            = 3,
-    ACPI_MADT_GIC_VERSION_V4            = 4,
-    ACPI_MADT_GIC_VERSION_RESERVED      = 5     /* 5 and greater are reserved */
-};
+#define ACPI_GTDT_INTERRUPT_MODE        (1)
+#define ACPI_GTDT_INTERRUPT_POLARITY    (1<<1)
+#define ACPI_GTDT_ALWAYS_ON             (1<<2)
 
 
-/* 13: Generic MSI Frame (ACPI 5.1) */
+/* Common GTDT subtable header */
 
-typedef struct acpi_madt_generic_msi_frame
+typedef struct acpi_gtdt_header
 {
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT16                  Reserved;           /* Reserved - must be zero */
-    UINT32                  MsiFrameId;
-    UINT64                  BaseAddress;
-    UINT32                  Flags;
-    UINT16                  SpiCount;
-    UINT16                  SpiBase;
+    UINT8                   Type;
+    UINT16                  Length;
 
-} ACPI_MADT_GENERIC_MSI_FRAME;
+} ACPI_GTDT_HEADER;
 
-/* Masks for Flags field above */
+/* Values for GTDT subtable type above */
+
+enum AcpiGtdtType
+{
+    ACPI_GTDT_TYPE_TIMER_BLOCK      = 0,
+    ACPI_GTDT_TYPE_WATCHDOG         = 1,
+    ACPI_GTDT_TYPE_RESERVED         = 2    /* 2 and greater are reserved */
+};
 
-#define ACPI_MADT_OVERRIDE_SPI_VALUES   (1)
 
+/* GTDT Subtables, correspond to Type in acpi_gtdt_header */
 
-/* 14: Generic Redistributor (ACPI 5.1) */
+/* 0: Generic Timer Block */
 
-typedef struct acpi_madt_generic_redistributor
+typedef struct acpi_gtdt_timer_block
 {
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT16                  Reserved;           /* reserved - must be zero */
-    UINT64                  BaseAddress;
-    UINT32                  Length;
-
-} ACPI_MADT_GENERIC_REDISTRIBUTOR;
+    ACPI_GTDT_HEADER        Header;
+    UINT8                   Reserved;
+    UINT64                  BlockAddress;
+    UINT32                  TimerCount;
+    UINT32                  TimerOffset;
 
+} ACPI_GTDT_TIMER_BLOCK;
 
-/* 15: Generic Translator (ACPI 6.0) */
+/* Timer Sub-Structure, one per timer */
 
-typedef struct acpi_madt_generic_translator
+typedef struct acpi_gtdt_timer_entry
 {
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT16                  Reserved;           /* reserved - must be zero */
-    UINT32                  TranslationId;
+    UINT8                   FrameNumber;
+    UINT8                   Reserved[3];
     UINT64                  BaseAddress;
-    UINT32                  Reserved2;
+    UINT64                  El0BaseAddress;
+    UINT32                  TimerInterrupt;
+    UINT32                  TimerFlags;
+    UINT32                  VirtualTimerInterrupt;
+    UINT32                  VirtualTimerFlags;
+    UINT32                  CommonFlags;
 
-} ACPI_MADT_GENERIC_TRANSLATOR;
+} ACPI_GTDT_TIMER_ENTRY;
 
+/* Flag Definitions: TimerFlags and VirtualTimerFlags above */
 
-/*
- * Common flags fields for MADT subtables
- */
+#define ACPI_GTDT_GT_IRQ_MODE               (1)
+#define ACPI_GTDT_GT_IRQ_POLARITY           (1<<1)
+
+/* Flag Definitions: CommonFlags above */
 
-/* MADT Local APIC flags */
+#define ACPI_GTDT_GT_IS_SECURE_TIMER        (1)
+#define ACPI_GTDT_GT_ALWAYS_ON              (1<<1)
 
-#define ACPI_MADT_ENABLED           (1)         /* 00: Processor is usable if set */
 
-/* MADT MPS INTI flags (IntiFlags) */
+/* 1: SBSA Generic Watchdog Structure */
 
-#define ACPI_MADT_POLARITY_MASK     (3)         /* 00-01: Polarity of APIC I/O input signals */
-#define ACPI_MADT_TRIGGER_MASK      (3<<2)      /* 02-03: Trigger mode of APIC input signals */
+typedef struct acpi_gtdt_watchdog
+{
+    ACPI_GTDT_HEADER        Header;
+    UINT8                   Reserved;
+    UINT64                  RefreshFrameAddress;
+    UINT64                  ControlFrameAddress;
+    UINT32                  TimerInterrupt;
+    UINT32                  TimerFlags;
 
-/* Values for MPS INTI flags */
+} ACPI_GTDT_WATCHDOG;
 
-#define ACPI_MADT_POLARITY_CONFORMS       0
-#define ACPI_MADT_POLARITY_ACTIVE_HIGH    1
-#define ACPI_MADT_POLARITY_RESERVED       2
-#define ACPI_MADT_POLARITY_ACTIVE_LOW     3
+/* Flag Definitions: TimerFlags above */
 
-#define ACPI_MADT_TRIGGER_CONFORMS        (0)
-#define ACPI_MADT_TRIGGER_EDGE            (1<<2)
-#define ACPI_MADT_TRIGGER_RESERVED        (2<<2)
-#define ACPI_MADT_TRIGGER_LEVEL           (3<<2)
+#define ACPI_GTDT_WATCHDOG_IRQ_MODE         (1)
+#define ACPI_GTDT_WATCHDOG_IRQ_POLARITY     (1<<1)
+#define ACPI_GTDT_WATCHDOG_SECURE           (1<<2)
 
 
 /*******************************************************************************
  *
- * MSCT - Maximum System Characteristics Table (ACPI 4.0)
+ * HEST - Hardware Error Source Table (ACPI 4.0)
  *        Version 1
  *
  ******************************************************************************/
 
-typedef struct acpi_table_msct
+typedef struct acpi_table_hest
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT32                  ProximityOffset;    /* Location of proximity info struct(s) */
-    UINT32                  MaxProximityDomains;/* Max number of proximity domains */
-    UINT32                  MaxClockDomains;    /* Max number of clock domains */
-    UINT64                  MaxAddress;         /* Max physical address in system */
+    UINT32                  ErrorSourceCount;
 
-} ACPI_TABLE_MSCT;
+} ACPI_TABLE_HEST;
 
 
-/* Subtable - Maximum Proximity Domain Information. Version 1 */
+/* HEST subtable header */
 
-typedef struct acpi_msct_proximity
+typedef struct acpi_hest_header
 {
-    UINT8                   Revision;
-    UINT8                   Length;
-    UINT32                  RangeStart;         /* Start of domain range */
-    UINT32                  RangeEnd;           /* End of domain range */
-    UINT32                  ProcessorCapacity;
-    UINT64                  MemoryCapacity;     /* In bytes */
+    UINT16                  Type;
+    UINT16                  SourceId;
 
-} ACPI_MSCT_PROXIMITY;
+} ACPI_HEST_HEADER;
 
 
-/*******************************************************************************
- *
- * NFIT - NVDIMM Interface Table (ACPI 6.0+)
- *        Version 1
- *
- ******************************************************************************/
+/* Values for Type field above for subtables */
 
-typedef struct acpi_table_nfit
+enum AcpiHestTypes
 {
-    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT32                  Reserved;           /* Reserved, must be zero */
+    ACPI_HEST_TYPE_IA32_CHECK           = 0,
+    ACPI_HEST_TYPE_IA32_CORRECTED_CHECK = 1,
+    ACPI_HEST_TYPE_IA32_NMI             = 2,
+    ACPI_HEST_TYPE_NOT_USED3            = 3,
+    ACPI_HEST_TYPE_NOT_USED4            = 4,
+    ACPI_HEST_TYPE_NOT_USED5            = 5,
+    ACPI_HEST_TYPE_AER_ROOT_PORT        = 6,
+    ACPI_HEST_TYPE_AER_ENDPOINT         = 7,
+    ACPI_HEST_TYPE_AER_BRIDGE           = 8,
+    ACPI_HEST_TYPE_GENERIC_ERROR        = 9,
+    ACPI_HEST_TYPE_GENERIC_ERROR_V2     = 10,
+    ACPI_HEST_TYPE_IA32_DEFERRED_CHECK  = 11,
+    ACPI_HEST_TYPE_RESERVED             = 12    /* 12 and greater are reserved */
+};
 
-} ACPI_TABLE_NFIT;
 
-/* Subtable header for NFIT */
+/*
+ * HEST substructures contained in subtables
+ */
 
-typedef struct acpi_nfit_header
+/*
+ * IA32 Error Bank(s) - Follows the ACPI_HEST_IA_MACHINE_CHECK and
+ * ACPI_HEST_IA_CORRECTED structures.
+ */
+typedef struct acpi_hest_ia_error_bank
 {
-    UINT16                   Type;
-    UINT16                   Length;
+    UINT8                   BankNumber;
+    UINT8                   ClearStatusOnInit;
+    UINT8                   StatusFormat;
+    UINT8                   Reserved;
+    UINT32                  ControlRegister;
+    UINT64                  ControlData;
+    UINT32                  StatusRegister;
+    UINT32                  AddressRegister;
+    UINT32                  MiscRegister;
 
-} ACPI_NFIT_HEADER;
+} ACPI_HEST_IA_ERROR_BANK;
 
 
-/* Values for subtable type in ACPI_NFIT_HEADER */
+/* Common HEST sub-structure for PCI/AER structures below (6,7,8) */
 
-enum AcpiNfitType
+typedef struct acpi_hest_aer_common
 {
-    ACPI_NFIT_TYPE_SYSTEM_ADDRESS       = 0,
-    ACPI_NFIT_TYPE_MEMORY_MAP           = 1,
-    ACPI_NFIT_TYPE_INTERLEAVE           = 2,
-    ACPI_NFIT_TYPE_SMBIOS               = 3,
-    ACPI_NFIT_TYPE_CONTROL_REGION       = 4,
-    ACPI_NFIT_TYPE_DATA_REGION          = 5,
-    ACPI_NFIT_TYPE_FLUSH_ADDRESS        = 6,
-    ACPI_NFIT_TYPE_CAPABILITIES         = 7,
-    ACPI_NFIT_TYPE_RESERVED             = 8     /* 8 and greater are reserved */
-};
+    UINT16                  Reserved1;
+    UINT8                   Flags;
+    UINT8                   Enabled;
+    UINT32                  RecordsToPreallocate;
+    UINT32                  MaxSectionsPerRecord;
+    UINT32                  Bus;                    /* Bus and Segment numbers */
+    UINT16                  Device;
+    UINT16                  Function;
+    UINT16                  DeviceControl;
+    UINT16                  Reserved2;
+    UINT32                  UncorrectableMask;
+    UINT32                  UncorrectableSeverity;
+    UINT32                  CorrectableMask;
+    UINT32                  AdvancedCapabilities;
+
+} ACPI_HEST_AER_COMMON;
+
+/* Masks for HEST Flags fields */
+
+#define ACPI_HEST_FIRMWARE_FIRST        (1)
+#define ACPI_HEST_GLOBAL                (1<<1)
+#define ACPI_HEST_GHES_ASSIST           (1<<2)
 
 /*
- * NFIT Subtables
+ * 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)
+
 
-/* 0: System Physical Address Range Structure */
+/* Hardware Error Notification */
 
-typedef struct acpi_nfit_system_address
+typedef struct acpi_hest_notify
 {
-    ACPI_NFIT_HEADER        Header;
-    UINT16                  RangeIndex;
-    UINT16                  Flags;
-    UINT32                  Reserved;           /* Reserved, must be zero */
-    UINT32                  ProximityDomain;
-    UINT8                   RangeGuid[16];
-    UINT64                  Address;
-    UINT64                  Length;
-    UINT64                  MemoryMapping;
+    UINT8                   Type;
+    UINT8                   Length;
+    UINT16                  ConfigWriteEnable;
+    UINT32                  PollInterval;
+    UINT32                  Vector;
+    UINT32                  PollingThresholdValue;
+    UINT32                  PollingThresholdWindow;
+    UINT32                  ErrorThresholdValue;
+    UINT32                  ErrorThresholdWindow;
 
-} ACPI_NFIT_SYSTEM_ADDRESS;
+} ACPI_HEST_NOTIFY;
 
-/* Flags */
+/* Values for Notify Type field above */
 
-#define ACPI_NFIT_ADD_ONLINE_ONLY       (1)     /* 00: Add/Online Operation Only */
-#define ACPI_NFIT_PROXIMITY_VALID       (1<<1)  /* 01: Proximity Domain Valid */
+enum AcpiHestNotifyTypes
+{
+    ACPI_HEST_NOTIFY_POLLED             = 0,
+    ACPI_HEST_NOTIFY_EXTERNAL           = 1,
+    ACPI_HEST_NOTIFY_LOCAL              = 2,
+    ACPI_HEST_NOTIFY_SCI                = 3,
+    ACPI_HEST_NOTIFY_NMI                = 4,
+    ACPI_HEST_NOTIFY_CMCI               = 5,    /* ACPI 5.0 */
+    ACPI_HEST_NOTIFY_MCE                = 6,    /* ACPI 5.0 */
+    ACPI_HEST_NOTIFY_GPIO               = 7,    /* ACPI 6.0 */
+    ACPI_HEST_NOTIFY_SEA                = 8,    /* ACPI 6.1 */
+    ACPI_HEST_NOTIFY_SEI                = 9,    /* ACPI 6.1 */
+    ACPI_HEST_NOTIFY_GSIV               = 10,   /* ACPI 6.1 */
+    ACPI_HEST_NOTIFY_SOFTWARE_DELEGATED = 11,   /* ACPI 6.2 */
+    ACPI_HEST_NOTIFY_RESERVED           = 12    /* 12 and greater are reserved */
+};
 
-/* Range Type GUIDs appear in the include/acuuid.h file */
+/* Values for ConfigWriteEnable bitfield above */
 
+#define ACPI_HEST_TYPE                  (1)
+#define ACPI_HEST_POLL_INTERVAL         (1<<1)
+#define ACPI_HEST_POLL_THRESHOLD_VALUE  (1<<2)
+#define ACPI_HEST_POLL_THRESHOLD_WINDOW (1<<3)
+#define ACPI_HEST_ERR_THRESHOLD_VALUE   (1<<4)
+#define ACPI_HEST_ERR_THRESHOLD_WINDOW  (1<<5)
 
-/* 1: Memory Device to System Address Range Map Structure */
 
-typedef struct acpi_nfit_memory_map
-{
-    ACPI_NFIT_HEADER        Header;
-    UINT32                  DeviceHandle;
-    UINT16                  PhysicalId;
-    UINT16                  RegionId;
-    UINT16                  RangeIndex;
-    UINT16                  RegionIndex;
-    UINT64                  RegionSize;
-    UINT64                  RegionOffset;
-    UINT64                  Address;
-    UINT16                  InterleaveIndex;
-    UINT16                  InterleaveWays;
-    UINT16                  Flags;
-    UINT16                  Reserved;           /* Reserved, must be zero */
+/*
+ * HEST subtables
+ */
 
-} ACPI_NFIT_MEMORY_MAP;
+/* 0: IA32 Machine Check Exception */
 
-/* Flags */
+typedef struct acpi_hest_ia_machine_check
+{
+    ACPI_HEST_HEADER        Header;
+    UINT16                  Reserved1;
+    UINT8                   Flags;              /* See flags ACPI_HEST_GLOBAL, etc. above */
+    UINT8                   Enabled;
+    UINT32                  RecordsToPreallocate;
+    UINT32                  MaxSectionsPerRecord;
+    UINT64                  GlobalCapabilityData;
+    UINT64                  GlobalControlData;
+    UINT8                   NumHardwareBanks;
+    UINT8                   Reserved3[7];
 
-#define ACPI_NFIT_MEM_SAVE_FAILED       (1)     /* 00: Last SAVE to Memory Device failed */
-#define ACPI_NFIT_MEM_RESTORE_FAILED    (1<<1)  /* 01: Last RESTORE from Memory Device failed */
-#define ACPI_NFIT_MEM_FLUSH_FAILED      (1<<2)  /* 02: Platform flush failed */
-#define ACPI_NFIT_MEM_NOT_ARMED         (1<<3)  /* 03: Memory Device is not armed */
-#define ACPI_NFIT_MEM_HEALTH_OBSERVED   (1<<4)  /* 04: Memory Device observed SMART/health events */
-#define ACPI_NFIT_MEM_HEALTH_ENABLED    (1<<5)  /* 05: SMART/health events enabled */
-#define ACPI_NFIT_MEM_MAP_FAILED        (1<<6)  /* 06: Mapping to SPA failed */
+} ACPI_HEST_IA_MACHINE_CHECK;
 
 
-/* 2: Interleave Structure */
+/* 1: IA32 Corrected Machine Check */
 
-typedef struct acpi_nfit_interleave
+typedef struct acpi_hest_ia_corrected
 {
-    ACPI_NFIT_HEADER        Header;
-    UINT16                  InterleaveIndex;
-    UINT16                  Reserved;           /* Reserved, must be zero */
-    UINT32                  LineCount;
-    UINT32                  LineSize;
-    UINT32                  LineOffset[1];      /* Variable length */
+    ACPI_HEST_HEADER        Header;
+    UINT16                  Reserved1;
+    UINT8                   Flags;              /* See flags ACPI_HEST_GLOBAL, etc. above */
+    UINT8                   Enabled;
+    UINT32                  RecordsToPreallocate;
+    UINT32                  MaxSectionsPerRecord;
+    ACPI_HEST_NOTIFY        Notify;
+    UINT8                   NumHardwareBanks;
+    UINT8                   Reserved2[3];
 
-} ACPI_NFIT_INTERLEAVE;
+} ACPI_HEST_IA_CORRECTED;
 
 
-/* 3: SMBIOS Management Information Structure */
+/* 2: IA32 Non-Maskable Interrupt */
 
-typedef struct acpi_nfit_smbios
+typedef struct acpi_hest_ia_nmi
 {
-    ACPI_NFIT_HEADER        Header;
-    UINT32                  Reserved;           /* Reserved, must be zero */
-    UINT8                   Data[1];            /* Variable length */
+    ACPI_HEST_HEADER        Header;
+    UINT32                  Reserved;
+    UINT32                  RecordsToPreallocate;
+    UINT32                  MaxSectionsPerRecord;
+    UINT32                  MaxRawDataLength;
+
+} ACPI_HEST_IA_NMI;
 
-} ACPI_NFIT_SMBIOS;
 
+/* 3,4,5: Not used */
 
-/* 4: NVDIMM Control Region Structure */
+/* 6: PCI Express Root Port AER */
 
-typedef struct acpi_nfit_control_region
+typedef struct acpi_hest_aer_root
 {
-    ACPI_NFIT_HEADER        Header;
-    UINT16                  RegionIndex;
-    UINT16                  VendorId;
-    UINT16                  DeviceId;
-    UINT16                  RevisionId;
-    UINT16                  SubsystemVendorId;
-    UINT16                  SubsystemDeviceId;
-    UINT16                  SubsystemRevisionId;
-    UINT8                   ValidFields;
-    UINT8                   ManufacturingLocation;
-    UINT16                  ManufacturingDate;
-    UINT8                   Reserved[2];        /* Reserved, must be zero */
-    UINT32                  SerialNumber;
-    UINT16                  Code;
-    UINT16                  Windows;
-    UINT64                  WindowSize;
-    UINT64                  CommandOffset;
-    UINT64                  CommandSize;
-    UINT64                  StatusOffset;
-    UINT64                  StatusSize;
-    UINT16                  Flags;
-    UINT8                   Reserved1[6];       /* Reserved, must be zero */
+    ACPI_HEST_HEADER        Header;
+    ACPI_HEST_AER_COMMON    Aer;
+    UINT32                  RootErrorCommand;
 
-} ACPI_NFIT_CONTROL_REGION;
+} ACPI_HEST_AER_ROOT;
 
-/* Flags */
 
-#define ACPI_NFIT_CONTROL_BUFFERED          (1)     /* Block Data Windows implementation is buffered */
+/* 7: PCI Express AER (AER Endpoint) */
 
-/* ValidFields bits */
+typedef struct acpi_hest_aer
+{
+    ACPI_HEST_HEADER        Header;
+    ACPI_HEST_AER_COMMON    Aer;
 
-#define ACPI_NFIT_CONTROL_MFG_INFO_VALID    (1)     /* Manufacturing fields are valid */
+} ACPI_HEST_AER;
 
 
-/* 5: NVDIMM Block Data Window Region Structure */
+/* 8: PCI Express/PCI-X Bridge AER */
 
-typedef struct acpi_nfit_data_region
+typedef struct acpi_hest_aer_bridge
 {
-    ACPI_NFIT_HEADER        Header;
-    UINT16                  RegionIndex;
-    UINT16                  Windows;
-    UINT64                  Offset;
-    UINT64                  Size;
-    UINT64                  Capacity;
-    UINT64                  StartAddress;
+    ACPI_HEST_HEADER        Header;
+    ACPI_HEST_AER_COMMON    Aer;
+    UINT32                  UncorrectableMask2;
+    UINT32                  UncorrectableSeverity2;
+    UINT32                  AdvancedCapabilities2;
 
-} ACPI_NFIT_DATA_REGION;
+} ACPI_HEST_AER_BRIDGE;
 
 
-/* 6: Flush Hint Address Structure */
+/* 9: Generic Hardware Error Source */
 
-typedef struct acpi_nfit_flush_address
+typedef struct acpi_hest_generic
 {
-    ACPI_NFIT_HEADER        Header;
-    UINT32                  DeviceHandle;
-    UINT16                  HintCount;
-    UINT8                   Reserved[6];        /* Reserved, must be zero */
-    UINT64                  HintAddress[1];     /* Variable length */
+    ACPI_HEST_HEADER        Header;
+    UINT16                  RelatedSourceId;
+    UINT8                   Reserved;
+    UINT8                   Enabled;
+    UINT32                  RecordsToPreallocate;
+    UINT32                  MaxSectionsPerRecord;
+    UINT32                  MaxRawDataLength;
+    ACPI_GENERIC_ADDRESS    ErrorStatusAddress;
+    ACPI_HEST_NOTIFY        Notify;
+    UINT32                  ErrorBlockLength;
 
-} ACPI_NFIT_FLUSH_ADDRESS;
+} ACPI_HEST_GENERIC;
 
 
-/* 7: Platform Capabilities Structure */
+/* 10: Generic Hardware Error Source, version 2 */
 
-typedef struct acpi_nfit_capabilities
+typedef struct acpi_hest_generic_v2
 {
-    ACPI_NFIT_HEADER        Header;
-    UINT8                   HighestCapability;
-    UINT8                   Reserved[3];       /* Reserved, must be zero */
-    UINT32                  Capabilities;
-    UINT32                  Reserved2;
-
-} ACPI_NFIT_CAPABILITIES;
+    ACPI_HEST_HEADER        Header;
+    UINT16                  RelatedSourceId;
+    UINT8                   Reserved;
+    UINT8                   Enabled;
+    UINT32                  RecordsToPreallocate;
+    UINT32                  MaxSectionsPerRecord;
+    UINT32                  MaxRawDataLength;
+    ACPI_GENERIC_ADDRESS    ErrorStatusAddress;
+    ACPI_HEST_NOTIFY        Notify;
+    UINT32                  ErrorBlockLength;
+    ACPI_GENERIC_ADDRESS    ReadAckRegister;
+    UINT64                  ReadAckPreserve;
+    UINT64                  ReadAckWrite;
 
-/* Capabilities Flags */
+} ACPI_HEST_GENERIC_V2;
 
-#define ACPI_NFIT_CAPABILITY_CACHE_FLUSH       (1)     /* 00: Cache Flush to NVDIMM capable */
-#define ACPI_NFIT_CAPABILITY_MEM_FLUSH         (1<<1)  /* 01: Memory Flush to NVDIMM capable */
-#define ACPI_NFIT_CAPABILITY_MEM_MIRRORING     (1<<2)  /* 02: Memory Mirroring capable */
 
+/* Generic Error Status block */
 
-/*
- * NFIT/DVDIMM device handle support - used as the _ADR for each NVDIMM
- */
-typedef struct nfit_device_handle
+typedef struct acpi_hest_generic_status
 {
-    UINT32                  Handle;
-
-} NFIT_DEVICE_HANDLE;
+    UINT32                  BlockStatus;
+    UINT32                  RawDataOffset;
+    UINT32                  RawDataLength;
+    UINT32                  DataLength;
+    UINT32                  ErrorSeverity;
 
-/* Device handle construction and extraction macros */
+} ACPI_HEST_GENERIC_STATUS;
 
-#define ACPI_NFIT_DIMM_NUMBER_MASK              0x0000000F
-#define ACPI_NFIT_CHANNEL_NUMBER_MASK           0x000000F0
-#define ACPI_NFIT_MEMORY_ID_MASK                0x00000F00
-#define ACPI_NFIT_SOCKET_ID_MASK                0x0000F000
-#define ACPI_NFIT_NODE_ID_MASK                  0x0FFF0000
+/* Values for BlockStatus flags above */
 
-#define ACPI_NFIT_DIMM_NUMBER_OFFSET            0
-#define ACPI_NFIT_CHANNEL_NUMBER_OFFSET         4
-#define ACPI_NFIT_MEMORY_ID_OFFSET              8
-#define ACPI_NFIT_SOCKET_ID_OFFSET              12
-#define ACPI_NFIT_NODE_ID_OFFSET                16
+#define ACPI_HEST_UNCORRECTABLE             (1)
+#define ACPI_HEST_CORRECTABLE               (1<<1)
+#define ACPI_HEST_MULTIPLE_UNCORRECTABLE    (1<<2)
+#define ACPI_HEST_MULTIPLE_CORRECTABLE      (1<<3)
+#define ACPI_HEST_ERROR_ENTRY_COUNT         (0xFF<<4) /* 8 bits, error count */
 
-/* Macro to construct a NFIT/NVDIMM device handle */
 
-#define ACPI_NFIT_BUILD_DEVICE_HANDLE(dimm, channel, memory, socket, node) \
-    ((dimm)                                         | \
-    ((channel) << ACPI_NFIT_CHANNEL_NUMBER_OFFSET)  | \
-    ((memory)  << ACPI_NFIT_MEMORY_ID_OFFSET)       | \
-    ((socket)  << ACPI_NFIT_SOCKET_ID_OFFSET)       | \
-    ((node)    << ACPI_NFIT_NODE_ID_OFFSET))
+/* Generic Error Data entry */
 
-/* Macros to extract individual fields from a NFIT/NVDIMM device handle */
+typedef struct acpi_hest_generic_data
+{
+    UINT8                   SectionType[16];
+    UINT32                  ErrorSeverity;
+    UINT16                  Revision;
+    UINT8                   ValidationBits;
+    UINT8                   Flags;
+    UINT32                  ErrorDataLength;
+    UINT8                   FruId[16];
+    UINT8                   FruText[20];
 
-#define ACPI_NFIT_GET_DIMM_NUMBER(handle) \
-    ((handle) & ACPI_NFIT_DIMM_NUMBER_MASK)
+} ACPI_HEST_GENERIC_DATA;
 
-#define ACPI_NFIT_GET_CHANNEL_NUMBER(handle) \
-    (((handle) & ACPI_NFIT_CHANNEL_NUMBER_MASK) >> ACPI_NFIT_CHANNEL_NUMBER_OFFSET)
+/* Extension for revision 0x0300 */
 
-#define ACPI_NFIT_GET_MEMORY_ID(handle) \
-    (((handle) & ACPI_NFIT_MEMORY_ID_MASK)      >> ACPI_NFIT_MEMORY_ID_OFFSET)
+typedef struct acpi_hest_generic_data_v300
+{
+    UINT8                   SectionType[16];
+    UINT32                  ErrorSeverity;
+    UINT16                  Revision;
+    UINT8                   ValidationBits;
+    UINT8                   Flags;
+    UINT32                  ErrorDataLength;
+    UINT8                   FruId[16];
+    UINT8                   FruText[20];
+    UINT64                  TimeStamp;
 
-#define ACPI_NFIT_GET_SOCKET_ID(handle) \
-    (((handle) & ACPI_NFIT_SOCKET_ID_MASK)      >> ACPI_NFIT_SOCKET_ID_OFFSET)
+} ACPI_HEST_GENERIC_DATA_V300;
 
-#define ACPI_NFIT_GET_NODE_ID(handle) \
-    (((handle) & ACPI_NFIT_NODE_ID_MASK)        >> ACPI_NFIT_NODE_ID_OFFSET)
+/* Values for ErrorSeverity above */
 
+#define ACPI_HEST_GEN_ERROR_RECOVERABLE     0
+#define ACPI_HEST_GEN_ERROR_FATAL           1
+#define ACPI_HEST_GEN_ERROR_CORRECTED       2
+#define ACPI_HEST_GEN_ERROR_NONE            3
 
-/*******************************************************************************
- *
- * PDTT - Platform Debug Trigger Table (ACPI 6.2)
- *        Version 0
- *
- ******************************************************************************/
+/* Flags for ValidationBits above */
 
-typedef struct acpi_table_pdtt
-{
-    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT8                   TriggerCount;
-    UINT8                   Reserved[3];
-    UINT32                  ArrayOffset;
+#define ACPI_HEST_GEN_VALID_FRU_ID          (1)
+#define ACPI_HEST_GEN_VALID_FRU_STRING      (1<<1)
+#define ACPI_HEST_GEN_VALID_TIMESTAMP       (1<<2)
 
-} ACPI_TABLE_PDTT;
 
+/* 11: IA32 Deferred Machine Check Exception (ACPI 6.2) */
 
-/*
- * PDTT Communication Channel Identifier Structure.
- * The number of these structures is defined by TriggerCount above,
- * starting at ArrayOffset.
- */
-typedef struct acpi_pdtt_channel
+typedef struct acpi_hest_ia_deferred_check
 {
-    UINT8                   SubchannelId;
-    UINT8                   Flags;
-
-} ACPI_PDTT_CHANNEL;
-
-/* Flags for above */
+    ACPI_HEST_HEADER        Header;
+    UINT16                  Reserved1;
+    UINT8                   Flags;              /* See flags ACPI_HEST_GLOBAL, etc. above */
+    UINT8                   Enabled;
+    UINT32                  RecordsToPreallocate;
+    UINT32                  MaxSectionsPerRecord;
+    ACPI_HEST_NOTIFY        Notify;
+    UINT8                   NumHardwareBanks;
+    UINT8                   Reserved2[3];
 
-#define ACPI_PDTT_RUNTIME_TRIGGER           (1)
-#define ACPI_PDTT_WAIT_COMPLETION           (1<<1)
+} ACPI_HEST_IA_DEFERRED_CHECK;
 
 
 /*******************************************************************************
  *
- * PPTT - Processor Properties Topology Table (ACPI 6.2)
+ * HMAT - Heterogeneous Memory Attributes Table (ACPI 6.2)
  *        Version 1
  *
  ******************************************************************************/
 
-typedef struct acpi_table_pptt
+typedef struct acpi_table_hmat
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    UINT32                  Reserved;
 
-} ACPI_TABLE_PPTT;
+} ACPI_TABLE_HMAT;
 
-/* Values for Type field above */
 
-enum AcpiPpttType
+/* Values for HMAT structure types */
+
+enum AcpiHmatType
 {
-    ACPI_PPTT_TYPE_PROCESSOR            = 0,
-    ACPI_PPTT_TYPE_CACHE                = 1,
-    ACPI_PPTT_TYPE_ID                   = 2,
-    ACPI_PPTT_TYPE_RESERVED             = 3
+    ACPI_HMAT_TYPE_ADDRESS_RANGE        = 0,   /* Memory subystem address range */
+    ACPI_HMAT_TYPE_LOCALITY             = 1,   /* System locality latency and bandwidth information */
+    ACPI_HMAT_TYPE_CACHE                = 2,   /* Memory side cache information */
+    ACPI_HMAT_TYPE_RESERVED             = 3    /* 3 and greater are reserved */
 };
 
+typedef struct acpi_hmat_structure
+{
+    UINT16                  Type;
+    UINT16                  Reserved;
+    UINT32                  Length;
+
+} ACPI_HMAT_STRUCTURE;
+
+
+/*
+ * HMAT Structures, correspond to Type in ACPI_HMAT_STRUCTURE
+ */
 
-/* 0: Processor Hierarchy Node Structure */
+/* 0: Memory subystem address range */
 
-typedef struct acpi_pptt_processor
+typedef struct acpi_hmat_address_range
 {
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT16                  Reserved;
-    UINT32                  Flags;
-    UINT32                  Parent;
-    UINT32                  AcpiProcessorId;
-    UINT32                  NumberOfPrivResources;
+    ACPI_HMAT_STRUCTURE     Header;
+    UINT16                  Flags;
+    UINT16                  Reserved1;
+    UINT32                  ProcessorPD;            /* Processor proximity domain */
+    UINT32                  MemoryPD;               /* Memory proximity domain */
+    UINT32                  Reserved2;
+    UINT64                  PhysicalAddressBase;    /* Physical address range base */
+    UINT64                  PhysicalAddressLength;  /* Physical address range length */
 
-} ACPI_PPTT_PROCESSOR;
+} ACPI_HMAT_ADDRESS_RANGE;
 
-/* Flags */
+/* Masks for Flags field above */
 
-#define ACPI_PPTT_PHYSICAL_PACKAGE          (1)     /* Physical package */
-#define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID   (2)     /* ACPI Processor ID valid */
+#define ACPI_HMAT_PROCESSOR_PD_VALID    (1)     /* 1: ProcessorPD field is valid */
+#define ACPI_HMAT_MEMORY_PD_VALID       (1<<1)  /* 1: MemoryPD field is valid */
+#define ACPI_HMAT_RESERVATION_HINT      (1<<2)  /* 1: Reservation hint */
 
 
-/* 1: Cache Type Structure */
+/* 1: System locality latency and bandwidth information */
 
-typedef struct acpi_pptt_cache
+typedef struct acpi_hmat_locality
 {
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT16                  Reserved;
-    UINT32                  Flags;
-    UINT32                  NextLevelOfCache;
-    UINT32                  Size;
-    UINT32                  NumberOfSets;
-    UINT8                   Associativity;
-    UINT8                   Attributes;
-    UINT16                  LineSize;
+    ACPI_HMAT_STRUCTURE     Header;
+    UINT8                   Flags;
+    UINT8                   DataType;
+    UINT16                  Reserved1;
+    UINT32                  NumberOfInitiatorPDs;
+    UINT32                  NumberOfTargetPDs;
+    UINT32                  Reserved2;
+    UINT64                  EntryBaseUnit;
 
-} ACPI_PPTT_CACHE;
+} ACPI_HMAT_LOCALITY;
 
-/* Flags */
+/* Masks for Flags field above */
 
-#define ACPI_PPTT_SIZE_PROPERTY_VALID       (1)     /* Physical property valid */
-#define ACPI_PPTT_NUMBER_OF_SETS_VALID      (1<<1)  /* Number of sets valid */
-#define ACPI_PPTT_ASSOCIATIVITY_VALID       (1<<2)  /* Associativity valid */
-#define ACPI_PPTT_ALLOCATION_TYPE_VALID     (1<<3)  /* Allocation type valid */
-#define ACPI_PPTT_CACHE_TYPE_VALID          (1<<4)  /* Cache type valid */
-#define ACPI_PPTT_WRITE_POLICY_VALID        (1<<5)  /* Write policy valid */
-#define ACPI_PPTT_LINE_SIZE_VALID           (1<<6)  /* Line size valid */
+#define ACPI_HMAT_MEMORY_HIERARCHY  (0x0F)
 
-/* Masks for Attributes */
+/* Values for Memory Hierarchy flag */
 
-#define ACPI_PPTT_MASK_ALLOCATION_TYPE      (0x03)  /* Allocation type */
-#define ACPI_PPTT_MASK_CACHE_TYPE           (0x0C)  /* Cache type */
-#define ACPI_PPTT_MASK_WRITE_POLICY         (0x10)  /* Write policy */
+#define ACPI_HMAT_MEMORY            0
+#define ACPI_HMAT_LAST_LEVEL_CACHE  1
+#define ACPI_HMAT_1ST_LEVEL_CACHE   2
+#define ACPI_HMAT_2ND_LEVEL_CACHE   3
+#define ACPI_HMAT_3RD_LEVEL_CACHE   4
 
-/* Attributes describing cache */
-#define ACPI_PPTT_CACHE_READ_ALLOCATE       (0x0)   /* Cache line is allocated on read */
-#define ACPI_PPTT_CACHE_WRITE_ALLOCATE      (0x01)  /* Cache line is allocated on write */
-#define ACPI_PPTT_CACHE_RW_ALLOCATE         (0x02)  /* Cache line is allocated on read and write */
-#define ACPI_PPTT_CACHE_RW_ALLOCATE_ALT     (0x03)  /* Alternate representation of above */
+/* Values for DataType field above */
 
-#define ACPI_PPTT_CACHE_TYPE_DATA           (0x0)   /* Data cache */
-#define ACPI_PPTT_CACHE_TYPE_INSTR          (1<<2)  /* Instruction cache */
-#define ACPI_PPTT_CACHE_TYPE_UNIFIED        (2<<2)  /* Unified I & D cache */
-#define ACPI_PPTT_CACHE_TYPE_UNIFIED_ALT    (3<<2)  /* Alternate representation of above */
+#define ACPI_HMAT_ACCESS_LATENCY    0
+#define ACPI_HMAT_READ_LATENCY      1
+#define ACPI_HMAT_WRITE_LATENCY     2
+#define ACPI_HMAT_ACCESS_BANDWIDTH  3
+#define ACPI_HMAT_READ_BANDWIDTH    4
+#define ACPI_HMAT_WRITE_BANDWIDTH   5
 
-#define ACPI_PPTT_CACHE_POLICY_WB           (0x0)   /* Cache is write back */
-#define ACPI_PPTT_CACHE_POLICY_WT           (1<<4)  /* Cache is write through */
 
-/* 2: ID Structure */
+/* 2: Memory side cache information */
 
-typedef struct acpi_pptt_id
+typedef struct acpi_hmat_cache
 {
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT16                  Reserved;
-    UINT32                  VendorId;
-    UINT64                  Level1Id;
-    UINT64                  Level2Id;
-    UINT16                  MajorRev;
-    UINT16                  MinorRev;
-    UINT16                  SpinRev;
+    ACPI_HMAT_STRUCTURE     Header;
+    UINT32                  MemoryPD;
+    UINT32                  Reserved1;
+    UINT64                  CacheSize;
+    UINT32                  CacheAttributes;
+    UINT16                  Reserved2;
+    UINT16                  NumberOfSMBIOSHandles;
+
+} ACPI_HMAT_CACHE;
 
-} ACPI_PPTT_ID;
+/* Masks for CacheAttributes field above */
 
+#define ACPI_HMAT_TOTAL_CACHE_LEVEL     (0x0000000F)
+#define ACPI_HMAT_CACHE_LEVEL           (0x000000F0)
+#define ACPI_HMAT_CACHE_ASSOCIATIVITY   (0x00000F00)
+#define ACPI_HMAT_WRITE_POLICY          (0x0000F000)
+#define ACPI_HMAT_CACHE_LINE_SIZE       (0xFFFF0000)
 
-/*******************************************************************************
- *
- * SBST - Smart Battery Specification Table
- *        Version 1
- *
- ******************************************************************************/
+/* Values for cache associativity flag */
 
-typedef struct acpi_table_sbst
-{
-    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT32                  WarningLevel;
-    UINT32                  LowLevel;
-    UINT32                  CriticalLevel;
+#define ACPI_HMAT_CA_NONE                     (0)
+#define ACPI_HMAT_CA_DIRECT_MAPPED            (1)
+#define ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING   (2)
+
+/* Values for write policy flag */
 
-} ACPI_TABLE_SBST;
+#define ACPI_HMAT_CP_NONE   (0)
+#define ACPI_HMAT_CP_WB     (1)
+#define ACPI_HMAT_CP_WT     (2)
 
 
 /*******************************************************************************
  *
- * SDEV - Secure Devices Table (ACPI 6.2)
+ * HPET - High Precision Event Timer table
  *        Version 1
  *
+ * Conforms to "IA-PC HPET (High Precision Event Timers) Specification",
+ * Version 1.0a, October 2004
+ *
  ******************************************************************************/
 
-typedef struct acpi_table_sdev
+typedef struct acpi_table_hpet
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-
-} ACPI_TABLE_SDEV;
-
-
-typedef struct acpi_sdev_header
-{
-    UINT8                   Type;
+    UINT32                  Id;                 /* Hardware ID of event timer block */
+    ACPI_GENERIC_ADDRESS    Address;            /* Address of event timer block */
+    UINT8                   Sequence;           /* HPET sequence number */
+    UINT16                  MinimumTick;        /* Main counter min tick, periodic mode */
     UINT8                   Flags;
-    UINT16                  Length;
-
-} ACPI_SDEV_HEADER;
-
-
-/* Values for subtable type above */
 
-enum AcpiSdevType
-{
-    ACPI_SDEV_TYPE_NAMESPACE_DEVICE     = 0,
-    ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE = 1,
-    ACPI_SDEV_TYPE_RESERVED             = 2     /* 2 and greater are reserved */
-};
-
-/* Values for flags above */
-
-#define ACPI_SDEV_HANDOFF_TO_UNSECURE_OS    (1)
-
-/*
- * SDEV subtables
- */
-
-/* 0: Namespace Device Based Secure Device Structure */
+} ACPI_TABLE_HPET;
 
-typedef struct acpi_sdev_namespace
-{
-    ACPI_SDEV_HEADER        Header;
-    UINT16                  DeviceIdOffset;
-    UINT16                  DeviceIdLength;
-    UINT16                  VendorDataOffset;
-    UINT16                  VendorDataLength;
-
-} ACPI_SDEV_NAMESPACE;
-
-/* 1: PCIe Endpoint Device Based Device Structure */
-
-typedef struct acpi_sdev_pcie
-{
-    ACPI_SDEV_HEADER        Header;
-    UINT16                  Segment;
-    UINT16                  StartBus;
-    UINT16                  PathOffset;
-    UINT16                  PathLength;
-    UINT16                  VendorDataOffset;
-    UINT16                  VendorDataLength;
+/* Masks for Flags field above */
 
-} ACPI_SDEV_PCIE;
+#define ACPI_HPET_PAGE_PROTECT_MASK (3)
 
-/* 1a: PCIe Endpoint path entry */
+/* Values for Page Protect flags */
 
-typedef struct acpi_sdev_pcie_path
+enum AcpiHpetPageProtect
 {
-    UINT8                   Device;
-    UINT8                   Function;
-
-} ACPI_SDEV_PCIE_PATH;
+    ACPI_HPET_NO_PAGE_PROTECT       = 0,
+    ACPI_HPET_PAGE_PROTECT4         = 1,
+    ACPI_HPET_PAGE_PROTECT64        = 2
+};
 
 
 /*******************************************************************************
  *
- * SLIT - System Locality Distance Information Table
+ * IBFT - Boot Firmware Table
  *        Version 1
  *
- ******************************************************************************/
-
-typedef struct acpi_table_slit
-{
-    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT64                  LocalityCount;
-    UINT8                   Entry[1];           /* Real size = localities^2 */
-
-} ACPI_TABLE_SLIT;
-
-
-/*******************************************************************************
+ * Conforms to "iSCSI Boot Firmware Table (iBFT) as Defined in ACPI 3.0b
+ * Specification", Version 1.01, March 1, 2007
  *
- * SRAT - System Resource Affinity Table
- *        Version 3
+ * Note: It appears that this table is not intended to appear in the RSDT/XSDT.
+ * Therefore, it is not currently supported by the disassembler.
  *
  ******************************************************************************/
 
-typedef struct acpi_table_srat
+typedef struct acpi_table_ibft
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT32                  TableRevision;      /* Must be value '1' */
-    UINT64                  Reserved;           /* Reserved, must be zero */
-
-} ACPI_TABLE_SRAT;
-
-/* Values for subtable type in ACPI_SUBTABLE_HEADER */
-
-enum AcpiSratType
-{
-    ACPI_SRAT_TYPE_CPU_AFFINITY         = 0,
-    ACPI_SRAT_TYPE_MEMORY_AFFINITY      = 1,
-    ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY  = 2,
-    ACPI_SRAT_TYPE_GICC_AFFINITY        = 3,
-    ACPI_SRAT_TYPE_GIC_ITS_AFFINITY     = 4,    /* ACPI 6.2 */
-    ACPI_SRAT_TYPE_RESERVED             = 5     /* 5 and greater are reserved */
-};
-
-/*
- * SRAT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
- */
-
-/* 0: Processor Local APIC/SAPIC Affinity */
-
-typedef struct acpi_srat_cpu_affinity
-{
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT8                   ProximityDomainLo;
-    UINT8                   ApicId;
-    UINT32                  Flags;
-    UINT8                   LocalSapicEid;
-    UINT8                   ProximityDomainHi[3];
-    UINT32                  ClockDomain;
-
-} ACPI_SRAT_CPU_AFFINITY;
-
-/* Flags */
-
-#define ACPI_SRAT_CPU_USE_AFFINITY  (1)         /* 00: Use affinity structure */
-
-
-/* 1: Memory Affinity */
-
-typedef struct acpi_srat_mem_affinity
-{
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT32                  ProximityDomain;
-    UINT16                  Reserved;           /* Reserved, must be zero */
-    UINT64                  BaseAddress;
-    UINT64                  Length;
-    UINT32                  Reserved1;
-    UINT32                  Flags;
-    UINT64                  Reserved2;          /* Reserved, must be zero */
+    UINT8                   Reserved[12];
 
-} ACPI_SRAT_MEM_AFFINITY;
+} ACPI_TABLE_IBFT;
 
-/* Flags */
 
-#define ACPI_SRAT_MEM_ENABLED       (1)         /* 00: Use affinity structure */
-#define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1)      /* 01: Memory region is hot pluggable */
-#define ACPI_SRAT_MEM_NON_VOLATILE  (1<<2)      /* 02: Memory region is non-volatile */
+/* IBFT common subtable header */
 
-
-/* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
-
-typedef struct acpi_srat_x2apic_cpu_affinity
+typedef struct acpi_ibft_header
 {
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT16                  Reserved;           /* Reserved, must be zero */
-    UINT32                  ProximityDomain;
-    UINT32                  ApicId;
-    UINT32                  Flags;
-    UINT32                  ClockDomain;
-    UINT32                  Reserved2;
-
-} ACPI_SRAT_X2APIC_CPU_AFFINITY;
-
-/* Flags for ACPI_SRAT_CPU_AFFINITY and ACPI_SRAT_X2APIC_CPU_AFFINITY */
-
-#define ACPI_SRAT_CPU_ENABLED       (1)         /* 00: Use affinity structure */
+    UINT8                   Type;
+    UINT8                   Version;
+    UINT16                  Length;
+    UINT8                   Index;
+    UINT8                   Flags;
 
+} ACPI_IBFT_HEADER;
 
-/* 3: GICC Affinity (ACPI 5.1) */
+/* Values for Type field above */
 
-typedef struct acpi_srat_gicc_affinity
+enum AcpiIbftType
 {
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT32                  ProximityDomain;
-    UINT32                  AcpiProcessorUid;
-    UINT32                  Flags;
-    UINT32                  ClockDomain;
-
-} ACPI_SRAT_GICC_AFFINITY;
-
-/* Flags for ACPI_SRAT_GICC_AFFINITY */
-
-#define ACPI_SRAT_GICC_ENABLED     (1)         /* 00: Use affinity structure */
-
-
-/* 4: GCC ITS Affinity (ACPI 6.2) */
+    ACPI_IBFT_TYPE_NOT_USED         = 0,
+    ACPI_IBFT_TYPE_CONTROL          = 1,
+    ACPI_IBFT_TYPE_INITIATOR        = 2,
+    ACPI_IBFT_TYPE_NIC              = 3,
+    ACPI_IBFT_TYPE_TARGET           = 4,
+    ACPI_IBFT_TYPE_EXTENSIONS       = 5,
+    ACPI_IBFT_TYPE_RESERVED         = 6     /* 6 and greater are reserved */
+};
 
-typedef struct acpi_srat_gic_its_affinity
-{
-    ACPI_SUBTABLE_HEADER    Header;
-    UINT32                  ProximityDomain;
-    UINT16                  Reserved;
-    UINT32                  ItsId;
 
-} ACPI_SRAT_GIC_ITS_AFFINITY;
+/* IBFT subtables */
+
+typedef struct acpi_ibft_control
+{
+    ACPI_IBFT_HEADER        Header;
+    UINT16                  Extensions;
+    UINT16                  InitiatorOffset;
+    UINT16                  Nic0Offset;
+    UINT16                  Target0Offset;
+    UINT16                  Nic1Offset;
+    UINT16                  Target1Offset;
+
+} ACPI_IBFT_CONTROL;
+
+typedef struct acpi_ibft_initiator
+{
+    ACPI_IBFT_HEADER        Header;
+    UINT8                   SnsServer[16];
+    UINT8                   SlpServer[16];
+    UINT8                   PrimaryServer[16];
+    UINT8                   SecondaryServer[16];
+    UINT16                  NameLength;
+    UINT16                  NameOffset;
+
+} ACPI_IBFT_INITIATOR;
+
+typedef struct acpi_ibft_nic
+{
+    ACPI_IBFT_HEADER        Header;
+    UINT8                   IpAddress[16];
+    UINT8                   SubnetMaskPrefix;
+    UINT8                   Origin;
+    UINT8                   Gateway[16];
+    UINT8                   PrimaryDns[16];
+    UINT8                   SecondaryDns[16];
+    UINT8                   Dhcp[16];
+    UINT16                  Vlan;
+    UINT8                   MacAddress[6];
+    UINT16                  PciAddress;
+    UINT16                  NameLength;
+    UINT16                  NameOffset;
+
+} ACPI_IBFT_NIC;
+
+typedef struct acpi_ibft_target
+{
+    ACPI_IBFT_HEADER        Header;
+    UINT8                   TargetIpAddress[16];
+    UINT16                  TargetIpSocket;
+    UINT8                   TargetBootLun[8];
+    UINT8                   ChapType;
+    UINT8                   NicAssociation;
+    UINT16                  TargetNameLength;
+    UINT16                  TargetNameOffset;
+    UINT16                  ChapNameLength;
+    UINT16                  ChapNameOffset;
+    UINT16                  ChapSecretLength;
+    UINT16                  ChapSecretOffset;
+    UINT16                  ReverseChapNameLength;
+    UINT16                  ReverseChapNameOffset;
+    UINT16                  ReverseChapSecretLength;
+    UINT16                  ReverseChapSecretOffset;
+
+} ACPI_IBFT_TARGET;
 
 
 /* Reset to default packing */
index 7592bfa..3205ec9 100644 (file)
@@ -52,9 +52,6 @@
  * These tables are not consumed directly by the ACPICA subsystem, but are
  * included here to support device drivers and the AML disassembler.
  *
- * Generally, the tables in this file are defined by third-party specifications,
- * and are not defined directly by the ACPI specification itself.
- *
  ******************************************************************************/
 
 
  * file. Useful because they make it more difficult to inadvertently type in
  * the wrong signature.
  */
-#define ACPI_SIG_ASF            "ASF!"      /* Alert Standard Format table */
-#define ACPI_SIG_BOOT           "BOOT"      /* Simple Boot Flag Table */
-#define ACPI_SIG_CSRT           "CSRT"      /* Core System Resource Table */
-#define ACPI_SIG_DBG2           "DBG2"      /* Debug Port table type 2 */
-#define ACPI_SIG_DBGP           "DBGP"      /* Debug Port table */
-#define ACPI_SIG_DMAR           "DMAR"      /* DMA Remapping table */
-#define ACPI_SIG_HPET           "HPET"      /* High Precision Event Timer table */
-#define ACPI_SIG_IBFT           "IBFT"      /* iSCSI Boot Firmware Table */
 #define ACPI_SIG_IORT           "IORT"      /* IO Remapping Table */
 #define ACPI_SIG_IVRS           "IVRS"      /* I/O Virtualization Reporting Structure */
 #define ACPI_SIG_LPIT           "LPIT"      /* Low Power Idle Table */
+#define ACPI_SIG_MADT           "APIC"      /* Multiple APIC Description Table */
 #define ACPI_SIG_MCFG           "MCFG"      /* PCI Memory Mapped Configuration table */
 #define ACPI_SIG_MCHI           "MCHI"      /* Management Controller Host Interface table */
+#define ACPI_SIG_MPST           "MPST"      /* Memory Power State Table */
+#define ACPI_SIG_MSCT           "MSCT"      /* Maximum System Characteristics Table */
 #define ACPI_SIG_MSDM           "MSDM"      /* Microsoft Data Management Table */
 #define ACPI_SIG_MTMR           "MTMR"      /* MID Timer table */
+#define ACPI_SIG_NFIT           "NFIT"      /* NVDIMM Firmware Interface Table */
+#define ACPI_SIG_PCCT           "PCCT"      /* Platform Communications Channel Table */
+#define ACPI_SIG_PDTT           "PDTT"      /* Platform Debug Trigger Table */
+#define ACPI_SIG_PMTT           "PMTT"      /* Platform Memory Topology Table */
+#define ACPI_SIG_PPTT           "PPTT"      /* Processor Properties Topology Table */
+#define ACPI_SIG_RASF           "RASF"      /* RAS Feature table */
+#define ACPI_SIG_SBST           "SBST"      /* Smart Battery Specification Table */
 #define ACPI_SIG_SDEI           "SDEI"      /* Software Delegated Exception Interface Table */
-#define ACPI_SIG_SLIC           "SLIC"      /* Software Licensing Description Table */
-#define ACPI_SIG_SPCR           "SPCR"      /* Serial Port Console Redirection table */
-#define ACPI_SIG_SPMI           "SPMI"      /* Server Platform Management Interface table */
-#define ACPI_SIG_TCPA           "TCPA"      /* Trusted Computing Platform Alliance table */
-#define ACPI_SIG_TPM2           "TPM2"      /* Trusted Platform Module 2.0 H/W interface table */
-#define ACPI_SIG_UEFI           "UEFI"      /* Uefi Boot Optimization Table */
-#define ACPI_SIG_VRTC           "VRTC"      /* Virtual Real Time Clock Table */
-#define ACPI_SIG_WAET           "WAET"      /* Windows ACPI Emulated devices Table */
-#define ACPI_SIG_WDAT           "WDAT"      /* Watchdog Action Table */
-#define ACPI_SIG_WDDT           "WDDT"      /* Watchdog Timer Description Table */
-#define ACPI_SIG_WDRT           "WDRT"      /* Watchdog Resource Table */
-#define ACPI_SIG_WSMT           "WSMT"      /* Windows SMM Security Migrations Table */
-#define ACPI_SIG_XXXX           "XXXX"      /* Intermediate AML header for ASL/ASL+ converter */
-
-#ifdef ACPI_UNDEFINED_TABLES
-/*
- * These tables have been seen in the field, but no definition has been found
- */
-#define ACPI_SIG_ATKG           "ATKG"
-#define ACPI_SIG_GSCI           "GSCI"      /* GMCH SCI table */
-#define ACPI_SIG_IEIT           "IEIT"
-#endif
+#define ACPI_SIG_SDEV           "SDEV"      /* Secure Devices table */
+
 
 /*
  * All tables must be byte-packed to match the ACPI specification, since
 
 /*******************************************************************************
  *
- * ASF - Alert Standard Format table (Signature "ASF!")
- *       Revision 0x10
+ * IORT - IO Remapping Table
  *
- * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
+ * Conforms to "IO Remapping Table System Software on ARM Platforms",
+ * Document number: ARM DEN 0049D, March 2018
  *
  ******************************************************************************/
 
-typedef struct acpi_table_asf
+typedef struct acpi_table_iort
 {
-    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-
-} ACPI_TABLE_ASF;
+    ACPI_TABLE_HEADER       Header;
+    UINT32                  NodeCount;
+    UINT32                  NodeOffset;
+    UINT32                  Reserved;
 
+} ACPI_TABLE_IORT;
 
-/* ASF subtable header */
 
-typedef struct acpi_asf_header
+/*
+ * IORT subtables
+ */
+typedef struct acpi_iort_node
 {
     UINT8                   Type;
-    UINT8                   Reserved;
     UINT16                  Length;
+    UINT8                   Revision;
+    UINT32                  Reserved;
+    UINT32                  MappingCount;
+    UINT32                  MappingOffset;
+    char                    NodeData[1];
 
-} ACPI_ASF_HEADER;
-
+} ACPI_IORT_NODE;
 
-/* Values for Type field above */
+/* Values for subtable Type above */
 
-enum AcpiAsfType
+enum AcpiIortNodeType
 {
-    ACPI_ASF_TYPE_INFO          = 0,
-    ACPI_ASF_TYPE_ALERT         = 1,
-    ACPI_ASF_TYPE_CONTROL       = 2,
-    ACPI_ASF_TYPE_BOOT          = 3,
-    ACPI_ASF_TYPE_ADDRESS       = 4,
-    ACPI_ASF_TYPE_RESERVED      = 5
+    ACPI_IORT_NODE_ITS_GROUP            = 0x00,
+    ACPI_IORT_NODE_NAMED_COMPONENT      = 0x01,
+    ACPI_IORT_NODE_PCI_ROOT_COMPLEX     = 0x02,
+    ACPI_IORT_NODE_SMMU                 = 0x03,
+    ACPI_IORT_NODE_SMMU_V3              = 0x04,
+    ACPI_IORT_NODE_PMCG                 = 0x05
 };
 
-/*
- * ASF subtables
- */
-
-/* 0: ASF Information */
 
-typedef struct acpi_asf_info
+typedef struct acpi_iort_id_mapping
 {
-    ACPI_ASF_HEADER         Header;
-    UINT8                   MinResetValue;
-    UINT8                   MinPollInterval;
-    UINT16                  SystemId;
-    UINT32                  MfgId;
-    UINT8                   Flags;
-    UINT8                   Reserved2[3];
-
-} ACPI_ASF_INFO;
-
-/* Masks for Flags field above */
-
-#define ACPI_ASF_SMBUS_PROTOCOLS    (1)
+    UINT32                  InputBase;          /* Lowest value in input range */
+    UINT32                  IdCount;            /* Number of IDs */
+    UINT32                  OutputBase;         /* Lowest value in output range */
+    UINT32                  OutputReference;    /* A reference to the output node */
+    UINT32                  Flags;
 
+} ACPI_IORT_ID_MAPPING;
 
-/* 1: ASF Alerts */
+/* Masks for Flags field above for IORT subtable */
 
-typedef struct acpi_asf_alert
-{
-    ACPI_ASF_HEADER         Header;
-    UINT8                   AssertMask;
-    UINT8                   DeassertMask;
-    UINT8                   Alerts;
-    UINT8                   DataLength;
+#define ACPI_IORT_ID_SINGLE_MAPPING (1)
 
-} ACPI_ASF_ALERT;
 
-typedef struct acpi_asf_alert_data
+typedef struct acpi_iort_memory_access
 {
-    UINT8                   Address;
-    UINT8                   Command;
-    UINT8                   Mask;
-    UINT8                   Value;
-    UINT8                   SensorType;
-    UINT8                   Type;
-    UINT8                   Offset;
-    UINT8                   SourceType;
-    UINT8                   Severity;
-    UINT8                   SensorNumber;
-    UINT8                   Entity;
-    UINT8                   Instance;
-
-} ACPI_ASF_ALERT_DATA;
+    UINT32                  CacheCoherency;
+    UINT8                   Hints;
+    UINT16                  Reserved;
+    UINT8                   MemoryFlags;
 
+} ACPI_IORT_MEMORY_ACCESS;
 
-/* 2: ASF Remote Control */
+/* Values for CacheCoherency field above */
 
-typedef struct acpi_asf_remote
-{
-    ACPI_ASF_HEADER         Header;
-    UINT8                   Controls;
-    UINT8                   DataLength;
-    UINT16                  Reserved2;
+#define ACPI_IORT_NODE_COHERENT         0x00000001  /* The device node is fully coherent */
+#define ACPI_IORT_NODE_NOT_COHERENT     0x00000000  /* The device node is not coherent */
 
-} ACPI_ASF_REMOTE;
+/* Masks for Hints field above */
 
-typedef struct acpi_asf_control_data
-{
-    UINT8                   Function;
-    UINT8                   Address;
-    UINT8                   Command;
-    UINT8                   Value;
+#define ACPI_IORT_HT_TRANSIENT          (1)
+#define ACPI_IORT_HT_WRITE              (1<<1)
+#define ACPI_IORT_HT_READ               (1<<2)
+#define ACPI_IORT_HT_OVERRIDE           (1<<3)
 
-} ACPI_ASF_CONTROL_DATA;
+/* Masks for MemoryFlags field above */
 
+#define ACPI_IORT_MF_COHERENCY          (1)
+#define ACPI_IORT_MF_ATTRIBUTES         (1<<1)
 
-/* 3: ASF RMCP Boot Options */
 
-typedef struct acpi_asf_rmcp
+/*
+ * IORT node specific subtables
+ */
+typedef struct acpi_iort_its_group
 {
-    ACPI_ASF_HEADER         Header;
-    UINT8                   Capabilities[7];
-    UINT8                   CompletionCode;
-    UINT32                  EnterpriseId;
-    UINT8                   Command;
-    UINT16                  Parameter;
-    UINT16                  BootOptions;
-    UINT16                  OemParameters;
-
-} ACPI_ASF_RMCP;
+    UINT32                  ItsCount;
+    UINT32                  Identifiers[1];         /* GIC ITS identifier arrary */
 
+} ACPI_IORT_ITS_GROUP;
 
-/* 4: ASF Address */
 
-typedef struct acpi_asf_address
+typedef struct acpi_iort_named_component
 {
-    ACPI_ASF_HEADER         Header;
-    UINT8                   EpromAddress;
-    UINT8                   Devices;
+    UINT32                  NodeFlags;
+    UINT64                  MemoryProperties;       /* Memory access properties */
+    UINT8                   MemoryAddressLimit;     /* Memory address size limit */
+    char                    DeviceName[1];          /* Path of namespace object */
 
-} ACPI_ASF_ADDRESS;
+} ACPI_IORT_NAMED_COMPONENT;
 
+/* Masks for Flags field above */
 
-/*******************************************************************************
- *
- * BOOT - Simple Boot Flag Table
- *        Version 1
- *
- * Conforms to the "Simple Boot Flag Specification", Version 2.1
- *
- ******************************************************************************/
+#define ACPI_IORT_NC_STALL_SUPPORTED    (1)
+#define ACPI_IORT_NC_PASID_BITS         (31<<1)
 
-typedef struct acpi_table_boot
+typedef struct acpi_iort_root_complex
 {
-    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT8                   CmosIndex;          /* Index in CMOS RAM for the boot register */
-    UINT8                   Reserved[3];
+    UINT64                  MemoryProperties;       /* Memory access properties */
+    UINT32                  AtsAttribute;
+    UINT32                  PciSegmentNumber;
+    UINT8                   MemoryAddressLimit;     /* Memory address size limit */
+    UINT8                   Reserved[3];            /* Reserved, must be zero */
 
-} ACPI_TABLE_BOOT;
+} ACPI_IORT_ROOT_COMPLEX;
 
+/* Values for AtsAttribute field above */
 
-/*******************************************************************************
- *
- * CSRT - Core System Resource Table
- *        Version 0
- *
- * Conforms to the "Core System Resource Table (CSRT)", November 14, 2011
- *
- ******************************************************************************/
+#define ACPI_IORT_ATS_SUPPORTED         0x00000001  /* The root complex supports ATS */
+#define ACPI_IORT_ATS_UNSUPPORTED       0x00000000  /* The root complex doesn't support ATS */
 
-typedef struct acpi_table_csrt
-{
-    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
 
-} ACPI_TABLE_CSRT;
+typedef struct acpi_iort_smmu
+{
+    UINT64                  BaseAddress;            /* SMMU base address */
+    UINT64                  Span;                   /* Length of memory range */
+    UINT32                  Model;
+    UINT32                  Flags;
+    UINT32                  GlobalInterruptOffset;
+    UINT32                  ContextInterruptCount;
+    UINT32                  ContextInterruptOffset;
+    UINT32                  PmuInterruptCount;
+    UINT32                  PmuInterruptOffset;
+    UINT64                  Interrupts[1];          /* Interrupt array */
 
+} ACPI_IORT_SMMU;
 
-/* Resource Group subtable */
+/* Values for Model field above */
 
-typedef struct acpi_csrt_group
-{
-    UINT32                  Length;
-    UINT32                  VendorId;
-    UINT32                  SubvendorId;
-    UINT16                  DeviceId;
-    UINT16                  SubdeviceId;
-    UINT16                  Revision;
-    UINT16                  Reserved;
-    UINT32                  SharedInfoLength;
+#define ACPI_IORT_SMMU_V1               0x00000000  /* Generic SMMUv1 */
+#define ACPI_IORT_SMMU_V2               0x00000001  /* Generic SMMUv2 */
+#define ACPI_IORT_SMMU_CORELINK_MMU400  0x00000002  /* ARM Corelink MMU-400 */
+#define ACPI_IORT_SMMU_CORELINK_MMU500  0x00000003  /* ARM Corelink MMU-500 */
+#define ACPI_IORT_SMMU_CORELINK_MMU401  0x00000004  /* ARM Corelink MMU-401 */
+#define ACPI_IORT_SMMU_CAVIUM_THUNDERX  0x00000005  /* Cavium ThunderX SMMUv2 */
 
-    /* Shared data immediately follows (Length = SharedInfoLength) */
+/* Masks for Flags field above */
 
-} ACPI_CSRT_GROUP;
+#define ACPI_IORT_SMMU_DVM_SUPPORTED    (1)
+#define ACPI_IORT_SMMU_COHERENT_WALK    (1<<1)
 
-/* Shared Info subtable */
+/* Global interrupt format */
 
-typedef struct acpi_csrt_shared_info
+typedef struct acpi_iort_smmu_gsi
 {
-    UINT16                  MajorVersion;
-    UINT16                  MinorVersion;
-    UINT32                  MmioBaseLow;
-    UINT32                  MmioBaseHigh;
-    UINT32                  GsiInterrupt;
-    UINT8                   InterruptPolarity;
-    UINT8                   InterruptMode;
-    UINT8                   NumChannels;
-    UINT8                   DmaAddressWidth;
-    UINT16                  BaseRequestLine;
-    UINT16                  NumHandshakeSignals;
-    UINT32                  MaxBlockSize;
-
-    /* Resource descriptors immediately follow (Length = Group Length - SharedInfoLength) */
+    UINT32                  NSgIrpt;
+    UINT32                  NSgIrptFlags;
+    UINT32                  NSgCfgIrpt;
+    UINT32                  NSgCfgIrptFlags;
 
-} ACPI_CSRT_SHARED_INFO;
+} ACPI_IORT_SMMU_GSI;
 
-/* Resource Descriptor subtable */
 
-typedef struct acpi_csrt_descriptor
+typedef struct acpi_iort_smmu_v3
 {
-    UINT32                  Length;
-    UINT16                  Type;
-    UINT16                  Subtype;
-    UINT32                  Uid;
+    UINT64                  BaseAddress;            /* SMMUv3 base address */
+    UINT32                  Flags;
+    UINT32                  Reserved;
+    UINT64                  VatosAddress;
+    UINT32                  Model;
+    UINT32                  EventGsiv;
+    UINT32                  PriGsiv;
+    UINT32                  GerrGsiv;
+    UINT32                  SyncGsiv;
+    UINT32                  Pxm;
+    UINT32                  IdMappingIndex;
 
-    /* Resource-specific information immediately follows */
+} ACPI_IORT_SMMU_V3;
 
-} ACPI_CSRT_DESCRIPTOR;
+/* Values for Model field above */
 
+#define ACPI_IORT_SMMU_V3_GENERIC           0x00000000  /* Generic SMMUv3 */
+#define ACPI_IORT_SMMU_V3_HISILICON_HI161X  0x00000001  /* HiSilicon Hi161x SMMUv3 */
+#define ACPI_IORT_SMMU_V3_CAVIUM_CN99XX     0x00000002  /* Cavium CN99xx SMMUv3 */
 
-/* Resource Types */
+/* Masks for Flags field above */
 
-#define ACPI_CSRT_TYPE_INTERRUPT    0x0001
-#define ACPI_CSRT_TYPE_TIMER        0x0002
-#define ACPI_CSRT_TYPE_DMA          0x0003
+#define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE   (1)
+#define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE     (3<<1)
+#define ACPI_IORT_SMMU_V3_PXM_VALID         (1<<3)
 
-/* Resource Subtypes */
+typedef struct acpi_iort_pmcg
+{
+    UINT64                  Page0BaseAddress;
+    UINT32                  OverflowGsiv;
+    UINT32                  NodeReference;
+    UINT64                  Page1BaseAddress;
 
-#define ACPI_CSRT_XRUPT_LINE        0x0000
-#define ACPI_CSRT_XRUPT_CONTROLLER  0x0001
-#define ACPI_CSRT_TIMER             0x0000
-#define ACPI_CSRT_DMA_CHANNEL       0x0000
-#define ACPI_CSRT_DMA_CONTROLLER    0x0001
+} ACPI_IORT_PMCG;
 
 
 /*******************************************************************************
  *
- * DBG2 - Debug Port Table 2
- *        Version 0 (Both main table and subtables)
+ * IVRS - I/O Virtualization Reporting Structure
+ *        Version 1
  *
- * Conforms to "Microsoft Debug Port Table 2 (DBG2)", December 10, 2015
+ * Conforms to "AMD I/O Virtualization Technology (IOMMU) Specification",
+ * Revision 1.26, February 2009.
  *
  ******************************************************************************/
 
-typedef struct acpi_table_dbg2
+typedef struct acpi_table_ivrs
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT32                  InfoOffset;
-    UINT32                  InfoCount;
-
-} ACPI_TABLE_DBG2;
+    UINT32                  Info;               /* Common virtualization info */
+    UINT64                  Reserved;
 
+} ACPI_TABLE_IVRS;
 
-typedef struct acpi_dbg2_header
-{
-    UINT32                  InfoOffset;
-    UINT32                  InfoCount;
+/* Values for Info field above */
 
-} ACPI_DBG2_HEADER;
+#define ACPI_IVRS_PHYSICAL_SIZE     0x00007F00  /* 7 bits, physical address size */
+#define ACPI_IVRS_VIRTUAL_SIZE      0x003F8000  /* 7 bits, virtual address size */
+#define ACPI_IVRS_ATS_RESERVED      0x00400000  /* ATS address translation range reserved */
 
 
-/* Debug Device Information Subtable */
+/* IVRS subtable header */
 
-typedef struct acpi_dbg2_device
+typedef struct acpi_ivrs_header
 {
-    UINT8                   Revision;
-    UINT16                  Length;
-    UINT8                   RegisterCount;      /* Number of BaseAddress registers */
-    UINT16                  NamepathLength;
-    UINT16                  NamepathOffset;
-    UINT16                  OemDataLength;
-    UINT16                  OemDataOffset;
-    UINT16                  PortType;
-    UINT16                  PortSubtype;
-    UINT16                  Reserved;
-    UINT16                  BaseAddressOffset;
-    UINT16                  AddressSizeOffset;
-    /*
-     * Data that follows:
-     *    BaseAddress (required) - Each in 12-byte Generic Address Structure format.
-     *    AddressSize (required) - Array of UINT32 sizes corresponding to each BaseAddress register.
-     *    Namepath    (required) - Null terminated string. Single dot if not supported.
-     *    OemData     (optional) - Length is OemDataLength.
-     */
-} ACPI_DBG2_DEVICE;
-
-/* Types for PortType field above */
-
-#define ACPI_DBG2_SERIAL_PORT       0x8000
-#define ACPI_DBG2_1394_PORT         0x8001
-#define ACPI_DBG2_USB_PORT          0x8002
-#define ACPI_DBG2_NET_PORT          0x8003
+    UINT8                   Type;               /* Subtable type */
+    UINT8                   Flags;
+    UINT16                  Length;             /* Subtable length */
+    UINT16                  DeviceId;           /* ID of IOMMU */
 
-/* Subtypes for PortSubtype field above */
+} ACPI_IVRS_HEADER;
 
-#define ACPI_DBG2_16550_COMPATIBLE  0x0000
-#define ACPI_DBG2_16550_SUBSET      0x0001
-#define ACPI_DBG2_ARM_PL011         0x0003
-#define ACPI_DBG2_ARM_SBSA_32BIT    0x000D
-#define ACPI_DBG2_ARM_SBSA_GENERIC  0x000E
-#define ACPI_DBG2_ARM_DCC           0x000F
-#define ACPI_DBG2_BCM2835           0x0010
+/* Values for subtable Type above */
 
-#define ACPI_DBG2_1394_STANDARD     0x0000
+enum AcpiIvrsType
+{
+    ACPI_IVRS_TYPE_HARDWARE         = 0x10,
+    ACPI_IVRS_TYPE_MEMORY1          = 0x20,
+    ACPI_IVRS_TYPE_MEMORY2          = 0x21,
+    ACPI_IVRS_TYPE_MEMORY3          = 0x22
+};
 
-#define ACPI_DBG2_USB_XHCI          0x0000
-#define ACPI_DBG2_USB_EHCI          0x0001
+/* Masks for Flags field above for IVHD subtable */
 
+#define ACPI_IVHD_TT_ENABLE         (1)
+#define ACPI_IVHD_PASS_PW           (1<<1)
+#define ACPI_IVHD_RES_PASS_PW       (1<<2)
+#define ACPI_IVHD_ISOC              (1<<3)
+#define ACPI_IVHD_IOTLB             (1<<4)
 
-/*******************************************************************************
- *
- * DBGP - Debug Port table
- *        Version 1
- *
- * Conforms to the "Debug Port Specification", Version 1.00, 2/9/2000
- *
- ******************************************************************************/
+/* Masks for Flags field above for IVMD subtable */
 
-typedef struct acpi_table_dbgp
-{
-    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT8                   Type;               /* 0=full 16550, 1=subset of 16550 */
-    UINT8                   Reserved[3];
-    ACPI_GENERIC_ADDRESS    DebugPort;
+#define ACPI_IVMD_UNITY             (1)
+#define ACPI_IVMD_READ              (1<<1)
+#define ACPI_IVMD_WRITE             (1<<2)
+#define ACPI_IVMD_EXCLUSION_RANGE   (1<<3)
 
-} ACPI_TABLE_DBGP;
 
+/*
+ * IVRS subtables, correspond to Type in ACPI_IVRS_HEADER
+ */
 
-/*******************************************************************************
- *
- * DMAR - DMA Remapping table
- *        Version 1
- *
- * Conforms to "Intel Virtualization Technology for Directed I/O",
- * Version 2.3, October 2014
- *
- ******************************************************************************/
+/* 0x10: I/O Virtualization Hardware Definition Block (IVHD) */
 
-typedef struct acpi_table_dmar
+typedef struct acpi_ivrs_hardware
 {
-    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT8                   Width;              /* Host Address Width */
-    UINT8                   Flags;
-    UINT8                   Reserved[10];
-
-} ACPI_TABLE_DMAR;
+    ACPI_IVRS_HEADER        Header;
+    UINT16                  CapabilityOffset;   /* Offset for IOMMU control fields */
+    UINT64                  BaseAddress;        /* IOMMU control registers */
+    UINT16                  PciSegmentGroup;
+    UINT16                  Info;               /* MSI number and unit ID */
+    UINT32                  Reserved;
 
-/* Masks for Flags field above */
+} ACPI_IVRS_HARDWARE;
 
-#define ACPI_DMAR_INTR_REMAP        (1)
-#define ACPI_DMAR_X2APIC_OPT_OUT    (1<<1)
-#define ACPI_DMAR_X2APIC_MODE       (1<<2)
+/* Masks for Info field above */
 
+#define ACPI_IVHD_MSI_NUMBER_MASK   0x001F      /* 5 bits, MSI message number */
+#define ACPI_IVHD_UNIT_ID_MASK      0x1F00      /* 5 bits, UnitID */
 
-/* DMAR subtable header */
 
-typedef struct acpi_dmar_header
-{
-    UINT16                  Type;
-    UINT16                  Length;
-
-} ACPI_DMAR_HEADER;
+/*
+ * Device Entries for IVHD subtable, appear after ACPI_IVRS_HARDWARE structure.
+ * Upper two bits of the Type field are the (encoded) length of the structure.
+ * Currently, only 4 and 8 byte entries are defined. 16 and 32 byte entries
+ * are reserved for future use but not defined.
+ */
+typedef struct acpi_ivrs_de_header
+{
+    UINT8                   Type;
+    UINT16                  Id;
+    UINT8                   DataSetting;
 
-/* Values for subtable type in ACPI_DMAR_HEADER */
+} ACPI_IVRS_DE_HEADER;
 
-enum AcpiDmarType
-{
-    ACPI_DMAR_TYPE_HARDWARE_UNIT        = 0,
-    ACPI_DMAR_TYPE_RESERVED_MEMORY      = 1,
-    ACPI_DMAR_TYPE_ROOT_ATS             = 2,
-    ACPI_DMAR_TYPE_HARDWARE_AFFINITY    = 3,
-    ACPI_DMAR_TYPE_NAMESPACE            = 4,
-    ACPI_DMAR_TYPE_RESERVED             = 5     /* 5 and greater are reserved */
-};
+/* Length of device entry is in the top two bits of Type field above */
 
+#define ACPI_IVHD_ENTRY_LENGTH      0xC0
 
-/* DMAR Device Scope structure */
+/* Values for device entry Type field above */
 
-typedef struct acpi_dmar_device_scope
+enum AcpiIvrsDeviceEntryType
 {
-    UINT8                   EntryType;
-    UINT8                   Length;
-    UINT16                  Reserved;
-    UINT8                   EnumerationId;
-    UINT8                   Bus;
+    /* 4-byte device entries, all use ACPI_IVRS_DEVICE4 */
 
-} ACPI_DMAR_DEVICE_SCOPE;
+    ACPI_IVRS_TYPE_PAD4             = 0,
+    ACPI_IVRS_TYPE_ALL              = 1,
+    ACPI_IVRS_TYPE_SELECT           = 2,
+    ACPI_IVRS_TYPE_START            = 3,
+    ACPI_IVRS_TYPE_END              = 4,
 
-/* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE - device types */
+    /* 8-byte device entries */
 
-enum AcpiDmarScopeType
-{
-    ACPI_DMAR_SCOPE_TYPE_NOT_USED       = 0,
-    ACPI_DMAR_SCOPE_TYPE_ENDPOINT       = 1,
-    ACPI_DMAR_SCOPE_TYPE_BRIDGE         = 2,
-    ACPI_DMAR_SCOPE_TYPE_IOAPIC         = 3,
-    ACPI_DMAR_SCOPE_TYPE_HPET           = 4,
-    ACPI_DMAR_SCOPE_TYPE_NAMESPACE      = 5,
-    ACPI_DMAR_SCOPE_TYPE_RESERVED       = 6     /* 6 and greater are reserved */
+    ACPI_IVRS_TYPE_PAD8             = 64,
+    ACPI_IVRS_TYPE_NOT_USED         = 65,
+    ACPI_IVRS_TYPE_ALIAS_SELECT     = 66, /* Uses ACPI_IVRS_DEVICE8A */
+    ACPI_IVRS_TYPE_ALIAS_START      = 67, /* Uses ACPI_IVRS_DEVICE8A */
+    ACPI_IVRS_TYPE_EXT_SELECT       = 70, /* Uses ACPI_IVRS_DEVICE8B */
+    ACPI_IVRS_TYPE_EXT_START        = 71, /* Uses ACPI_IVRS_DEVICE8B */
+    ACPI_IVRS_TYPE_SPECIAL          = 72  /* Uses ACPI_IVRS_DEVICE8C */
 };
 
-typedef struct acpi_dmar_pci_path
-{
-    UINT8                   Device;
-    UINT8                   Function;
-
-} ACPI_DMAR_PCI_PATH;
+/* Values for Data field above */
 
+#define ACPI_IVHD_INIT_PASS         (1)
+#define ACPI_IVHD_EINT_PASS         (1<<1)
+#define ACPI_IVHD_NMI_PASS          (1<<2)
+#define ACPI_IVHD_SYSTEM_MGMT       (3<<4)
+#define ACPI_IVHD_LINT0_PASS        (1<<6)
+#define ACPI_IVHD_LINT1_PASS        (1<<7)
 
-/*
- * DMAR Subtables, correspond to Type in ACPI_DMAR_HEADER
- */
 
-/* 0: Hardware Unit Definition */
+/* Types 0-4: 4-byte device entry */
 
-typedef struct acpi_dmar_hardware_unit
+typedef struct acpi_ivrs_device4
 {
-    ACPI_DMAR_HEADER        Header;
-    UINT8                   Flags;
-    UINT8                   Reserved;
-    UINT16                  Segment;
-    UINT64                  Address;            /* Register Base Address */
+    ACPI_IVRS_DE_HEADER     Header;
 
-} ACPI_DMAR_HARDWARE_UNIT;
+} ACPI_IVRS_DEVICE4;
 
-/* Masks for Flags field above */
+/* Types 66-67: 8-byte device entry */
 
-#define ACPI_DMAR_INCLUDE_ALL       (1)
+typedef struct acpi_ivrs_device8a
+{
+    ACPI_IVRS_DE_HEADER     Header;
+    UINT8                   Reserved1;
+    UINT16                  UsedId;
+    UINT8                   Reserved2;
 
+} ACPI_IVRS_DEVICE8A;
 
-/* 1: Reserved Memory Defininition */
+/* Types 70-71: 8-byte device entry */
 
-typedef struct acpi_dmar_reserved_memory
+typedef struct acpi_ivrs_device8b
 {
-    ACPI_DMAR_HEADER        Header;
-    UINT16                  Reserved;
-    UINT16                  Segment;
-    UINT64                  BaseAddress;        /* 4K aligned base address */
-    UINT64                  EndAddress;         /* 4K aligned limit address */
-
-} ACPI_DMAR_RESERVED_MEMORY;
+    ACPI_IVRS_DE_HEADER     Header;
+    UINT32                  ExtendedData;
 
-/* Masks for Flags field above */
+} ACPI_IVRS_DEVICE8B;
 
-#define ACPI_DMAR_ALLOW_ALL         (1)
+/* Values for ExtendedData above */
 
+#define ACPI_IVHD_ATS_DISABLED      (1<<31)
 
-/* 2: Root Port ATS Capability Reporting Structure */
+/* Type 72: 8-byte device entry */
 
-typedef struct acpi_dmar_atsr
+typedef struct acpi_ivrs_device8c
 {
-    ACPI_DMAR_HEADER        Header;
-    UINT8                   Flags;
-    UINT8                   Reserved;
-    UINT16                  Segment;
-
-} ACPI_DMAR_ATSR;
-
-/* Masks for Flags field above */
-
-#define ACPI_DMAR_ALL_PORTS         (1)
-
+    ACPI_IVRS_DE_HEADER     Header;
+    UINT8                   Handle;
+    UINT16                  UsedId;
+    UINT8                   Variety;
 
-/* 3: Remapping Hardware Static Affinity Structure */
+} ACPI_IVRS_DEVICE8C;
 
-typedef struct acpi_dmar_rhsa
-{
-    ACPI_DMAR_HEADER        Header;
-    UINT32                  Reserved;
-    UINT64                  BaseAddress;
-    UINT32                  ProximityDomain;
+/* Values for Variety field above */
 
-} ACPI_DMAR_RHSA;
+#define ACPI_IVHD_IOAPIC            1
+#define ACPI_IVHD_HPET              2
 
 
-/* 4: ACPI Namespace Device Declaration Structure */
+/* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition Block (IVMD) */
 
-typedef struct acpi_dmar_andd
+typedef struct acpi_ivrs_memory
 {
-    ACPI_DMAR_HEADER        Header;
-    UINT8                   Reserved[3];
-    UINT8                   DeviceNumber;
-    char                    DeviceName[1];
+    ACPI_IVRS_HEADER        Header;
+    UINT16                  AuxData;
+    UINT64                  Reserved;
+    UINT64                  StartAddress;
+    UINT64                  MemoryLength;
 
-} ACPI_DMAR_ANDD;
+} ACPI_IVRS_MEMORY;
 
 
 /*******************************************************************************
  *
- * HPET - High Precision Event Timer table
- *        Version 1
+ * LPIT - Low Power Idle Table
  *
- * Conforms to "IA-PC HPET (High Precision Event Timers) Specification",
- * Version 1.0a, October 2004
+ * Conforms to "ACPI Low Power Idle Table (LPIT)" July 2014.
  *
  ******************************************************************************/
 
-typedef struct acpi_table_hpet
+typedef struct acpi_table_lpit
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT32                  Id;                 /* Hardware ID of event timer block */
-    ACPI_GENERIC_ADDRESS    Address;            /* Address of event timer block */
-    UINT8                   Sequence;           /* HPET sequence number */
-    UINT16                  MinimumTick;        /* Main counter min tick, periodic mode */
-    UINT8                   Flags;
 
-} ACPI_TABLE_HPET;
+} ACPI_TABLE_LPIT;
 
-/* Masks for Flags field above */
 
-#define ACPI_HPET_PAGE_PROTECT_MASK (3)
+/* LPIT subtable header */
+
+typedef struct acpi_lpit_header
+{
+    UINT32                  Type;               /* Subtable type */
+    UINT32                  Length;             /* Subtable length */
+    UINT16                  UniqueId;
+    UINT16                  Reserved;
+    UINT32                  Flags;
+
+} ACPI_LPIT_HEADER;
 
-/* Values for Page Protect flags */
+/* Values for subtable Type above */
 
-enum AcpiHpetPageProtect
+enum AcpiLpitType
 {
-    ACPI_HPET_NO_PAGE_PROTECT       = 0,
-    ACPI_HPET_PAGE_PROTECT4         = 1,
-    ACPI_HPET_PAGE_PROTECT64        = 2
+    ACPI_LPIT_TYPE_NATIVE_CSTATE    = 0x00,
+    ACPI_LPIT_TYPE_RESERVED         = 0x01      /* 1 and above are reserved */
 };
 
+/* Masks for Flags field above  */
+
+#define ACPI_LPIT_STATE_DISABLED    (1)
+#define ACPI_LPIT_NO_COUNTER        (1<<1)
+
+/*
+ * LPIT subtables, correspond to Type in ACPI_LPIT_HEADER
+ */
+
+/* 0x00: Native C-state instruction based LPI structure */
+
+typedef struct acpi_lpit_native
+{
+    ACPI_LPIT_HEADER        Header;
+    ACPI_GENERIC_ADDRESS    EntryTrigger;
+    UINT32                  Residency;
+    UINT32                  Latency;
+    ACPI_GENERIC_ADDRESS    ResidencyCounter;
+    UINT64                  CounterFrequency;
+
+} ACPI_LPIT_NATIVE;
+
 
 /*******************************************************************************
  *
- * IBFT - Boot Firmware Table
- *        Version 1
- *
- * Conforms to "iSCSI Boot Firmware Table (iBFT) as Defined in ACPI 3.0b
- * Specification", Version 1.01, March 1, 2007
- *
- * Note: It appears that this table is not intended to appear in the RSDT/XSDT.
- * Therefore, it is not currently supported by the disassembler.
+ * MADT - Multiple APIC Description Table
+ *        Version 3
  *
  ******************************************************************************/
 
-typedef struct acpi_table_ibft
+typedef struct acpi_table_madt
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT8                   Reserved[12];
+    UINT32                  Address;            /* Physical address of local APIC */
+    UINT32                  Flags;
 
-} ACPI_TABLE_IBFT;
+} ACPI_TABLE_MADT;
 
+/* Masks for Flags field above */
 
-/* IBFT common subtable header */
+#define ACPI_MADT_PCAT_COMPAT       (1)         /* 00: System also has dual 8259s */
 
-typedef struct acpi_ibft_header
-{
-    UINT8                   Type;
-    UINT8                   Version;
-    UINT16                  Length;
-    UINT8                   Index;
-    UINT8                   Flags;
+/* Values for PCATCompat flag */
 
-} ACPI_IBFT_HEADER;
+#define ACPI_MADT_DUAL_PIC          1
+#define ACPI_MADT_MULTIPLE_APIC     0
 
-/* Values for Type field above */
 
-enum AcpiIbftType
+/* Values for MADT subtable type in ACPI_SUBTABLE_HEADER */
+
+enum AcpiMadtType
 {
-    ACPI_IBFT_TYPE_NOT_USED         = 0,
-    ACPI_IBFT_TYPE_CONTROL          = 1,
-    ACPI_IBFT_TYPE_INITIATOR        = 2,
-    ACPI_IBFT_TYPE_NIC              = 3,
-    ACPI_IBFT_TYPE_TARGET           = 4,
-    ACPI_IBFT_TYPE_EXTENSIONS       = 5,
-    ACPI_IBFT_TYPE_RESERVED         = 6     /* 6 and greater are reserved */
+    ACPI_MADT_TYPE_LOCAL_APIC               = 0,
+    ACPI_MADT_TYPE_IO_APIC                  = 1,
+    ACPI_MADT_TYPE_INTERRUPT_OVERRIDE       = 2,
+    ACPI_MADT_TYPE_NMI_SOURCE               = 3,
+    ACPI_MADT_TYPE_LOCAL_APIC_NMI           = 4,
+    ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE      = 5,
+    ACPI_MADT_TYPE_IO_SAPIC                 = 6,
+    ACPI_MADT_TYPE_LOCAL_SAPIC              = 7,
+    ACPI_MADT_TYPE_INTERRUPT_SOURCE         = 8,
+    ACPI_MADT_TYPE_LOCAL_X2APIC             = 9,
+    ACPI_MADT_TYPE_LOCAL_X2APIC_NMI         = 10,
+    ACPI_MADT_TYPE_GENERIC_INTERRUPT        = 11,
+    ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR      = 12,
+    ACPI_MADT_TYPE_GENERIC_MSI_FRAME        = 13,
+    ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR    = 14,
+    ACPI_MADT_TYPE_GENERIC_TRANSLATOR       = 15,
+    ACPI_MADT_TYPE_RESERVED                 = 16    /* 16 and greater are reserved */
 };
 
 
-/* IBFT subtables */
-
-typedef struct acpi_ibft_control
-{
-    ACPI_IBFT_HEADER        Header;
-    UINT16                  Extensions;
-    UINT16                  InitiatorOffset;
-    UINT16                  Nic0Offset;
-    UINT16                  Target0Offset;
-    UINT16                  Nic1Offset;
-    UINT16                  Target1Offset;
-
-} ACPI_IBFT_CONTROL;
-
-typedef struct acpi_ibft_initiator
-{
-    ACPI_IBFT_HEADER        Header;
-    UINT8                   SnsServer[16];
-    UINT8                   SlpServer[16];
-    UINT8                   PrimaryServer[16];
-    UINT8                   SecondaryServer[16];
-    UINT16                  NameLength;
-    UINT16                  NameOffset;
-
-} ACPI_IBFT_INITIATOR;
-
-typedef struct acpi_ibft_nic
-{
-    ACPI_IBFT_HEADER        Header;
-    UINT8                   IpAddress[16];
-    UINT8                   SubnetMaskPrefix;
-    UINT8                   Origin;
-    UINT8                   Gateway[16];
-    UINT8                   PrimaryDns[16];
-    UINT8                   SecondaryDns[16];
-    UINT8                   Dhcp[16];
-    UINT16                  Vlan;
-    UINT8                   MacAddress[6];
-    UINT16                  PciAddress;
-    UINT16                  NameLength;
-    UINT16                  NameOffset;
-
-} ACPI_IBFT_NIC;
-
-typedef struct acpi_ibft_target
-{
-    ACPI_IBFT_HEADER        Header;
-    UINT8                   TargetIpAddress[16];
-    UINT16                  TargetIpSocket;
-    UINT8                   TargetBootLun[8];
-    UINT8                   ChapType;
-    UINT8                   NicAssociation;
-    UINT16                  TargetNameLength;
-    UINT16                  TargetNameOffset;
-    UINT16                  ChapNameLength;
-    UINT16                  ChapNameOffset;
-    UINT16                  ChapSecretLength;
-    UINT16                  ChapSecretOffset;
-    UINT16                  ReverseChapNameLength;
-    UINT16                  ReverseChapNameOffset;
-    UINT16                  ReverseChapSecretLength;
-    UINT16                  ReverseChapSecretOffset;
-
-} ACPI_IBFT_TARGET;
-
+/*
+ * MADT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
+ */
 
-/*******************************************************************************
- *
- * IORT - IO Remapping Table
- *
- * Conforms to "IO Remapping Table System Software on ARM Platforms",
- * Document number: ARM DEN 0049C, May 2017
- *
- ******************************************************************************/
+/* 0: Processor Local APIC */
 
-typedef struct acpi_table_iort
+typedef struct acpi_madt_local_apic
 {
-    ACPI_TABLE_HEADER       Header;
-    UINT32                  NodeCount;
-    UINT32                  NodeOffset;
-    UINT32                  Reserved;
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT8                   ProcessorId;        /* ACPI processor id */
+    UINT8                   Id;                 /* Processor's local APIC id */
+    UINT32                  LapicFlags;
 
-} ACPI_TABLE_IORT;
+} ACPI_MADT_LOCAL_APIC;
 
 
-/*
- * IORT subtables
- */
-typedef struct acpi_iort_node
+/* 1: IO APIC */
+
+typedef struct acpi_madt_io_apic
 {
-    UINT8                   Type;
-    UINT16                  Length;
-    UINT8                   Revision;
-    UINT32                  Reserved;
-    UINT32                  MappingCount;
-    UINT32                  MappingOffset;
-    char                    NodeData[1];
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT8                   Id;                 /* I/O APIC ID */
+    UINT8                   Reserved;           /* Reserved - must be zero */
+    UINT32                  Address;            /* APIC physical address */
+    UINT32                  GlobalIrqBase;      /* Global system interrupt where INTI lines start */
 
-} ACPI_IORT_NODE;
+} ACPI_MADT_IO_APIC;
 
-/* Values for subtable Type above */
 
-enum AcpiIortNodeType
+/* 2: Interrupt Override */
+
+typedef struct acpi_madt_interrupt_override
 {
-    ACPI_IORT_NODE_ITS_GROUP            = 0x00,
-    ACPI_IORT_NODE_NAMED_COMPONENT      = 0x01,
-    ACPI_IORT_NODE_PCI_ROOT_COMPLEX     = 0x02,
-    ACPI_IORT_NODE_SMMU                 = 0x03,
-    ACPI_IORT_NODE_SMMU_V3              = 0x04
-};
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT8                   Bus;                /* 0 - ISA */
+    UINT8                   SourceIrq;          /* Interrupt source (IRQ) */
+    UINT32                  GlobalIrq;          /* Global system interrupt */
+    UINT16                  IntiFlags;
 
+} ACPI_MADT_INTERRUPT_OVERRIDE;
 
-typedef struct acpi_iort_id_mapping
-{
-    UINT32                  InputBase;          /* Lowest value in input range */
-    UINT32                  IdCount;            /* Number of IDs */
-    UINT32                  OutputBase;         /* Lowest value in output range */
-    UINT32                  OutputReference;    /* A reference to the output node */
-    UINT32                  Flags;
 
-} ACPI_IORT_ID_MAPPING;
+/* 3: NMI Source */
 
-/* Masks for Flags field above for IORT subtable */
+typedef struct acpi_madt_nmi_source
+{
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT16                  IntiFlags;
+    UINT32                  GlobalIrq;          /* Global system interrupt */
 
-#define ACPI_IORT_ID_SINGLE_MAPPING (1)
+} ACPI_MADT_NMI_SOURCE;
 
 
-typedef struct acpi_iort_memory_access
-{
-    UINT32                  CacheCoherency;
-    UINT8                   Hints;
-    UINT16                  Reserved;
-    UINT8                   MemoryFlags;
+/* 4: Local APIC NMI */
 
-} ACPI_IORT_MEMORY_ACCESS;
+typedef struct acpi_madt_local_apic_nmi
+{
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT8                   ProcessorId;        /* ACPI processor id */
+    UINT16                  IntiFlags;
+    UINT8                   Lint;               /* LINTn to which NMI is connected */
 
-/* Values for CacheCoherency field above */
+} ACPI_MADT_LOCAL_APIC_NMI;
 
-#define ACPI_IORT_NODE_COHERENT         0x00000001  /* The device node is fully coherent */
-#define ACPI_IORT_NODE_NOT_COHERENT     0x00000000  /* The device node is not coherent */
 
-/* Masks for Hints field above */
+/* 5: Address Override */
 
-#define ACPI_IORT_HT_TRANSIENT          (1)
-#define ACPI_IORT_HT_WRITE              (1<<1)
-#define ACPI_IORT_HT_READ               (1<<2)
-#define ACPI_IORT_HT_OVERRIDE           (1<<3)
+typedef struct acpi_madt_local_apic_override
+{
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT16                  Reserved;           /* Reserved, must be zero */
+    UINT64                  Address;            /* APIC physical address */
 
-/* Masks for MemoryFlags field above */
+} ACPI_MADT_LOCAL_APIC_OVERRIDE;
 
-#define ACPI_IORT_MF_COHERENCY          (1)
-#define ACPI_IORT_MF_ATTRIBUTES         (1<<1)
 
+/* 6: I/O Sapic */
 
-/*
- * IORT node specific subtables
- */
-typedef struct acpi_iort_its_group
+typedef struct acpi_madt_io_sapic
 {
-    UINT32                  ItsCount;
-    UINT32                  Identifiers[1];         /* GIC ITS identifier arrary */
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT8                   Id;                 /* I/O SAPIC ID */
+    UINT8                   Reserved;           /* Reserved, must be zero */
+    UINT32                  GlobalIrqBase;      /* Global interrupt for SAPIC start */
+    UINT64                  Address;            /* SAPIC physical address */
 
-} ACPI_IORT_ITS_GROUP;
+} ACPI_MADT_IO_SAPIC;
 
 
-typedef struct acpi_iort_named_component
+/* 7: Local Sapic */
+
+typedef struct acpi_madt_local_sapic
 {
-    UINT32                  NodeFlags;
-    UINT64                  MemoryProperties;       /* Memory access properties */
-    UINT8                   MemoryAddressLimit;     /* Memory address size limit */
-    char                    DeviceName[1];          /* Path of namespace object */
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT8                   ProcessorId;        /* ACPI processor id */
+    UINT8                   Id;                 /* SAPIC ID */
+    UINT8                   Eid;                /* SAPIC EID */
+    UINT8                   Reserved[3];        /* Reserved, must be zero */
+    UINT32                  LapicFlags;
+    UINT32                  Uid;                /* Numeric UID - ACPI 3.0 */
+    char                    UidString[1];       /* String UID  - ACPI 3.0 */
 
-} ACPI_IORT_NAMED_COMPONENT;
+} ACPI_MADT_LOCAL_SAPIC;
 
 
-typedef struct acpi_iort_root_complex
+/* 8: Platform Interrupt Source */
+
+typedef struct acpi_madt_interrupt_source
 {
-    UINT64                  MemoryProperties;       /* Memory access properties */
-    UINT32                  AtsAttribute;
-    UINT32                  PciSegmentNumber;
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT16                  IntiFlags;
+    UINT8                   Type;               /* 1=PMI, 2=INIT, 3=corrected */
+    UINT8                   Id;                 /* Processor ID */
+    UINT8                   Eid;                /* Processor EID */
+    UINT8                   IoSapicVector;      /* Vector value for PMI interrupts */
+    UINT32                  GlobalIrq;          /* Global system interrupt */
+    UINT32                  Flags;              /* Interrupt Source Flags */
 
-} ACPI_IORT_ROOT_COMPLEX;
+} ACPI_MADT_INTERRUPT_SOURCE;
 
-/* Values for AtsAttribute field above */
+/* Masks for Flags field above */
 
-#define ACPI_IORT_ATS_SUPPORTED         0x00000001  /* The root complex supports ATS */
-#define ACPI_IORT_ATS_UNSUPPORTED       0x00000000  /* The root complex doesn't support ATS */
+#define ACPI_MADT_CPEI_OVERRIDE     (1)
 
 
-typedef struct acpi_iort_smmu
+/* 9: Processor Local X2APIC (ACPI 4.0) */
+
+typedef struct acpi_madt_local_x2apic
 {
-    UINT64                  BaseAddress;            /* SMMU base address */
-    UINT64                  Span;                   /* Length of memory range */
-    UINT32                  Model;
-    UINT32                  Flags;
-    UINT32                  GlobalInterruptOffset;
-    UINT32                  ContextInterruptCount;
-    UINT32                  ContextInterruptOffset;
-    UINT32                  PmuInterruptCount;
-    UINT32                  PmuInterruptOffset;
-    UINT64                  Interrupts[1];          /* Interrupt array */
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT16                  Reserved;           /* Reserved - must be zero */
+    UINT32                  LocalApicId;        /* Processor x2APIC ID  */
+    UINT32                  LapicFlags;
+    UINT32                  Uid;                /* ACPI processor UID */
 
-} ACPI_IORT_SMMU;
+} ACPI_MADT_LOCAL_X2APIC;
 
-/* Values for Model field above */
 
-#define ACPI_IORT_SMMU_V1               0x00000000  /* Generic SMMUv1 */
-#define ACPI_IORT_SMMU_V2               0x00000001  /* Generic SMMUv2 */
-#define ACPI_IORT_SMMU_CORELINK_MMU400  0x00000002  /* ARM Corelink MMU-400 */
-#define ACPI_IORT_SMMU_CORELINK_MMU500  0x00000003  /* ARM Corelink MMU-500 */
-#define ACPI_IORT_SMMU_CORELINK_MMU401  0x00000004  /* ARM Corelink MMU-401 */
-#define ACPI_IORT_SMMU_CAVIUM_THUNDERX  0x00000005  /* Cavium ThunderX SMMUv2 */
+/* 10: Local X2APIC NMI (ACPI 4.0) */
+
+typedef struct acpi_madt_local_x2apic_nmi
+{
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT16                  IntiFlags;
+    UINT32                  Uid;                /* ACPI processor UID */
+    UINT8                   Lint;               /* LINTn to which NMI is connected */
+    UINT8                   Reserved[3];        /* Reserved - must be zero */
+
+} ACPI_MADT_LOCAL_X2APIC_NMI;
+
+
+/* 11: Generic Interrupt (ACPI 5.0 + ACPI 6.0 changes) */
+
+typedef struct acpi_madt_generic_interrupt
+{
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT16                  Reserved;           /* Reserved - must be zero */
+    UINT32                  CpuInterfaceNumber;
+    UINT32                  Uid;
+    UINT32                  Flags;
+    UINT32                  ParkingVersion;
+    UINT32                  PerformanceInterrupt;
+    UINT64                  ParkedAddress;
+    UINT64                  BaseAddress;
+    UINT64                  GicvBaseAddress;
+    UINT64                  GichBaseAddress;
+    UINT32                  VgicInterrupt;
+    UINT64                  GicrBaseAddress;
+    UINT64                  ArmMpidr;
+    UINT8                   EfficiencyClass;
+    UINT8                   Reserved2[3];
+
+} ACPI_MADT_GENERIC_INTERRUPT;
 
 /* Masks for Flags field above */
 
-#define ACPI_IORT_SMMU_DVM_SUPPORTED    (1)
-#define ACPI_IORT_SMMU_COHERENT_WALK    (1<<1)
+/* ACPI_MADT_ENABLED                    (1)      Processor is usable if set */
+#define ACPI_MADT_PERFORMANCE_IRQ_MODE  (1<<1)  /* 01: Performance Interrupt Mode */
+#define ACPI_MADT_VGIC_IRQ_MODE         (1<<2)  /* 02: VGIC Maintenance Interrupt mode */
 
-/* Global interrupt format */
 
-typedef struct acpi_iort_smmu_gsi
+/* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */
+
+typedef struct acpi_madt_generic_distributor
 {
-    UINT32                  NSgIrpt;
-    UINT32                  NSgIrptFlags;
-    UINT32                  NSgCfgIrpt;
-    UINT32                  NSgCfgIrptFlags;
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT16                  Reserved;           /* Reserved - must be zero */
+    UINT32                  GicId;
+    UINT64                  BaseAddress;
+    UINT32                  GlobalIrqBase;
+    UINT8                   Version;
+    UINT8                   Reserved2[3];       /* Reserved - must be zero */
 
-} ACPI_IORT_SMMU_GSI;
+} ACPI_MADT_GENERIC_DISTRIBUTOR;
 
+/* Values for Version field above */
 
-typedef struct acpi_iort_smmu_v3
+enum AcpiMadtGicVersion
 {
-    UINT64                  BaseAddress;            /* SMMUv3 base address */
-    UINT32                  Flags;
-    UINT32                  Reserved;
-    UINT64                  VatosAddress;
-    UINT32                  Model;
-    UINT32                  EventGsiv;
-    UINT32                  PriGsiv;
-    UINT32                  GerrGsiv;
-    UINT32                  SyncGsiv;
-    UINT8                   Pxm;
-    UINT8                   Reserved1;
-    UINT16                  Reserved2;
-    UINT32                  IdMappingIndex;
+    ACPI_MADT_GIC_VERSION_NONE          = 0,
+    ACPI_MADT_GIC_VERSION_V1            = 1,
+    ACPI_MADT_GIC_VERSION_V2            = 2,
+    ACPI_MADT_GIC_VERSION_V3            = 3,
+    ACPI_MADT_GIC_VERSION_V4            = 4,
+    ACPI_MADT_GIC_VERSION_RESERVED      = 5     /* 5 and greater are reserved */
+};
 
-} ACPI_IORT_SMMU_V3;
 
-/* Values for Model field above */
+/* 13: Generic MSI Frame (ACPI 5.1) */
 
-#define ACPI_IORT_SMMU_V3_GENERIC           0x00000000  /* Generic SMMUv3 */
-#define ACPI_IORT_SMMU_V3_HISILICON_HI161X  0x00000001  /* HiSilicon Hi161x SMMUv3 */
-#define ACPI_IORT_SMMU_V3_CAVIUM_CN99XX     0x00000002  /* Cavium CN99xx SMMUv3 */
+typedef struct acpi_madt_generic_msi_frame
+{
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT16                  Reserved;           /* Reserved - must be zero */
+    UINT32                  MsiFrameId;
+    UINT64                  BaseAddress;
+    UINT32                  Flags;
+    UINT16                  SpiCount;
+    UINT16                  SpiBase;
+
+} ACPI_MADT_GENERIC_MSI_FRAME;
 
 /* Masks for Flags field above */
 
-#define ACPI_IORT_SMMU_V3_COHACC_OVERRIDE   (1)
-#define ACPI_IORT_SMMU_V3_HTTU_OVERRIDE     (1<<1)
-#define ACPI_IORT_SMMU_V3_PXM_VALID         (1<<3)
+#define ACPI_MADT_OVERRIDE_SPI_VALUES   (1)
+
+
+/* 14: Generic Redistributor (ACPI 5.1) */
+
+typedef struct acpi_madt_generic_redistributor
+{
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT16                  Reserved;           /* reserved - must be zero */
+    UINT64                  BaseAddress;
+    UINT32                  Length;
+
+} ACPI_MADT_GENERIC_REDISTRIBUTOR;
+
+
+/* 15: Generic Translator (ACPI 6.0) */
+
+typedef struct acpi_madt_generic_translator
+{
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT16                  Reserved;           /* reserved - must be zero */
+    UINT32                  TranslationId;
+    UINT64                  BaseAddress;
+    UINT32                  Reserved2;
+
+} ACPI_MADT_GENERIC_TRANSLATOR;
+
+
+/*
+ * Common flags fields for MADT subtables
+ */
+
+/* MADT Local APIC flags */
+
+#define ACPI_MADT_ENABLED           (1)         /* 00: Processor is usable if set */
+
+/* MADT MPS INTI flags (IntiFlags) */
+
+#define ACPI_MADT_POLARITY_MASK     (3)         /* 00-01: Polarity of APIC I/O input signals */
+#define ACPI_MADT_TRIGGER_MASK      (3<<2)      /* 02-03: Trigger mode of APIC input signals */
+
+/* Values for MPS INTI flags */
+
+#define ACPI_MADT_POLARITY_CONFORMS       0
+#define ACPI_MADT_POLARITY_ACTIVE_HIGH    1
+#define ACPI_MADT_POLARITY_RESERVED       2
+#define ACPI_MADT_POLARITY_ACTIVE_LOW     3
+
+#define ACPI_MADT_TRIGGER_CONFORMS        (0)
+#define ACPI_MADT_TRIGGER_EDGE            (1<<2)
+#define ACPI_MADT_TRIGGER_RESERVED        (2<<2)
+#define ACPI_MADT_TRIGGER_LEVEL           (3<<2)
 
 
 /*******************************************************************************
  *
- * IVRS - I/O Virtualization Reporting Structure
+ * MCFG - PCI Memory Mapped Configuration table and subtable
  *        Version 1
  *
- * Conforms to "AMD I/O Virtualization Technology (IOMMU) Specification",
- * Revision 1.26, February 2009.
+ * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
  *
  ******************************************************************************/
 
-typedef struct acpi_table_ivrs
+typedef struct acpi_table_mcfg
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT32                  Info;               /* Common virtualization info */
-    UINT64                  Reserved;
+    UINT8                   Reserved[8];
 
-} ACPI_TABLE_IVRS;
+} ACPI_TABLE_MCFG;
 
-/* Values for Info field above */
 
-#define ACPI_IVRS_PHYSICAL_SIZE     0x00007F00  /* 7 bits, physical address size */
-#define ACPI_IVRS_VIRTUAL_SIZE      0x003F8000  /* 7 bits, virtual address size */
-#define ACPI_IVRS_ATS_RESERVED      0x00400000  /* ATS address translation range reserved */
+/* Subtable */
 
+typedef struct acpi_mcfg_allocation
+{
+    UINT64                  Address;            /* Base address, processor-relative */
+    UINT16                  PciSegment;         /* PCI segment group number */
+    UINT8                   StartBusNumber;     /* Starting PCI Bus number */
+    UINT8                   EndBusNumber;       /* Final PCI Bus number */
+    UINT32                  Reserved;
 
-/* IVRS subtable header */
+} ACPI_MCFG_ALLOCATION;
 
-typedef struct acpi_ivrs_header
+
+/*******************************************************************************
+ *
+ * MCHI - Management Controller Host Interface Table
+ *        Version 1
+ *
+ * Conforms to "Management Component Transport Protocol (MCTP) Host
+ * Interface Specification", Revision 1.0.0a, October 13, 2009
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_mchi
 {
-    UINT8                   Type;               /* Subtable type */
-    UINT8                   Flags;
-    UINT16                  Length;             /* Subtable length */
-    UINT16                  DeviceId;           /* ID of IOMMU */
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    UINT8                   InterfaceType;
+    UINT8                   Protocol;
+    UINT64                  ProtocolData;
+    UINT8                   InterruptType;
+    UINT8                   Gpe;
+    UINT8                   PciDeviceFlag;
+    UINT32                  GlobalInterrupt;
+    ACPI_GENERIC_ADDRESS    ControlRegister;
+    UINT8                   PciSegment;
+    UINT8                   PciBus;
+    UINT8                   PciDevice;
+    UINT8                   PciFunction;
 
-} ACPI_IVRS_HEADER;
+} ACPI_TABLE_MCHI;
 
-/* Values for subtable Type above */
 
-enum AcpiIvrsType
+/*******************************************************************************
+ *
+ * MPST - Memory Power State Table (ACPI 5.0)
+ *        Version 1
+ *
+ ******************************************************************************/
+
+#define ACPI_MPST_CHANNEL_INFO \
+    UINT8                   ChannelId; \
+    UINT8                   Reserved1[3]; \
+    UINT16                  PowerNodeCount; \
+    UINT16                  Reserved2;
+
+/* Main table */
+
+typedef struct acpi_table_mpst
 {
-    ACPI_IVRS_TYPE_HARDWARE         = 0x10,
-    ACPI_IVRS_TYPE_MEMORY1          = 0x20,
-    ACPI_IVRS_TYPE_MEMORY2          = 0x21,
-    ACPI_IVRS_TYPE_MEMORY3          = 0x22
-};
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    ACPI_MPST_CHANNEL_INFO                      /* Platform Communication Channel */
 
-/* Masks for Flags field above for IVHD subtable */
+} ACPI_TABLE_MPST;
 
-#define ACPI_IVHD_TT_ENABLE         (1)
-#define ACPI_IVHD_PASS_PW           (1<<1)
-#define ACPI_IVHD_RES_PASS_PW       (1<<2)
-#define ACPI_IVHD_ISOC              (1<<3)
-#define ACPI_IVHD_IOTLB             (1<<4)
 
-/* Masks for Flags field above for IVMD subtable */
+/* Memory Platform Communication Channel Info */
 
-#define ACPI_IVMD_UNITY             (1)
-#define ACPI_IVMD_READ              (1<<1)
-#define ACPI_IVMD_WRITE             (1<<2)
-#define ACPI_IVMD_EXCLUSION_RANGE   (1<<3)
+typedef struct acpi_mpst_channel
+{
+    ACPI_MPST_CHANNEL_INFO                      /* Platform Communication Channel */
 
+} ACPI_MPST_CHANNEL;
 
-/*
- * IVRS subtables, correspond to Type in ACPI_IVRS_HEADER
- */
 
-/* 0x10: I/O Virtualization Hardware Definition Block (IVHD) */
+/* Memory Power Node Structure */
 
-typedef struct acpi_ivrs_hardware
+typedef struct acpi_mpst_power_node
 {
-    ACPI_IVRS_HEADER        Header;
-    UINT16                  CapabilityOffset;   /* Offset for IOMMU control fields */
-    UINT64                  BaseAddress;        /* IOMMU control registers */
-    UINT16                  PciSegmentGroup;
-    UINT16                  Info;               /* MSI number and unit ID */
-    UINT32                  Reserved;
+    UINT8                   Flags;
+    UINT8                   Reserved1;
+    UINT16                  NodeId;
+    UINT32                  Length;
+    UINT64                  RangeAddress;
+    UINT64                  RangeLength;
+    UINT32                  NumPowerStates;
+    UINT32                  NumPhysicalComponents;
 
-} ACPI_IVRS_HARDWARE;
+} ACPI_MPST_POWER_NODE;
 
-/* Masks for Info field above */
+/* Values for Flags field above */
 
-#define ACPI_IVHD_MSI_NUMBER_MASK   0x001F      /* 5 bits, MSI message number */
-#define ACPI_IVHD_UNIT_ID_MASK      0x1F00      /* 5 bits, UnitID */
+#define ACPI_MPST_ENABLED               1
+#define ACPI_MPST_POWER_MANAGED         2
+#define ACPI_MPST_HOT_PLUG_CAPABLE      4
 
 
-/*
- * Device Entries for IVHD subtable, appear after ACPI_IVRS_HARDWARE structure.
- * Upper two bits of the Type field are the (encoded) length of the structure.
- * Currently, only 4 and 8 byte entries are defined. 16 and 32 byte entries
- * are reserved for future use but not defined.
- */
-typedef struct acpi_ivrs_de_header
+/* Memory Power State Structure (follows POWER_NODE above) */
+
+typedef struct acpi_mpst_power_state
 {
-    UINT8                   Type;
-    UINT16                  Id;
-    UINT8                   DataSetting;
+    UINT8                   PowerState;
+    UINT8                   InfoIndex;
 
-} ACPI_IVRS_DE_HEADER;
+} ACPI_MPST_POWER_STATE;
 
-/* Length of device entry is in the top two bits of Type field above */
 
-#define ACPI_IVHD_ENTRY_LENGTH      0xC0
+/* Physical Component ID Structure (follows POWER_STATE above) */
 
-/* Values for device entry Type field above */
+typedef struct acpi_mpst_component
+{
+    UINT16                  ComponentId;
 
-enum AcpiIvrsDeviceEntryType
+} ACPI_MPST_COMPONENT;
+
+
+/* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
+
+typedef struct acpi_mpst_data_hdr
 {
-    /* 4-byte device entries, all use ACPI_IVRS_DEVICE4 */
+    UINT16                  CharacteristicsCount;
+    UINT16                  Reserved;
 
-    ACPI_IVRS_TYPE_PAD4             = 0,
-    ACPI_IVRS_TYPE_ALL              = 1,
-    ACPI_IVRS_TYPE_SELECT           = 2,
-    ACPI_IVRS_TYPE_START            = 3,
-    ACPI_IVRS_TYPE_END              = 4,
+} ACPI_MPST_DATA_HDR;
 
-    /* 8-byte device entries */
+typedef struct acpi_mpst_power_data
+{
+    UINT8                   StructureId;
+    UINT8                   Flags;
+    UINT16                  Reserved1;
+    UINT32                  AveragePower;
+    UINT32                  PowerSaving;
+    UINT64                  ExitLatency;
+    UINT64                  Reserved2;
 
-    ACPI_IVRS_TYPE_PAD8             = 64,
-    ACPI_IVRS_TYPE_NOT_USED         = 65,
-    ACPI_IVRS_TYPE_ALIAS_SELECT     = 66, /* Uses ACPI_IVRS_DEVICE8A */
-    ACPI_IVRS_TYPE_ALIAS_START      = 67, /* Uses ACPI_IVRS_DEVICE8A */
-    ACPI_IVRS_TYPE_EXT_SELECT       = 70, /* Uses ACPI_IVRS_DEVICE8B */
-    ACPI_IVRS_TYPE_EXT_START        = 71, /* Uses ACPI_IVRS_DEVICE8B */
-    ACPI_IVRS_TYPE_SPECIAL          = 72  /* Uses ACPI_IVRS_DEVICE8C */
-};
+} ACPI_MPST_POWER_DATA;
 
-/* Values for Data field above */
+/* Values for Flags field above */
 
-#define ACPI_IVHD_INIT_PASS         (1)
-#define ACPI_IVHD_EINT_PASS         (1<<1)
-#define ACPI_IVHD_NMI_PASS          (1<<2)
-#define ACPI_IVHD_SYSTEM_MGMT       (3<<4)
-#define ACPI_IVHD_LINT0_PASS        (1<<6)
-#define ACPI_IVHD_LINT1_PASS        (1<<7)
+#define ACPI_MPST_PRESERVE              1
+#define ACPI_MPST_AUTOENTRY             2
+#define ACPI_MPST_AUTOEXIT              4
 
 
-/* Types 0-4: 4-byte device entry */
+/* Shared Memory Region (not part of an ACPI table) */
 
-typedef struct acpi_ivrs_device4
+typedef struct acpi_mpst_shared
 {
-    ACPI_IVRS_DE_HEADER     Header;
+    UINT32                  Signature;
+    UINT16                  PccCommand;
+    UINT16                  PccStatus;
+    UINT32                  CommandRegister;
+    UINT32                  StatusRegister;
+    UINT32                  PowerStateId;
+    UINT32                  PowerNodeId;
+    UINT64                  EnergyConsumed;
+    UINT64                  AveragePower;
 
-} ACPI_IVRS_DEVICE4;
+} ACPI_MPST_SHARED;
 
-/* Types 66-67: 8-byte device entry */
 
-typedef struct acpi_ivrs_device8a
+/*******************************************************************************
+ *
+ * MSCT - Maximum System Characteristics Table (ACPI 4.0)
+ *        Version 1
+ *
+ ******************************************************************************/
+
+typedef struct acpi_table_msct
 {
-    ACPI_IVRS_DE_HEADER     Header;
-    UINT8                   Reserved1;
-    UINT16                  UsedId;
-    UINT8                   Reserved2;
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    UINT32                  ProximityOffset;    /* Location of proximity info struct(s) */
+    UINT32                  MaxProximityDomains;/* Max number of proximity domains */
+    UINT32                  MaxClockDomains;    /* Max number of clock domains */
+    UINT64                  MaxAddress;         /* Max physical address in system */
 
-} ACPI_IVRS_DEVICE8A;
+} ACPI_TABLE_MSCT;
 
-/* Types 70-71: 8-byte device entry */
 
-typedef struct acpi_ivrs_device8b
+/* Subtable - Maximum Proximity Domain Information. Version 1 */
+
+typedef struct acpi_msct_proximity
 {
-    ACPI_IVRS_DE_HEADER     Header;
-    UINT32                  ExtendedData;
+    UINT8                   Revision;
+    UINT8                   Length;
+    UINT32                  RangeStart;         /* Start of domain range */
+    UINT32                  RangeEnd;           /* End of domain range */
+    UINT32                  ProcessorCapacity;
+    UINT64                  MemoryCapacity;     /* In bytes */
 
-} ACPI_IVRS_DEVICE8B;
+} ACPI_MSCT_PROXIMITY;
 
-/* Values for ExtendedData above */
 
-#define ACPI_IVHD_ATS_DISABLED      (1<<31)
+/*******************************************************************************
+ *
+ * MSDM - Microsoft Data Management table
+ *
+ * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
+ * November 29, 2011. Copyright 2011 Microsoft
+ *
+ ******************************************************************************/
 
-/* Type 72: 8-byte device entry */
+/* Basic MSDM table is only the common ACPI header */
 
-typedef struct acpi_ivrs_device8c
+typedef struct acpi_table_msdm
 {
-    ACPI_IVRS_DE_HEADER     Header;
-    UINT8                   Handle;
-    UINT16                  UsedId;
-    UINT8                   Variety;
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
 
-} ACPI_IVRS_DEVICE8C;
+} ACPI_TABLE_MSDM;
 
-/* Values for Variety field above */
 
-#define ACPI_IVHD_IOAPIC            1
-#define ACPI_IVHD_HPET              2
+/*******************************************************************************
+ *
+ * MTMR - MID Timer Table
+ *        Version 1
+ *
+ * Conforms to "Simple Firmware Interface Specification",
+ * Draft 0.8.2, Oct 19, 2010
+ * NOTE: The ACPI MTMR is equivalent to the SFI MTMR table.
+ *
+ ******************************************************************************/
 
+typedef struct acpi_table_mtmr
+{
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
 
-/* 0x20, 0x21, 0x22: I/O Virtualization Memory Definition Block (IVMD) */
+} ACPI_TABLE_MTMR;
 
-typedef struct acpi_ivrs_memory
+/* MTMR entry */
+
+typedef struct acpi_mtmr_entry
 {
-    ACPI_IVRS_HEADER        Header;
-    UINT16                  AuxData;
-    UINT64                  Reserved;
-    UINT64                  StartAddress;
-    UINT64                  MemoryLength;
+    ACPI_GENERIC_ADDRESS    PhysicalAddress;
+    UINT32                  Frequency;
+    UINT32                  Irq;
 
-} ACPI_IVRS_MEMORY;
+} ACPI_MTMR_ENTRY;
 
 
 /*******************************************************************************
  *
- * LPIT - Low Power Idle Table
- *
- * Conforms to "ACPI Low Power Idle Table (LPIT)" July 2014.
+ * NFIT - NVDIMM Interface Table (ACPI 6.0+)
+ *        Version 1
  *
  ******************************************************************************/
 
-typedef struct acpi_table_lpit
+typedef struct acpi_table_nfit
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    UINT32                  Reserved;           /* Reserved, must be zero */
 
-} ACPI_TABLE_LPIT;
-
+} ACPI_TABLE_NFIT;
 
-/* LPIT subtable header */
+/* Subtable header for NFIT */
 
-typedef struct acpi_lpit_header
+typedef struct acpi_nfit_header
 {
-    UINT32                  Type;               /* Subtable type */
-    UINT32                  Length;             /* Subtable length */
-    UINT16                  UniqueId;
-    UINT16                  Reserved;
-    UINT32                  Flags;
+    UINT16                   Type;
+    UINT16                   Length;
 
-} ACPI_LPIT_HEADER;
+} ACPI_NFIT_HEADER;
 
-/* Values for subtable Type above */
 
-enum AcpiLpitType
+/* Values for subtable type in ACPI_NFIT_HEADER */
+
+enum AcpiNfitType
 {
-    ACPI_LPIT_TYPE_NATIVE_CSTATE    = 0x00,
-    ACPI_LPIT_TYPE_RESERVED         = 0x01      /* 1 and above are reserved */
+    ACPI_NFIT_TYPE_SYSTEM_ADDRESS       = 0,
+    ACPI_NFIT_TYPE_MEMORY_MAP           = 1,
+    ACPI_NFIT_TYPE_INTERLEAVE           = 2,
+    ACPI_NFIT_TYPE_SMBIOS               = 3,
+    ACPI_NFIT_TYPE_CONTROL_REGION       = 4,
+    ACPI_NFIT_TYPE_DATA_REGION          = 5,
+    ACPI_NFIT_TYPE_FLUSH_ADDRESS        = 6,
+    ACPI_NFIT_TYPE_CAPABILITIES         = 7,
+    ACPI_NFIT_TYPE_RESERVED             = 8     /* 8 and greater are reserved */
 };
 
-/* Masks for Flags field above  */
-
-#define ACPI_LPIT_STATE_DISABLED    (1)
-#define ACPI_LPIT_NO_COUNTER        (1<<1)
-
 /*
- * LPIT subtables, correspond to Type in ACPI_LPIT_HEADER
+ * NFIT Subtables
  */
 
-/* 0x00: Native C-state instruction based LPI structure */
+/* 0: System Physical Address Range Structure */
 
-typedef struct acpi_lpit_native
+typedef struct acpi_nfit_system_address
 {
-    ACPI_LPIT_HEADER        Header;
-    ACPI_GENERIC_ADDRESS    EntryTrigger;
-    UINT32                  Residency;
-    UINT32                  Latency;
-    ACPI_GENERIC_ADDRESS    ResidencyCounter;
-    UINT64                  CounterFrequency;
+    ACPI_NFIT_HEADER        Header;
+    UINT16                  RangeIndex;
+    UINT16                  Flags;
+    UINT32                  Reserved;           /* Reserved, must be zero */
+    UINT32                  ProximityDomain;
+    UINT8                   RangeGuid[16];
+    UINT64                  Address;
+    UINT64                  Length;
+    UINT64                  MemoryMapping;
 
-} ACPI_LPIT_NATIVE;
+} ACPI_NFIT_SYSTEM_ADDRESS;
 
+/* Flags */
 
-/*******************************************************************************
- *
- * MCFG - PCI Memory Mapped Configuration table and subtable
- *        Version 1
- *
- * Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
- *
- ******************************************************************************/
+#define ACPI_NFIT_ADD_ONLINE_ONLY       (1)     /* 00: Add/Online Operation Only */
+#define ACPI_NFIT_PROXIMITY_VALID       (1<<1)  /* 01: Proximity Domain Valid */
 
-typedef struct acpi_table_mcfg
+/* Range Type GUIDs appear in the include/acuuid.h file */
+
+
+/* 1: Memory Device to System Address Range Map Structure */
+
+typedef struct acpi_nfit_memory_map
 {
-    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT8                   Reserved[8];
+    ACPI_NFIT_HEADER        Header;
+    UINT32                  DeviceHandle;
+    UINT16                  PhysicalId;
+    UINT16                  RegionId;
+    UINT16                  RangeIndex;
+    UINT16                  RegionIndex;
+    UINT64                  RegionSize;
+    UINT64                  RegionOffset;
+    UINT64                  Address;
+    UINT16                  InterleaveIndex;
+    UINT16                  InterleaveWays;
+    UINT16                  Flags;
+    UINT16                  Reserved;           /* Reserved, must be zero */
 
-} ACPI_TABLE_MCFG;
+} ACPI_NFIT_MEMORY_MAP;
 
+/* Flags */
 
-/* Subtable */
+#define ACPI_NFIT_MEM_SAVE_FAILED       (1)     /* 00: Last SAVE to Memory Device failed */
+#define ACPI_NFIT_MEM_RESTORE_FAILED    (1<<1)  /* 01: Last RESTORE from Memory Device failed */
+#define ACPI_NFIT_MEM_FLUSH_FAILED      (1<<2)  /* 02: Platform flush failed */
+#define ACPI_NFIT_MEM_NOT_ARMED         (1<<3)  /* 03: Memory Device is not armed */
+#define ACPI_NFIT_MEM_HEALTH_OBSERVED   (1<<4)  /* 04: Memory Device observed SMART/health events */
+#define ACPI_NFIT_MEM_HEALTH_ENABLED    (1<<5)  /* 05: SMART/health events enabled */
+#define ACPI_NFIT_MEM_MAP_FAILED        (1<<6)  /* 06: Mapping to SPA failed */
 
-typedef struct acpi_mcfg_allocation
+
+/* 2: Interleave Structure */
+
+typedef struct acpi_nfit_interleave
 {
-    UINT64                  Address;            /* Base address, processor-relative */
-    UINT16                  PciSegment;         /* PCI segment group number */
-    UINT8                   StartBusNumber;     /* Starting PCI Bus number */
-    UINT8                   EndBusNumber;       /* Final PCI Bus number */
-    UINT32                  Reserved;
+    ACPI_NFIT_HEADER        Header;
+    UINT16                  InterleaveIndex;
+    UINT16                  Reserved;           /* Reserved, must be zero */
+    UINT32                  LineCount;
+    UINT32                  LineSize;
+    UINT32                  LineOffset[1];      /* Variable length */
 
-} ACPI_MCFG_ALLOCATION;
+} ACPI_NFIT_INTERLEAVE;
+
+
+/* 3: SMBIOS Management Information Structure */
+
+typedef struct acpi_nfit_smbios
+{
+    ACPI_NFIT_HEADER        Header;
+    UINT32                  Reserved;           /* Reserved, must be zero */
+    UINT8                   Data[1];            /* Variable length */
+
+} ACPI_NFIT_SMBIOS;
+
+
+/* 4: NVDIMM Control Region Structure */
+
+typedef struct acpi_nfit_control_region
+{
+    ACPI_NFIT_HEADER        Header;
+    UINT16                  RegionIndex;
+    UINT16                  VendorId;
+    UINT16                  DeviceId;
+    UINT16                  RevisionId;
+    UINT16                  SubsystemVendorId;
+    UINT16                  SubsystemDeviceId;
+    UINT16                  SubsystemRevisionId;
+    UINT8                   ValidFields;
+    UINT8                   ManufacturingLocation;
+    UINT16                  ManufacturingDate;
+    UINT8                   Reserved[2];        /* Reserved, must be zero */
+    UINT32                  SerialNumber;
+    UINT16                  Code;
+    UINT16                  Windows;
+    UINT64                  WindowSize;
+    UINT64                  CommandOffset;
+    UINT64                  CommandSize;
+    UINT64                  StatusOffset;
+    UINT64                  StatusSize;
+    UINT16                  Flags;
+    UINT8                   Reserved1[6];       /* Reserved, must be zero */
+
+} ACPI_NFIT_CONTROL_REGION;
+
+/* Flags */
+
+#define ACPI_NFIT_CONTROL_BUFFERED          (1)     /* Block Data Windows implementation is buffered */
+
+/* ValidFields bits */
+
+#define ACPI_NFIT_CONTROL_MFG_INFO_VALID    (1)     /* Manufacturing fields are valid */
+
+
+/* 5: NVDIMM Block Data Window Region Structure */
+
+typedef struct acpi_nfit_data_region
+{
+    ACPI_NFIT_HEADER        Header;
+    UINT16                  RegionIndex;
+    UINT16                  Windows;
+    UINT64                  Offset;
+    UINT64                  Size;
+    UINT64                  Capacity;
+    UINT64                  StartAddress;
+
+} ACPI_NFIT_DATA_REGION;
+
+
+/* 6: Flush Hint Address Structure */
+
+typedef struct acpi_nfit_flush_address
+{
+    ACPI_NFIT_HEADER        Header;
+    UINT32                  DeviceHandle;
+    UINT16                  HintCount;
+    UINT8                   Reserved[6];        /* Reserved, must be zero */
+    UINT64                  HintAddress[1];     /* Variable length */
+
+} ACPI_NFIT_FLUSH_ADDRESS;
+
+
+/* 7: Platform Capabilities Structure */
+
+typedef struct acpi_nfit_capabilities
+{
+    ACPI_NFIT_HEADER        Header;
+    UINT8                   HighestCapability;
+    UINT8                   Reserved[3];       /* Reserved, must be zero */
+    UINT32                  Capabilities;
+    UINT32                  Reserved2;
+
+} ACPI_NFIT_CAPABILITIES;
+
+/* Capabilities Flags */
+
+#define ACPI_NFIT_CAPABILITY_CACHE_FLUSH       (1)     /* 00: Cache Flush to NVDIMM capable */
+#define ACPI_NFIT_CAPABILITY_MEM_FLUSH         (1<<1)  /* 01: Memory Flush to NVDIMM capable */
+#define ACPI_NFIT_CAPABILITY_MEM_MIRRORING     (1<<2)  /* 02: Memory Mirroring capable */
+
+
+/*
+ * NFIT/DVDIMM device handle support - used as the _ADR for each NVDIMM
+ */
+typedef struct nfit_device_handle
+{
+    UINT32                  Handle;
+
+} NFIT_DEVICE_HANDLE;
+
+/* Device handle construction and extraction macros */
+
+#define ACPI_NFIT_DIMM_NUMBER_MASK              0x0000000F
+#define ACPI_NFIT_CHANNEL_NUMBER_MASK           0x000000F0
+#define ACPI_NFIT_MEMORY_ID_MASK                0x00000F00
+#define ACPI_NFIT_SOCKET_ID_MASK                0x0000F000
+#define ACPI_NFIT_NODE_ID_MASK                  0x0FFF0000
+
+#define ACPI_NFIT_DIMM_NUMBER_OFFSET            0
+#define ACPI_NFIT_CHANNEL_NUMBER_OFFSET         4
+#define ACPI_NFIT_MEMORY_ID_OFFSET              8
+#define ACPI_NFIT_SOCKET_ID_OFFSET              12
+#define ACPI_NFIT_NODE_ID_OFFSET                16
+
+/* Macro to construct a NFIT/NVDIMM device handle */
+
+#define ACPI_NFIT_BUILD_DEVICE_HANDLE(dimm, channel, memory, socket, node) \
+    ((dimm)                                         | \
+    ((channel) << ACPI_NFIT_CHANNEL_NUMBER_OFFSET)  | \
+    ((memory)  << ACPI_NFIT_MEMORY_ID_OFFSET)       | \
+    ((socket)  << ACPI_NFIT_SOCKET_ID_OFFSET)       | \
+    ((node)    << ACPI_NFIT_NODE_ID_OFFSET))
+
+/* Macros to extract individual fields from a NFIT/NVDIMM device handle */
+
+#define ACPI_NFIT_GET_DIMM_NUMBER(handle) \
+    ((handle) & ACPI_NFIT_DIMM_NUMBER_MASK)
+
+#define ACPI_NFIT_GET_CHANNEL_NUMBER(handle) \
+    (((handle) & ACPI_NFIT_CHANNEL_NUMBER_MASK) >> ACPI_NFIT_CHANNEL_NUMBER_OFFSET)
+
+#define ACPI_NFIT_GET_MEMORY_ID(handle) \
+    (((handle) & ACPI_NFIT_MEMORY_ID_MASK)      >> ACPI_NFIT_MEMORY_ID_OFFSET)
+
+#define ACPI_NFIT_GET_SOCKET_ID(handle) \
+    (((handle) & ACPI_NFIT_SOCKET_ID_MASK)      >> ACPI_NFIT_SOCKET_ID_OFFSET)
+
+#define ACPI_NFIT_GET_NODE_ID(handle) \
+    (((handle) & ACPI_NFIT_NODE_ID_MASK)        >> ACPI_NFIT_NODE_ID_OFFSET)
 
 
 /*******************************************************************************
  *
- * MCHI - Management Controller Host Interface Table
- *        Version 1
- *
- * Conforms to "Management Component Transport Protocol (MCTP) Host
- * Interface Specification", Revision 1.0.0a, October 13, 2009
+ * PCCT - Platform Communications Channel Table (ACPI 5.0)
+ *        Version 2 (ACPI 6.2)
  *
  ******************************************************************************/
 
-typedef struct acpi_table_mchi
+typedef struct acpi_table_pcct
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT8                   InterfaceType;
-    UINT8                   Protocol;
-    UINT64                  ProtocolData;
-    UINT8                   InterruptType;
-    UINT8                   Gpe;
-    UINT8                   PciDeviceFlag;
-    UINT32                  GlobalInterrupt;
-    ACPI_GENERIC_ADDRESS    ControlRegister;
-    UINT8                   PciSegment;
-    UINT8                   PciBus;
-    UINT8                   PciDevice;
-    UINT8                   PciFunction;
+    UINT32                  Flags;
+    UINT64                  Reserved;
 
-} ACPI_TABLE_MCHI;
+} ACPI_TABLE_PCCT;
+
+/* Values for Flags field above */
+
+#define ACPI_PCCT_DOORBELL              1
+
+/* Values for subtable type in ACPI_SUBTABLE_HEADER */
+
+enum AcpiPcctType
+{
+    ACPI_PCCT_TYPE_GENERIC_SUBSPACE             = 0,
+    ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE          = 1,
+    ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2    = 2,    /* ACPI 6.1 */
+    ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE      = 3,    /* ACPI 6.2 */
+    ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE       = 4,    /* ACPI 6.2 */
+    ACPI_PCCT_TYPE_RESERVED                     = 5     /* 5 and greater are reserved */
+};
+
+/*
+ * PCCT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
+ */
+
+/* 0: Generic Communications Subspace */
+
+typedef struct acpi_pcct_subspace
+{
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT8                   Reserved[6];
+    UINT64                  BaseAddress;
+    UINT64                  Length;
+    ACPI_GENERIC_ADDRESS    DoorbellRegister;
+    UINT64                  PreserveMask;
+    UINT64                  WriteMask;
+    UINT32                  Latency;
+    UINT32                  MaxAccessRate;
+    UINT16                  MinTurnaroundTime;
 
+} ACPI_PCCT_SUBSPACE;
 
-/*******************************************************************************
- *
- * MSDM - Microsoft Data Management table
- *
- * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
- * November 29, 2011. Copyright 2011 Microsoft
- *
- ******************************************************************************/
 
-/* Basic MSDM table is only the common ACPI header */
+/* 1: HW-reduced Communications Subspace (ACPI 5.1) */
 
-typedef struct acpi_table_msdm
+typedef struct acpi_pcct_hw_reduced
 {
-    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT32                  PlatformInterrupt;
+    UINT8                   Flags;
+    UINT8                   Reserved;
+    UINT64                  BaseAddress;
+    UINT64                  Length;
+    ACPI_GENERIC_ADDRESS    DoorbellRegister;
+    UINT64                  PreserveMask;
+    UINT64                  WriteMask;
+    UINT32                  Latency;
+    UINT32                  MaxAccessRate;
+    UINT16                  MinTurnaroundTime;
 
-} ACPI_TABLE_MSDM;
+} ACPI_PCCT_HW_REDUCED;
 
 
-/*******************************************************************************
- *
- * MTMR - MID Timer Table
- *        Version 1
- *
- * Conforms to "Simple Firmware Interface Specification",
- * Draft 0.8.2, Oct 19, 2010
- * NOTE: The ACPI MTMR is equivalent to the SFI MTMR table.
- *
- ******************************************************************************/
+/* 2: HW-reduced Communications Subspace Type 2 (ACPI 6.1) */
 
-typedef struct acpi_table_mtmr
+typedef struct acpi_pcct_hw_reduced_type2
 {
-    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT32                  PlatformInterrupt;
+    UINT8                   Flags;
+    UINT8                   Reserved;
+    UINT64                  BaseAddress;
+    UINT64                  Length;
+    ACPI_GENERIC_ADDRESS    DoorbellRegister;
+    UINT64                  PreserveMask;
+    UINT64                  WriteMask;
+    UINT32                  Latency;
+    UINT32                  MaxAccessRate;
+    UINT16                  MinTurnaroundTime;
+    ACPI_GENERIC_ADDRESS    PlatformAckRegister;
+    UINT64                  AckPreserveMask;
+    UINT64                  AckWriteMask;
 
-} ACPI_TABLE_MTMR;
+} ACPI_PCCT_HW_REDUCED_TYPE2;
 
-/* MTMR entry */
 
-typedef struct acpi_mtmr_entry
+/* 3: Extended PCC Master Subspace Type 3 (ACPI 6.2) */
+
+typedef struct acpi_pcct_ext_pcc_master
 {
-    ACPI_GENERIC_ADDRESS    PhysicalAddress;
-    UINT32                  Frequency;
-    UINT32                  Irq;
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT32                  PlatformInterrupt;
+    UINT8                   Flags;
+    UINT8                   Reserved1;
+    UINT64                  BaseAddress;
+    UINT32                  Length;
+    ACPI_GENERIC_ADDRESS    DoorbellRegister;
+    UINT64                  PreserveMask;
+    UINT64                  WriteMask;
+    UINT32                  Latency;
+    UINT32                  MaxAccessRate;
+    UINT32                  MinTurnaroundTime;
+    ACPI_GENERIC_ADDRESS    PlatformAckRegister;
+    UINT64                  AckPreserveMask;
+    UINT64                  AckSetMask;
+    UINT64                  Reserved2;
+    ACPI_GENERIC_ADDRESS    CmdCompleteRegister;
+    UINT64                  CmdCompleteMask;
+    ACPI_GENERIC_ADDRESS    CmdUpdateRegister;
+    UINT64                  CmdUpdatePreserveMask;
+    UINT64                  CmdUpdateSetMask;
+    ACPI_GENERIC_ADDRESS    ErrorStatusRegister;
+    UINT64                  ErrorStatusMask;
 
-} ACPI_MTMR_ENTRY;
+} ACPI_PCCT_EXT_PCC_MASTER;
 
-/*******************************************************************************
- *
- * SDEI - Software Delegated Exception Interface Descriptor Table
- *
- * Conforms to "Software Delegated Exception Interface (SDEI)" ARM DEN0054A,
- * May 8th, 2017. Copyright 2017 ARM Ltd.
- *
- ******************************************************************************/
 
-typedef struct acpi_table_sdei
+/* 4: Extended PCC Slave Subspace Type 4 (ACPI 6.2) */
+
+typedef struct acpi_pcct_ext_pcc_slave
 {
-    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT32                  PlatformInterrupt;
+    UINT8                   Flags;
+    UINT8                   Reserved1;
+    UINT64                  BaseAddress;
+    UINT32                  Length;
+    ACPI_GENERIC_ADDRESS    DoorbellRegister;
+    UINT64                  PreserveMask;
+    UINT64                  WriteMask;
+    UINT32                  Latency;
+    UINT32                  MaxAccessRate;
+    UINT32                  MinTurnaroundTime;
+    ACPI_GENERIC_ADDRESS    PlatformAckRegister;
+    UINT64                  AckPreserveMask;
+    UINT64                  AckSetMask;
+    UINT64                  Reserved2;
+    ACPI_GENERIC_ADDRESS    CmdCompleteRegister;
+    UINT64                  CmdCompleteMask;
+    ACPI_GENERIC_ADDRESS    CmdUpdateRegister;
+    UINT64                  CmdUpdatePreserveMask;
+    UINT64                  CmdUpdateSetMask;
+    ACPI_GENERIC_ADDRESS    ErrorStatusRegister;
+    UINT64                  ErrorStatusMask;
 
-} ACPI_TABLE_SDEI;
+} ACPI_PCCT_EXT_PCC_SLAVE;
 
 
-/*******************************************************************************
- *
- * SLIC - Software Licensing Description Table
- *
- * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
- * November 29, 2011. Copyright 2011 Microsoft
- *
- ******************************************************************************/
+/* Values for doorbell flags above */
 
-/* Basic SLIC table is only the common ACPI header */
+#define ACPI_PCCT_INTERRUPT_POLARITY    (1)
+#define ACPI_PCCT_INTERRUPT_MODE        (1<<1)
 
-typedef struct acpi_table_slic
+
+/*
+ * PCC memory structures (not part of the ACPI table)
+ */
+
+/* Shared Memory Region */
+
+typedef struct acpi_pcct_shared_memory
 {
-    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    UINT32                  Signature;
+    UINT16                  Command;
+    UINT16                  Status;
+
+} ACPI_PCCT_SHARED_MEMORY;
 
-} ACPI_TABLE_SLIC;
+
+/* Extended PCC Subspace Shared Memory Region (ACPI 6.2) */
+
+typedef struct acpi_pcct_ext_pcc_shared_memory
+{
+    UINT32                  Signature;
+    UINT32                  Flags;
+    UINT32                  Length;
+    UINT32                  Command;
+
+} ACPI_PCCT_EXT_PCC_SHARED_MEMORY;
 
 
 /*******************************************************************************
  *
- * SPCR - Serial Port Console Redirection table
- *        Version 2
- *
- * Conforms to "Serial Port Console Redirection Table",
- * Version 1.03, August 10, 2015
+ * PDTT - Platform Debug Trigger Table (ACPI 6.2)
+ *        Version 0
  *
  ******************************************************************************/
 
-typedef struct acpi_table_spcr
+typedef struct acpi_table_pdtt
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT8                   InterfaceType;      /* 0=full 16550, 1=subset of 16550 */
+    UINT8                   TriggerCount;
     UINT8                   Reserved[3];
-    ACPI_GENERIC_ADDRESS    SerialPort;
-    UINT8                   InterruptType;
-    UINT8                   PcInterrupt;
-    UINT32                  Interrupt;
-    UINT8                   BaudRate;
-    UINT8                   Parity;
-    UINT8                   StopBits;
-    UINT8                   FlowControl;
-    UINT8                   TerminalType;
-    UINT8                   Reserved1;
-    UINT16                  PciDeviceId;
-    UINT16                  PciVendorId;
-    UINT8                   PciBus;
-    UINT8                   PciDevice;
-    UINT8                   PciFunction;
-    UINT32                  PciFlags;
-    UINT8                   PciSegment;
-    UINT32                  Reserved2;
+    UINT32                  ArrayOffset;
+
+} ACPI_TABLE_PDTT;
 
-} ACPI_TABLE_SPCR;
 
-/* Masks for PciFlags field above */
+/*
+ * PDTT Communication Channel Identifier Structure.
+ * The number of these structures is defined by TriggerCount above,
+ * starting at ArrayOffset.
+ */
+typedef struct acpi_pdtt_channel
+{
+    UINT8                   SubchannelId;
+    UINT8                   Flags;
 
-#define ACPI_SPCR_DO_NOT_DISABLE    (1)
+} ACPI_PDTT_CHANNEL;
 
-/* Values for Interface Type: See the definition of the DBG2 table */
+/* Flags for above */
+
+#define ACPI_PDTT_RUNTIME_TRIGGER           (1)
+#define ACPI_PDTT_WAIT_COMPLETION           (1<<1)
 
 
 /*******************************************************************************
  *
- * SPMI - Server Platform Management Interface table
- *        Version 5
- *
- * Conforms to "Intelligent Platform Management Interface Specification
- * Second Generation v2.0", Document Revision 1.0, February 12, 2004 with
- * June 12, 2009 markup.
+ * PMTT - Platform Memory Topology Table (ACPI 5.0)
+ *        Version 1
  *
  ******************************************************************************/
 
-typedef struct acpi_table_spmi
+typedef struct acpi_table_pmtt
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT8                   InterfaceType;
-    UINT8                   Reserved;           /* Must be 1 */
-    UINT16                  SpecRevision;       /* Version of IPMI */
-    UINT8                   InterruptType;
-    UINT8                   GpeNumber;          /* GPE assigned */
-    UINT8                   Reserved1;
-    UINT8                   PciDeviceFlag;
-    UINT32                  Interrupt;
-    ACPI_GENERIC_ADDRESS    IpmiRegister;
-    UINT8                   PciSegment;
-    UINT8                   PciBus;
-    UINT8                   PciDevice;
-    UINT8                   PciFunction;
-    UINT8                   Reserved2;
+    UINT32                  Reserved;
+
+} ACPI_TABLE_PMTT;
 
-} ACPI_TABLE_SPMI;
 
-/* Values for InterfaceType above */
+/* Common header for PMTT subtables that follow main table */
 
-enum AcpiSpmiInterfaceTypes
+typedef struct acpi_pmtt_header
 {
-    ACPI_SPMI_NOT_USED              = 0,
-    ACPI_SPMI_KEYBOARD              = 1,
-    ACPI_SPMI_SMI                   = 2,
-    ACPI_SPMI_BLOCK_TRANSFER        = 3,
-    ACPI_SPMI_SMBUS                 = 4,
-    ACPI_SPMI_RESERVED              = 5         /* 5 and above are reserved */
-};
+    UINT8                   Type;
+    UINT8                   Reserved1;
+    UINT16                  Length;
+    UINT16                  Flags;
+    UINT16                  Reserved2;
 
+} ACPI_PMTT_HEADER;
 
-/*******************************************************************************
- *
- * TCPA - Trusted Computing Platform Alliance table
- *        Version 2
- *
- * TCG Hardware Interface Table for TPM 1.2 Clients and Servers
- *
- * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
- * Version 1.2, Revision 8
- * February 27, 2017
- *
- * NOTE: There are two versions of the table with the same signature --
- * the client version and the server version. The common PlatformClass
- * field is used to differentiate the two types of tables.
- *
- ******************************************************************************/
+/* Values for Type field above */
 
-typedef struct acpi_table_tcpa_hdr
-{
-    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT16                  PlatformClass;
+#define ACPI_PMTT_TYPE_SOCKET           0
+#define ACPI_PMTT_TYPE_CONTROLLER       1
+#define ACPI_PMTT_TYPE_DIMM             2
+#define ACPI_PMTT_TYPE_RESERVED         3 /* 0x03-0xFF are reserved */
+
+/* Values for Flags field above */
+
+#define ACPI_PMTT_TOP_LEVEL             0x0001
+#define ACPI_PMTT_PHYSICAL              0x0002
+#define ACPI_PMTT_MEMORY_TYPE           0x000C
 
-} ACPI_TABLE_TCPA_HDR;
 
 /*
- * Values for PlatformClass above.
- * This is how the client and server subtables are differentiated
+ * PMTT subtables, correspond to Type in acpi_pmtt_header
  */
-#define ACPI_TCPA_CLIENT_TABLE          0
-#define ACPI_TCPA_SERVER_TABLE          1
 
 
-typedef struct acpi_table_tcpa_client
+/* 0: Socket Structure */
+
+typedef struct acpi_pmtt_socket
 {
-    UINT32                  MinimumLogLength;   /* Minimum length for the event log area */
-    UINT64                  LogAddress;         /* Address of the event log area */
+    ACPI_PMTT_HEADER        Header;
+    UINT16                  SocketId;
+    UINT16                  Reserved;
+
+} ACPI_PMTT_SOCKET;
 
-} ACPI_TABLE_TCPA_CLIENT;
 
-typedef struct acpi_table_tcpa_server
+/* 1: Memory Controller subtable */
+
+typedef struct acpi_pmtt_controller
 {
+    ACPI_PMTT_HEADER        Header;
+    UINT32                  ReadLatency;
+    UINT32                  WriteLatency;
+    UINT32                  ReadBandwidth;
+    UINT32                  WriteBandwidth;
+    UINT16                  AccessWidth;
+    UINT16                  Alignment;
     UINT16                  Reserved;
-    UINT64                  MinimumLogLength;   /* Minimum length for the event log area */
-    UINT64                  LogAddress;         /* Address of the event log area */
-    UINT16                  SpecRevision;
-    UINT8                   DeviceFlags;
-    UINT8                   InterruptFlags;
-    UINT8                   GpeNumber;
-    UINT8                   Reserved2[3];
-    UINT32                  GlobalInterrupt;
-    ACPI_GENERIC_ADDRESS    Address;
-    UINT32                  Reserved3;
-    ACPI_GENERIC_ADDRESS    ConfigAddress;
-    UINT8                   Group;
-    UINT8                   Bus;                /* PCI Bus/Segment/Function numbers */
-    UINT8                   Device;
-    UINT8                   Function;
+    UINT16                  DomainCount;
+
+} ACPI_PMTT_CONTROLLER;
+
+/* 1a: Proximity Domain substructure */
+
+typedef struct acpi_pmtt_domain
+{
+    UINT32                  ProximityDomain;
 
-} ACPI_TABLE_TCPA_SERVER;
+} ACPI_PMTT_DOMAIN;
 
-/* Values for DeviceFlags above */
 
-#define ACPI_TCPA_PCI_DEVICE            (1)
-#define ACPI_TCPA_BUS_PNP               (1<<1)
-#define ACPI_TCPA_ADDRESS_VALID         (1<<2)
+/* 2: Physical Component Identifier (DIMM) */
 
-/* Values for InterruptFlags above */
+typedef struct acpi_pmtt_physical_component
+{
+    ACPI_PMTT_HEADER        Header;
+    UINT16                  ComponentId;
+    UINT16                  Reserved;
+    UINT32                  MemorySize;
+    UINT32                  BiosHandle;
 
-#define ACPI_TCPA_INTERRUPT_MODE        (1)
-#define ACPI_TCPA_INTERRUPT_POLARITY    (1<<1)
-#define ACPI_TCPA_SCI_VIA_GPE           (1<<2)
-#define ACPI_TCPA_GLOBAL_INTERRUPT      (1<<3)
+} ACPI_PMTT_PHYSICAL_COMPONENT;
 
 
 /*******************************************************************************
  *
- * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table
- *        Version 4
- *
- * TCG Hardware Interface Table for TPM 2.0 Clients and Servers
- *
- * Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
- * Version 1.2, Revision 8
- * February 27, 2017
+ * PPTT - Processor Properties Topology Table (ACPI 6.2)
+ *        Version 1
  *
  ******************************************************************************/
 
-typedef struct acpi_table_tpm2
+typedef struct acpi_table_pptt
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT16                  PlatformClass;
-    UINT16                  Reserved;
-    UINT64                  ControlAddress;
-    UINT32                  StartMethod;
 
-    /* Platform-specific data follows */
+} ACPI_TABLE_PPTT;
 
-} ACPI_TABLE_TPM2;
-
-/* Values for StartMethod above */
+/* Values for Type field above */
 
-#define ACPI_TPM2_NOT_ALLOWED                       0
-#define ACPI_TPM2_RESERVED1                         1
-#define ACPI_TPM2_START_METHOD                      2
-#define ACPI_TPM2_RESERVED3                         3
-#define ACPI_TPM2_RESERVED4                         4
-#define ACPI_TPM2_RESERVED5                         5
-#define ACPI_TPM2_MEMORY_MAPPED                     6
-#define ACPI_TPM2_COMMAND_BUFFER                    7
-#define ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD  8
-#define ACPI_TPM2_RESERVED9                         9
-#define ACPI_TPM2_RESERVED10                        10
-#define ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC       11  /* V1.2 Rev 8 */
-#define ACPI_TPM2_RESERVED                          12
+enum AcpiPpttType
+{
+    ACPI_PPTT_TYPE_PROCESSOR            = 0,
+    ACPI_PPTT_TYPE_CACHE                = 1,
+    ACPI_PPTT_TYPE_ID                   = 2,
+    ACPI_PPTT_TYPE_RESERVED             = 3
+};
 
 
-/* Optional trailer appears after any StartMethod subtables */
+/* 0: Processor Hierarchy Node Structure */
 
-typedef struct acpi_tpm2_trailer
+typedef struct acpi_pptt_processor
 {
-    UINT8                   MethodParameters[12];
-    UINT32                  MinimumLogLength;   /* Minimum length for the event log area */
-    UINT64                  LogAddress;         /* Address of the event log area */
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT16                  Reserved;
+    UINT32                  Flags;
+    UINT32                  Parent;
+    UINT32                  AcpiProcessorId;
+    UINT32                  NumberOfPrivResources;
 
-} ACPI_TPM2_TRAILER;
+} ACPI_PPTT_PROCESSOR;
 
+/* Flags */
 
-/*
- * Subtables (StartMethod-specific)
- */
+#define ACPI_PPTT_PHYSICAL_PACKAGE          (1)     /* Physical package */
+#define ACPI_PPTT_ACPI_PROCESSOR_ID_VALID   (2)     /* ACPI Processor ID valid */
 
-/* 11: Start Method for ARM SMC (V1.2 Rev 8) */
 
-typedef struct acpi_tpm2_arm_smc
+/* 1: Cache Type Structure */
+
+typedef struct acpi_pptt_cache
 {
-    UINT32                  GlobalInterrupt;
-    UINT8                   InterruptFlags;
-    UINT8                   OperationFlags;
+    ACPI_SUBTABLE_HEADER    Header;
     UINT16                  Reserved;
-    UINT32                  FunctionId;
+    UINT32                  Flags;
+    UINT32                  NextLevelOfCache;
+    UINT32                  Size;
+    UINT32                  NumberOfSets;
+    UINT8                   Associativity;
+    UINT8                   Attributes;
+    UINT16                  LineSize;
 
-} ACPI_TPM2_ARM_SMC;
+} ACPI_PPTT_CACHE;
 
-/* Values for InterruptFlags above */
+/* Flags */
 
-#define ACPI_TPM2_INTERRUPT_SUPPORT     (1)
+#define ACPI_PPTT_SIZE_PROPERTY_VALID       (1)     /* Physical property valid */
+#define ACPI_PPTT_NUMBER_OF_SETS_VALID      (1<<1)  /* Number of sets valid */
+#define ACPI_PPTT_ASSOCIATIVITY_VALID       (1<<2)  /* Associativity valid */
+#define ACPI_PPTT_ALLOCATION_TYPE_VALID     (1<<3)  /* Allocation type valid */
+#define ACPI_PPTT_CACHE_TYPE_VALID          (1<<4)  /* Cache type valid */
+#define ACPI_PPTT_WRITE_POLICY_VALID        (1<<5)  /* Write policy valid */
+#define ACPI_PPTT_LINE_SIZE_VALID           (1<<6)  /* Line size valid */
 
-/* Values for OperationFlags above */
+/* Masks for Attributes */
 
-#define ACPI_TPM2_IDLE_SUPPORT          (1)
+#define ACPI_PPTT_MASK_ALLOCATION_TYPE      (0x03)  /* Allocation type */
+#define ACPI_PPTT_MASK_CACHE_TYPE           (0x0C)  /* Cache type */
+#define ACPI_PPTT_MASK_WRITE_POLICY         (0x10)  /* Write policy */
 
+/* Attributes describing cache */
+#define ACPI_PPTT_CACHE_READ_ALLOCATE       (0x0)   /* Cache line is allocated on read */
+#define ACPI_PPTT_CACHE_WRITE_ALLOCATE      (0x01)  /* Cache line is allocated on write */
+#define ACPI_PPTT_CACHE_RW_ALLOCATE         (0x02)  /* Cache line is allocated on read and write */
+#define ACPI_PPTT_CACHE_RW_ALLOCATE_ALT     (0x03)  /* Alternate representation of above */
 
-/*******************************************************************************
- *
- * UEFI - UEFI Boot optimization Table
- *        Version 1
- *
- * Conforms to "Unified Extensible Firmware Interface Specification",
- * Version 2.3, May 8, 2009
- *
- ******************************************************************************/
+#define ACPI_PPTT_CACHE_TYPE_DATA           (0x0)   /* Data cache */
+#define ACPI_PPTT_CACHE_TYPE_INSTR          (1<<2)  /* Instruction cache */
+#define ACPI_PPTT_CACHE_TYPE_UNIFIED        (2<<2)  /* Unified I & D cache */
+#define ACPI_PPTT_CACHE_TYPE_UNIFIED_ALT    (3<<2)  /* Alternate representation of above */
+
+#define ACPI_PPTT_CACHE_POLICY_WB           (0x0)   /* Cache is write back */
+#define ACPI_PPTT_CACHE_POLICY_WT           (1<<4)  /* Cache is write through */
 
-typedef struct acpi_table_uefi
+/* 2: ID Structure */
+
+typedef struct acpi_pptt_id
 {
-    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT8                   Identifier[16];     /* UUID identifier */
-    UINT16                  DataOffset;         /* Offset of remaining data in table */
+    ACPI_SUBTABLE_HEADER    Header;
+    UINT16                  Reserved;
+    UINT32                  VendorId;
+    UINT64                  Level1Id;
+    UINT64                  Level2Id;
+    UINT16                  MajorRev;
+    UINT16                  MinorRev;
+    UINT16                  SpinRev;
 
-} ACPI_TABLE_UEFI;
+} ACPI_PPTT_ID;
 
 
 /*******************************************************************************
  *
- * VRTC - Virtual Real Time Clock Table
+ * RASF - RAS Feature Table (ACPI 5.0)
  *        Version 1
  *
- * Conforms to "Simple Firmware Interface Specification",
- * Draft 0.8.2, Oct 19, 2010
- * NOTE: The ACPI VRTC is equivalent to The SFI MRTC table.
- *
  ******************************************************************************/
 
-typedef struct acpi_table_vrtc
+typedef struct acpi_table_rasf
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    UINT8                   ChannelId[12];
 
-} ACPI_TABLE_VRTC;
+} ACPI_TABLE_RASF;
 
-/* VRTC entry */
+/* RASF Platform Communication Channel Shared Memory Region */
 
-typedef struct acpi_vrtc_entry
+typedef struct acpi_rasf_shared_memory
 {
-    ACPI_GENERIC_ADDRESS    PhysicalAddress;
-    UINT32                  Irq;
-
-} ACPI_VRTC_ENTRY;
+    UINT32                  Signature;
+    UINT16                  Command;
+    UINT16                  Status;
+    UINT16                  Version;
+    UINT8                   Capabilities[16];
+    UINT8                   SetCapabilities[16];
+    UINT16                  NumParameterBlocks;
+    UINT32                  SetCapabilitiesStatus;
 
+} ACPI_RASF_SHARED_MEMORY;
 
-/*******************************************************************************
- *
- * WAET - Windows ACPI Emulated devices Table
- *        Version 1
- *
- * Conforms to "Windows ACPI Emulated Devices Table", version 1.0, April 6, 2009
- *
- ******************************************************************************/
+/* RASF Parameter Block Structure Header */
 
-typedef struct acpi_table_waet
+typedef struct acpi_rasf_parameter_block
 {
-    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT32                  Flags;
+    UINT16                  Type;
+    UINT16                  Version;
+    UINT16                  Length;
 
-} ACPI_TABLE_WAET;
+} ACPI_RASF_PARAMETER_BLOCK;
 
-/* Masks for Flags field above */
+/* RASF Parameter Block Structure for PATROL_SCRUB */
 
-#define ACPI_WAET_RTC_NO_ACK        (1)         /* RTC requires no int acknowledge */
-#define ACPI_WAET_TIMER_ONE_READ    (1<<1)      /* PM timer requires only one read */
+typedef struct acpi_rasf_patrol_scrub_parameter
+{
+    ACPI_RASF_PARAMETER_BLOCK   Header;
+    UINT16                      PatrolScrubCommand;
+    UINT64                      RequestedAddressRange[2];
+    UINT64                      ActualAddressRange[2];
+    UINT16                      Flags;
+    UINT8                       RequestedSpeed;
 
+} ACPI_RASF_PATROL_SCRUB_PARAMETER;
 
-/*******************************************************************************
- *
- * WDAT - Watchdog Action Table
- *        Version 1
- *
- * Conforms to "Hardware Watchdog Timers Design Specification",
- * Copyright 2006 Microsoft Corporation.
- *
- ******************************************************************************/
+/* Masks for Flags and Speed fields above */
 
-typedef struct acpi_table_wdat
-{
-    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT32                  HeaderLength;       /* Watchdog Header Length */
-    UINT16                  PciSegment;         /* PCI Segment number */
-    UINT8                   PciBus;             /* PCI Bus number */
-    UINT8                   PciDevice;          /* PCI Device number */
-    UINT8                   PciFunction;        /* PCI Function number */
-    UINT8                   Reserved[3];
-    UINT32                  TimerPeriod;        /* Period of one timer count (msec) */
-    UINT32                  MaxCount;           /* Maximum counter value supported */
-    UINT32                  MinCount;           /* Minimum counter value */
-    UINT8                   Flags;
-    UINT8                   Reserved2[3];
-    UINT32                  Entries;            /* Number of watchdog entries that follow */
+#define ACPI_RASF_SCRUBBER_RUNNING      1
+#define ACPI_RASF_SPEED                 (7<<1)
+#define ACPI_RASF_SPEED_SLOW            (0<<1)
+#define ACPI_RASF_SPEED_MEDIUM          (4<<1)
+#define ACPI_RASF_SPEED_FAST            (7<<1)
 
-} ACPI_TABLE_WDAT;
+/* Channel Commands */
 
-/* Masks for Flags field above */
+enum AcpiRasfCommands
+{
+    ACPI_RASF_EXECUTE_RASF_COMMAND      = 1
+};
 
-#define ACPI_WDAT_ENABLED           (1)
-#define ACPI_WDAT_STOPPED           0x80
+/* Platform RAS Capabilities */
 
+enum AcpiRasfCapabiliities
+{
+    ACPI_HW_PATROL_SCRUB_SUPPORTED      = 0,
+    ACPI_SW_PATROL_SCRUB_EXPOSED        = 1
+};
 
-/* WDAT Instruction Entries (actions) */
+/* Patrol Scrub Commands */
 
-typedef struct acpi_wdat_entry
+enum AcpiRasfPatrolScrubCommands
 {
-    UINT8                   Action;
-    UINT8                   Instruction;
-    UINT16                  Reserved;
-    ACPI_GENERIC_ADDRESS    RegisterRegion;
-    UINT32                  Value;              /* Value used with Read/Write register */
-    UINT32                  Mask;               /* Bitmask required for this register instruction */
-
-} ACPI_WDAT_ENTRY;
-
-/* Values for Action field above */
-
-enum AcpiWdatActions
-{
-    ACPI_WDAT_RESET                 = 1,
-    ACPI_WDAT_GET_CURRENT_COUNTDOWN = 4,
-    ACPI_WDAT_GET_COUNTDOWN         = 5,
-    ACPI_WDAT_SET_COUNTDOWN         = 6,
-    ACPI_WDAT_GET_RUNNING_STATE     = 8,
-    ACPI_WDAT_SET_RUNNING_STATE     = 9,
-    ACPI_WDAT_GET_STOPPED_STATE     = 10,
-    ACPI_WDAT_SET_STOPPED_STATE     = 11,
-    ACPI_WDAT_GET_REBOOT            = 16,
-    ACPI_WDAT_SET_REBOOT            = 17,
-    ACPI_WDAT_GET_SHUTDOWN          = 18,
-    ACPI_WDAT_SET_SHUTDOWN          = 19,
-    ACPI_WDAT_GET_STATUS            = 32,
-    ACPI_WDAT_SET_STATUS            = 33,
-    ACPI_WDAT_ACTION_RESERVED       = 34    /* 34 and greater are reserved */
+    ACPI_RASF_GET_PATROL_PARAMETERS     = 1,
+    ACPI_RASF_START_PATROL_SCRUBBER     = 2,
+    ACPI_RASF_STOP_PATROL_SCRUBBER      = 3
 };
 
-/* Values for Instruction field above */
+/* Channel Command flags */
 
-enum AcpiWdatInstructions
+#define ACPI_RASF_GENERATE_SCI          (1<<15)
+
+/* Status values */
+
+enum AcpiRasfStatus
 {
-    ACPI_WDAT_READ_VALUE            = 0,
-    ACPI_WDAT_READ_COUNTDOWN        = 1,
-    ACPI_WDAT_WRITE_VALUE           = 2,
-    ACPI_WDAT_WRITE_COUNTDOWN       = 3,
-    ACPI_WDAT_INSTRUCTION_RESERVED  = 4,    /* 4 and greater are reserved */
-    ACPI_WDAT_PRESERVE_REGISTER     = 0x80  /* Except for this value */
+    ACPI_RASF_SUCCESS                   = 0,
+    ACPI_RASF_NOT_VALID                 = 1,
+    ACPI_RASF_NOT_SUPPORTED             = 2,
+    ACPI_RASF_BUSY                      = 3,
+    ACPI_RASF_FAILED                    = 4,
+    ACPI_RASF_ABORTED                   = 5,
+    ACPI_RASF_INVALID_DATA              = 6
 };
 
+/* Status flags */
+
+#define ACPI_RASF_COMMAND_COMPLETE      (1)
+#define ACPI_RASF_SCI_DOORBELL          (1<<1)
+#define ACPI_RASF_ERROR                 (1<<2)
+#define ACPI_RASF_STATUS                (0x1F<<3)
+
 
 /*******************************************************************************
  *
- * WDDT - Watchdog Descriptor Table
+ * SBST - Smart Battery Specification Table
  *        Version 1
  *
- * Conforms to "Using the Intel ICH Family Watchdog Timer (WDT)",
- * Version 001, September 2002
- *
  ******************************************************************************/
 
-typedef struct acpi_table_wddt
+typedef struct acpi_table_sbst
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT16                  SpecVersion;
-    UINT16                  TableVersion;
-    UINT16                  PciVendorId;
-    ACPI_GENERIC_ADDRESS    Address;
-    UINT16                  MaxCount;           /* Maximum counter value supported */
-    UINT16                  MinCount;           /* Minimum counter value supported */
-    UINT16                  Period;
-    UINT16                  Status;
-    UINT16                  Capability;
-
-} ACPI_TABLE_WDDT;
-
-/* Flags for Status field above */
+    UINT32                  WarningLevel;
+    UINT32                  LowLevel;
+    UINT32                  CriticalLevel;
 
-#define ACPI_WDDT_AVAILABLE     (1)
-#define ACPI_WDDT_ACTIVE        (1<<1)
-#define ACPI_WDDT_TCO_OS_OWNED  (1<<2)
-#define ACPI_WDDT_USER_RESET    (1<<11)
-#define ACPI_WDDT_WDT_RESET     (1<<12)
-#define ACPI_WDDT_POWER_FAIL    (1<<13)
-#define ACPI_WDDT_UNKNOWN_RESET (1<<14)
-
-/* Flags for Capability field above */
-
-#define ACPI_WDDT_AUTO_RESET    (1)
-#define ACPI_WDDT_ALERT_SUPPORT (1<<1)
+} ACPI_TABLE_SBST;
 
 
 /*******************************************************************************
  *
- * WDRT - Watchdog Resource Table
- *        Version 1
+ * SDEI - Software Delegated Exception Interface Descriptor Table
  *
- * Conforms to "Watchdog Timer Hardware Requirements for Windows Server 2003",
- * Version 1.01, August 28, 2006
+ * Conforms to "Software Delegated Exception Interface (SDEI)" ARM DEN0054A,
+ * May 8th, 2017. Copyright 2017 ARM Ltd.
  *
  ******************************************************************************/
 
-typedef struct acpi_table_wdrt
+typedef struct acpi_table_sdei
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    ACPI_GENERIC_ADDRESS    ControlRegister;
-    ACPI_GENERIC_ADDRESS    CountRegister;
-    UINT16                  PciDeviceId;
-    UINT16                  PciVendorId;
-    UINT8                   PciBus;             /* PCI Bus number */
-    UINT8                   PciDevice;          /* PCI Device number */
-    UINT8                   PciFunction;        /* PCI Function number */
-    UINT8                   PciSegment;         /* PCI Segment number */
-    UINT16                  MaxCount;           /* Maximum counter value supported */
-    UINT8                   Units;
 
-} ACPI_TABLE_WDRT;
+} ACPI_TABLE_SDEI;
 
 
 /*******************************************************************************
  *
- * WSMT - Windows SMM Security Migrations Table
+ * SDEV - Secure Devices Table (ACPI 6.2)
  *        Version 1
  *
- * Conforms to "Windows SMM Security Migrations Table",
- * Version 1.0, April 18, 2016
- *
  ******************************************************************************/
 
-typedef struct acpi_table_wsmt
+typedef struct acpi_table_sdev
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT32                  ProtectionFlags;
 
-} ACPI_TABLE_WSMT;
+} ACPI_TABLE_SDEV;
+
+
+typedef struct acpi_sdev_header
+{
+    UINT8                   Type;
+    UINT8                   Flags;
+    UINT16                  Length;
+
+} ACPI_SDEV_HEADER;
+
+
+/* Values for subtable type above */
+
+enum AcpiSdevType
+{
+    ACPI_SDEV_TYPE_NAMESPACE_DEVICE     = 0,
+    ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE = 1,
+    ACPI_SDEV_TYPE_RESERVED             = 2     /* 2 and greater are reserved */
+};
+
+/* Values for flags above */
+
+#define ACPI_SDEV_HANDOFF_TO_UNSECURE_OS    (1)
 
-/* Flags for ProtectionFlags field above */
+/*
+ * SDEV subtables
+ */
+
+/* 0: Namespace Device Based Secure Device Structure */
+
+typedef struct acpi_sdev_namespace
+{
+    ACPI_SDEV_HEADER        Header;
+    UINT16                  DeviceIdOffset;
+    UINT16                  DeviceIdLength;
+    UINT16                  VendorDataOffset;
+    UINT16                  VendorDataLength;
+
+} ACPI_SDEV_NAMESPACE;
+
+/* 1: PCIe Endpoint Device Based Device Structure */
+
+typedef struct acpi_sdev_pcie
+{
+    ACPI_SDEV_HEADER        Header;
+    UINT16                  Segment;
+    UINT16                  StartBus;
+    UINT16                  PathOffset;
+    UINT16                  PathLength;
+    UINT16                  VendorDataOffset;
+    UINT16                  VendorDataLength;
+
+} ACPI_SDEV_PCIE;
+
+/* 1a: PCIe Endpoint path entry */
+
+typedef struct acpi_sdev_pcie_path
+{
+    UINT8                   Device;
+    UINT8                   Function;
 
-#define ACPI_WSMT_FIXED_COMM_BUFFERS                (1)
-#define ACPI_WSMT_COMM_BUFFER_NESTED_PTR_PROTECTION (2)
-#define ACPI_WSMT_SYSTEM_RESOURCE_PROTECTION        (4)
+} ACPI_SDEV_PCIE_PATH;
 
 
 /* Reset to default packing */
index 10228b1..8af4a6d 100644 (file)
 
 /*******************************************************************************
  *
- * Additional ACPI Tables (3)
+ * Additional ACPI Tables
  *
  * These tables are not consumed directly by the ACPICA subsystem, but are
  * included here to support device drivers and the AML disassembler.
  *
- * In general, the tables in this file are fully defined within the ACPI
- * specification.
- *
  ******************************************************************************/
 
 
  * file. Useful because they make it more difficult to inadvertently type in
  * the wrong signature.
  */
-#define ACPI_SIG_BGRT           "BGRT"      /* Boot Graphics Resource Table */
-#define ACPI_SIG_DRTM           "DRTM"      /* Dynamic Root of Trust for Measurement table */
-#define ACPI_SIG_FPDT           "FPDT"      /* Firmware Performance Data Table */
-#define ACPI_SIG_GTDT           "GTDT"      /* Generic Timer Description Table */
-#define ACPI_SIG_MPST           "MPST"      /* Memory Power State Table */
-#define ACPI_SIG_PCCT           "PCCT"      /* Platform Communications Channel Table */
-#define ACPI_SIG_PMTT           "PMTT"      /* Platform Memory Topology Table */
-#define ACPI_SIG_RASF           "RASF"      /* RAS Feature table */
+#define ACPI_SIG_SLIC           "SLIC"      /* Software Licensing Description Table */
+#define ACPI_SIG_SLIT           "SLIT"      /* System Locality Distance Information Table */
+#define ACPI_SIG_SPCR           "SPCR"      /* Serial Port Console Redirection table */
+#define ACPI_SIG_SPMI           "SPMI"      /* Server Platform Management Interface table */
+#define ACPI_SIG_SRAT           "SRAT"      /* System Resource Affinity Table */
 #define ACPI_SIG_STAO           "STAO"      /* Status Override table */
+#define ACPI_SIG_TCPA           "TCPA"      /* Trusted Computing Platform Alliance table */
+#define ACPI_SIG_TPM2           "TPM2"      /* Trusted Platform Module 2.0 H/W interface table */
+#define ACPI_SIG_UEFI           "UEFI"      /* Uefi Boot Optimization Table */
+#define ACPI_SIG_VRTC           "VRTC"      /* Virtual Real Time Clock Table */
+#define ACPI_SIG_WAET           "WAET"      /* Windows ACPI Emulated devices Table */
+#define ACPI_SIG_WDAT           "WDAT"      /* Watchdog Action Table */
+#define ACPI_SIG_WDDT           "WDDT"      /* Watchdog Timer Description Table */
+#define ACPI_SIG_WDRT           "WDRT"      /* Watchdog Resource Table */
 #define ACPI_SIG_WPBT           "WPBT"      /* Windows Platform Binary Table */
+#define ACPI_SIG_WSMT           "WSMT"      /* Windows SMM Security Migrations Table */
 #define ACPI_SIG_XENV           "XENV"      /* Xen Environment table */
-
-#define ACPI_SIG_S3PT           "S3PT"      /* S3 Performance (sub)Table */
-#define ACPI_SIG_PCCS           "PCC"       /* PCC Shared Memory Region */
-
-/* Reserved table signatures */
-
-#define ACPI_SIG_MATR           "MATR"      /* Memory Address Translation Table */
-#define ACPI_SIG_MSDM           "MSDM"      /* Microsoft Data Management Table */
+#define ACPI_SIG_XXXX           "XXXX"      /* Intermediate AML header for ASL/ASL+ converter */
 
 /*
  * All tables must be byte-packed to match the ACPI specification, since
 
 /*******************************************************************************
  *
- * BGRT - Boot Graphics Resource Table (ACPI 5.0)
- *        Version 1
+ * SLIC - Software Licensing Description Table
+ *
+ * Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
+ * November 29, 2011. Copyright 2011 Microsoft
  *
  ******************************************************************************/
 
-typedef struct acpi_table_bgrt
+/* Basic SLIC table is only the common ACPI header */
+
+typedef struct acpi_table_slic
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT16                  Version;
-    UINT8                   Status;
-    UINT8                   ImageType;
-    UINT64                  ImageAddress;
-    UINT32                  ImageOffsetX;
-    UINT32                  ImageOffsetY;
-
-} ACPI_TABLE_BGRT;
-
-/* Flags for Status field above */
 
-#define ACPI_BGRT_DISPLAYED                 (1)
-#define ACPI_BGRT_ORIENTATION_OFFSET        (3 << 1)
+} ACPI_TABLE_SLIC;
 
 
 /*******************************************************************************
  *
- * DRTM - Dynamic Root of Trust for Measurement table
- * Conforms to "TCG D-RTM Architecture" June 17 2013, Version 1.0.0
- * Table version 1
+ * SLIT - System Locality Distance Information Table
+ *        Version 1
  *
  ******************************************************************************/
 
-typedef struct acpi_table_drtm
+typedef struct acpi_table_slit
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
-    UINT64                  EntryBaseAddress;
-    UINT64                  EntryLength;
-    UINT32                  EntryAddress32;
-    UINT64                  EntryAddress64;
-    UINT64                  ExitAddress;
-    UINT64                  LogAreaAddress;
-    UINT32                  LogAreaLength;
-    UINT64                  ArchDependentAddress;
-    UINT32                  Flags;
-
-} ACPI_TABLE_DRTM;
-
-/* Flag Definitions for above */
-
-#define ACPI_DRTM_ACCESS_ALLOWED            (1)
-#define ACPI_DRTM_ENABLE_GAP_CODE           (1<<1)
-#define ACPI_DRTM_INCOMPLETE_MEASUREMENTS   (1<<2)
-#define ACPI_DRTM_AUTHORITY_ORDER           (1<<3)
-
-
-/* 1) Validated Tables List (64-bit addresses) */
-
-typedef struct acpi_drtm_vtable_list
-{
-    UINT32                  ValidatedTableCount;
-    UINT64                  ValidatedTables[1];
+    UINT64                  LocalityCount;
+    UINT8                   Entry[1];           /* Real size = localities^2 */
 
-} ACPI_DRTM_VTABLE_LIST;
-
-/* 2) Resources List (of Resource Descriptors) */
-
-/* Resource Descriptor */
-
-typedef struct acpi_drtm_resource
-{
-    UINT8                   Size[7];
-    UINT8                   Type;
-    UINT64                  Address;
-
-} ACPI_DRTM_RESOURCE;
-
-typedef struct acpi_drtm_resource_list
-{
-    UINT32                  ResourceCount;
-    ACPI_DRTM_RESOURCE      Resources[1];
-
-} ACPI_DRTM_RESOURCE_LIST;
-
-/* 3) Platform-specific Identifiers List */
-
-typedef struct acpi_drtm_dps_id
-{
-    UINT32                  DpsIdLength;
-    UINT8                   DpsId[16];
-
-} ACPI_DRTM_DPS_ID;
+} ACPI_TABLE_SLIT;
 
 
 /*******************************************************************************
  *
- * FPDT - Firmware Performance Data Table (ACPI 5.0)
- *        Version 1
+ * SPCR - Serial Port Console Redirection table
+ *        Version 2
+ *
+ * Conforms to "Serial Port Console Redirection Table",
+ * Version 1.03, August 10, 2015
  *
  ******************************************************************************/
 
-typedef struct acpi_table_fpdt
+typedef struct acpi_table_spcr
 {
     ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    UINT8                   InterfaceType;      /* 0=full 16550, 1=subset of 16550 */
+    UINT8                   Reserved[3];
+    ACPI_GENERIC_ADDRESS    SerialPort;
+    UINT8                   InterruptType;
+    UINT8                   PcInterrupt;
+    UINT32                  Interrupt;
+    UINT8                   BaudRate;
+    UINT8                   Parity;
+    UINT8                   StopBits;
+    UINT8                   FlowControl;
+    UINT8                   TerminalType;
+    UINT8                   Reserved1;
+    UINT16                  PciDeviceId;
+    UINT16                  PciVendorId;
+    UINT8                   PciBus;
+    UINT8                   PciDevice;
+    UINT8                   PciFunction;
+    UINT32                  PciFlags;
+    UINT8                   PciSegment;
+    UINT32                  Reserved2;
 
-} ACPI_TABLE_FPDT;
+} ACPI_TABLE_SPCR;
 
+/* Masks for PciFlags field above */
 
-/* FPDT subtable header (Performance Record Structure) */
+#define ACPI_SPCR_DO_NOT_DISABLE    (1)
 
-typedef struct acpi_fpdt_header
-{
-    UINT16                  Type;
-    UINT8                   Length;
-    UINT8                   Revision;
+/* Values for Interface Type: See the definition of the DBG2 table */
 
-} ACPI_FPDT_HEADER;
 
-/* Values for Type field above */
+/*******************************************************************************
+ *
+ * SPMI - Server Platform Management Interface table
+ *        Version 5
+ *
+ * Conforms to "Intelligent Platform Management Interface Specification
+ * Second Generation v2.0", Document Revision 1.0, February 12, 2004 with
+ * June 12, 2009 markup.
+ *
+ ******************************************************************************/
 
-enum AcpiFpdtType
+typedef struct acpi_table_spmi
 {
-    ACPI_FPDT_TYPE_BOOT                 = 0,
-    ACPI_FPDT_TYPE_S3PERF               = 1
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    UINT8                   InterfaceType;
+    UINT8                   Reserved;           /* Must be 1 */
+    UINT16                  SpecRevision;       /* Version of IPMI */
+    UINT8                   InterruptType;
+    UINT8                   GpeNumber;          /* GPE assigned */
+    UINT8                   Reserved1;
+    UINT8                   PciDeviceFlag;
+    UINT32                  Interrupt;
+    ACPI_GENERIC_ADDRESS    IpmiRegister;
+    UINT8                   PciSegment;
+    UINT8                   PciBus;
+    UINT8                   PciDevice;
+    UINT8                   PciFunction;
+    UINT8                   Reserved2;
+
+} ACPI_TABLE_SPMI;
+
+/* Values for InterfaceType above */
+
+enum AcpiSpmiInterfaceTypes
+{
+    ACPI_SPMI_NOT_USED              = 0,
+    ACPI_SPMI_KEYBOARD              = 1,
+    ACPI_SPMI_SMI                   = 2,
+    ACPI_SPMI_BLOCK_TRANSFER        = 3,
+    ACPI_SPMI_SMBUS                 = 4,
+    ACPI_SPMI_RESERVED              = 5         /* 5 and above are reserved */
 };
 
 
-/*
- * FPDT subtables
- */
-
-/* 0: Firmware Basic Boot Performance Record */
-
-typedef struct acpi_fpdt_boot_pointer
-{
-    ACPI_FPDT_HEADER        Header;
-    UINT8                   Reserved[4];
-    UINT64                  Address;
-
-} ACPI_FPDT_BOOT_POINTER;
-
-
-/* 1: S3 Performance Table Pointer Record */
+/*******************************************************************************
+ *
+ * SRAT - System Resource Affinity Table
+ *        Version 3
+ *
+ ******************************************************************************/
 
-typedef struct acpi_fpdt_s3pt_pointer
+typedef struct acpi_table_srat
 {
-    ACPI_FPDT_HEADER        Header;
-    UINT8                   Reserved[4];
-    UINT64                  Address;
+    ACPI_TABLE_HEADER       Header;             /* Common ACPI table header */
+    UINT32                  TableRevision;      /* Must be value '1' */