[ACPICA] Update to version 20190816. CORE-16368
authorThomas Faber <thomas.faber@reactos.org>
Sat, 7 Sep 2019 11:56:10 +0000 (13:56 +0200)
committerThomas Faber <thomas.faber@reactos.org>
Sun, 8 Sep 2019 05:46:53 +0000 (07:46 +0200)
22 files changed:
drivers/bus/acpi/acpica/events/evgpe.c
drivers/bus/acpi/acpica/events/evxfgpe.c
drivers/bus/acpi/acpica/executer/exconfig.c
drivers/bus/acpi/acpica/executer/exdump.c
drivers/bus/acpi/acpica/include/acconfig.h
drivers/bus/acpi/acpica/include/aclocal.h
drivers/bus/acpi/acpica/include/acobject.h
drivers/bus/acpi/acpica/include/acpiosxf.h
drivers/bus/acpi/acpica/include/acpixf.h
drivers/bus/acpi/acpica/include/acstruct.h
drivers/bus/acpi/acpica/include/actypes.h
drivers/bus/acpi/acpica/include/acutils.h
drivers/bus/acpi/acpica/include/platform/acmsvc.h
drivers/bus/acpi/acpica/namespace/nsaccess.c
drivers/bus/acpi/acpica/namespace/nsalloc.c
drivers/bus/acpi/acpica/namespace/nsdump.c
drivers/bus/acpi/acpica/namespace/nsrepair2.c
drivers/bus/acpi/acpica/tables/tbdata.c
drivers/bus/acpi/acpica/utilities/utdebug.c
drivers/bus/acpi/acpica/utilities/uterror.c
drivers/bus/acpi/acpica/utilities/utosi.c
drivers/bus/acpi/acpica/utilities/utownerid.c

index 4f282e2..5908e59 100644 (file)
@@ -740,6 +740,15 @@ AcpiEvDetectGpe (
 
     Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
 
+    if (!GpeEventInfo)
+    {
+        GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
+        if (!GpeEventInfo)
+        {
+            goto ErrorExit;
+        }
+    }
+
     /* Get the info block for the entire GPE register */
 
     GpeRegisterInfo = GpeEventInfo->RegisterInfo;
index f56aa1d..f2946bc 100644 (file)
@@ -767,6 +767,33 @@ UnlockAndExit:
 ACPI_EXPORT_SYMBOL (AcpiGetGpeStatus)
 
 
+/*******************************************************************************
+ *
+ * FUNCTION:    AcpiDispatchGpe
+ *
+ * PARAMETERS:  GpeDevice           - Parent GPE Device. NULL for GPE0/GPE1
+ *              GpeNumber           - GPE level within the 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.
+ *
+ ******************************************************************************/
+
+UINT32
+AcpiDispatchGpe(
+    ACPI_HANDLE             GpeDevice,
+    UINT32                  GpeNumber)
+{
+    ACPI_FUNCTION_TRACE(acpi_dispatch_gpe);
+
+    return (AcpiEvDetectGpe (GpeDevice, NULL, GpeNumber));
+}
+
+ACPI_EXPORT_SYMBOL (AcpiDispatchGpe)
+
+
 /*******************************************************************************
  *
  * FUNCTION:    AcpiFinishGpe
index 7e2b0db..4555b53 100644 (file)
@@ -235,7 +235,9 @@ AcpiExLoadTableOp (
 
     /* Complete the initialization/resolution of new objects */
 
-    AcpiNsInitializeObjects ();
+    AcpiExExitInterpreter();
+    AcpiNsInitializeObjects();
+    AcpiExEnterInterpreter();
 
     /* Parameter Data (optional) */
 
index cfe1e30..607707a 100644 (file)
@@ -147,7 +147,7 @@ static ACPI_EXDUMP_INFO     AcpiExDumpMethod[9] =
     {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (Method.ParamCount),            "Parameter Count"},
     {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (Method.SyncLevel),             "Sync Level"},
     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Method.Mutex),                 "Mutex"},
-    {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (Method.OwnerId),               "Owner Id"},
+    {ACPI_EXD_UINT16,   ACPI_EXD_OFFSET (Method.OwnerId),               "Owner Id"},
     {ACPI_EXD_UINT8,    ACPI_EXD_OFFSET (Method.ThreadCount),           "Thread Count"},
     {ACPI_EXD_UINT32,   ACPI_EXD_OFFSET (Method.AmlLength),             "Aml Length"},
     {ACPI_EXD_POINTER,  ACPI_EXD_OFFSET (Method.AmlStart),              "Aml Start"}
@@ -314,8 +314,8 @@ static ACPI_EXDUMP_INFO     AcpiExDumpFieldCommon[7] =
 static ACPI_EXDUMP_INFO     AcpiExDumpNode[7] =
 {
     {ACPI_EXD_INIT,     ACPI_EXD_TABLE_SIZE (AcpiExDumpNode),           NULL},
-    {ACPI_EXD_UINT8,    ACPI_EXD_NSOFFSET (Flags),                      "Flags"},
-    {ACPI_EXD_UINT8,    ACPI_EXD_NSOFFSET (OwnerId),                    "Owner Id"},
+    {ACPI_EXD_UINT16,   ACPI_EXD_NSOFFSET (Flags),                      "Flags"},
+    {ACPI_EXD_UINT16,   ACPI_EXD_NSOFFSET (OwnerId),                    "Owner Id"},
     {ACPI_EXD_LIST,     ACPI_EXD_NSOFFSET (Object),                     "Object List"},
     {ACPI_EXD_NODE,     ACPI_EXD_NSOFFSET (Parent),                     "Parent"},
     {ACPI_EXD_NODE,     ACPI_EXD_NSOFFSET (Child),                      "Child"},
index 4a95e20..530983e 100644 (file)
 
 #define ACPI_DEFAULT_PAGE_SIZE          4096    /* Must be power of 2 */
 
-/* OwnerId tracking. 8 entries allows for 255 OwnerIds */
+/* OwnerId tracking. 128 entries allows for 4095 OwnerIds */
 
-#define ACPI_NUM_OWNERID_MASKS          8
+#define ACPI_NUM_OWNERID_MASKS          128
 
 /* Size of the root table array is increased by this increment */
 
index 0d68346..e45d97c 100644 (file)
@@ -187,12 +187,12 @@ typedef struct acpi_namespace_node
     union acpi_operand_object       *Object;        /* Interpreter object */
     UINT8                           DescriptorType; /* Differentiate object descriptor types */
     UINT8                           Type;           /* ACPI Type associated with this name */
-    UINT8                           Flags;          /* Miscellaneous flags */
-    ACPI_OWNER_ID                   OwnerId;        /* Node creator */
+    UINT16                          Flags;          /* Miscellaneous flags */
     ACPI_NAME_UNION                 Name;           /* ACPI Name, always 4 chars per ACPI spec */
     struct acpi_namespace_node      *Parent;        /* Parent node */
     struct acpi_namespace_node      *Child;         /* First child */
     struct acpi_namespace_node      *Peer;          /* First peer */
+    ACPI_OWNER_ID                   OwnerId;        /* Node creator */
 
     /*
      * The following fields are used by the ASL compiler and disassembler only
index 150f6fb..45f0983 100644 (file)
@@ -225,8 +225,8 @@ typedef struct acpi_object_method
     } Dispatch;
 
     UINT32                          AmlLength;
-    UINT8                           ThreadCount;
     ACPI_OWNER_ID                   OwnerId;
+    UINT8                           ThreadCount;
 
 } ACPI_OBJECT_METHOD;
 
index a874f65..9209c5a 100644 (file)
@@ -469,6 +469,7 @@ AcpiOsEnterSleep (
  * Debug print routines
  */
 #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPrintf
+ACPI_PRINTF_LIKE (1)
 void ACPI_INTERNAL_VAR_XFACE
 AcpiOsPrintf (
     const char              *Format,
index 9322858..d84c008 100644 (file)
@@ -46,7 +46,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20190703
+#define ACPI_CA_VERSION                 0x20190816
 
 #include "acconfig.h"
 #include "actypes.h"
@@ -338,6 +338,9 @@ ACPI_GLOBAL (BOOLEAN,               AcpiGbl_SystemAwakeAndRunning);
 #define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \
     ACPI_EXTERNAL_RETURN_OK(Prototype)
 
+#define ACPI_HW_DEPENDENT_RETURN_UINT32(prototype) \
+    ACPI_EXTERNAL_RETURN_UINT32(prototype)
+
 #define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \
     ACPI_EXTERNAL_RETURN_VOID(Prototype)
 
@@ -348,6 +351,9 @@ ACPI_GLOBAL (BOOLEAN,               AcpiGbl_SystemAwakeAndRunning);
 #define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \
     static ACPI_INLINE Prototype {return(AE_OK);}
 
+#define ACPI_HW_DEPENDENT_RETURN_UINT32(prototype) \
+    static ACPI_INLINE prototype {return(0);}
+
 #define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \
     static ACPI_INLINE Prototype {return;}
 
@@ -968,6 +974,12 @@ AcpiGetGpeStatus (
     UINT32                  GpeNumber,
     ACPI_EVENT_STATUS       *EventStatus))
 
+ACPI_HW_DEPENDENT_RETURN_UINT32 (
+UINT32
+AcpiDispatchGpe (
+    ACPI_HANDLE             GpeDevice,
+    UINT32                  GpeNumber))
+
 ACPI_HW_DEPENDENT_RETURN_STATUS (
 ACPI_STATUS
 AcpiDisableAllGpes (
index 04123f3..ae168d7 100644 (file)
@@ -219,9 +219,9 @@ typedef struct acpi_evaluate_info
     UINT32                          ReturnFlags;        /* Used for return value analysis */
     UINT32                          ReturnBtype;        /* Bitmapped type of the returned object */
     UINT16                          ParamCount;         /* Count of the input argument list */
+    UINT16                          NodeFlags;          /* Same as Node->Flags */
     UINT8                           PassNumber;         /* Parser pass number */
     UINT8                           ReturnObjectType;   /* Object type of the returned object */
-    UINT8                           NodeFlags;          /* Same as Node->Flags */
     UINT8                           Flags;              /* General flags */
 
 } ACPI_EVALUATE_INFO;
index 48a192a..e73dee3 100644 (file)
@@ -483,8 +483,8 @@ typedef void *                          ACPI_HANDLE;    /* Actually a ptr to a N
 
 /* Owner IDs are used to track namespace nodes for selective deletion */
 
-typedef UINT                          ACPI_OWNER_ID;
-#define ACPI_OWNER_ID_MAX               0xFF
+typedef UINT16                          ACPI_OWNER_ID;
+#define ACPI_OWNER_ID_MAX               0xFFF   /* 4095 possible owner IDs */
 
 
 #define ACPI_INTEGER_BIT_SIZE           64
@@ -549,7 +549,7 @@ typedef UINT64                          ACPI_INTEGER;
 
 /* Pointer/Integer type conversions */
 
-#define ACPI_TO_POINTER(i)              ACPI_ADD_PTR (void, (void *) 0, (ACPI_SIZE) (i))
+#define ACPI_TO_POINTER(i)              ACPI_CAST_PTR (void, (ACPI_SIZE) (i))
 #define ACPI_TO_INTEGER(p)              ACPI_PTR_DIFF (p, (void *) 0)
 #define ACPI_OFFSET(d, f)               ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) 0)
 #define ACPI_PHYSADDR_TO_PTR(i)         ACPI_TO_POINTER(i)
@@ -1405,12 +1405,14 @@ typedef enum
 #define ACPI_OSI_WIN_VISTA_SP2          0x0A
 #define ACPI_OSI_WIN_7                  0x0B
 #define ACPI_OSI_WIN_8                  0x0C
-#define ACPI_OSI_WIN_10                 0x0D
-#define ACPI_OSI_WIN_10_RS1             0x0E
-#define ACPI_OSI_WIN_10_RS2             0x0F
-#define ACPI_OSI_WIN_10_RS3             0x10
-#define ACPI_OSI_WIN_10_RS4             0x11
-#define ACPI_OSI_WIN_10_RS5             0x12
+#define ACPI_OSI_WIN_8_1                0x0D
+#define ACPI_OSI_WIN_10                 0x0E
+#define ACPI_OSI_WIN_10_RS1             0x0F
+#define ACPI_OSI_WIN_10_RS2             0x10
+#define ACPI_OSI_WIN_10_RS3             0x11
+#define ACPI_OSI_WIN_10_RS4             0x12
+#define ACPI_OSI_WIN_10_RS5             0x13
+#define ACPI_OSI_WIN_10_19H1            0x14
 
 
 /* Definitions of getopt */
index 5d40734..7e4922f 100644 (file)
@@ -1086,30 +1086,33 @@ AcpiUtDeleteAddressLists (
 /*
  * utxferror - various error/warning output functions
  */
+ACPI_PRINTF_LIKE(5)
 void ACPI_INTERNAL_VAR_XFACE
 AcpiUtPredefinedWarning (
     const char              *ModuleName,
     UINT32                  LineNumber,
     char                    *Pathname,
-    UINT                  NodeFlags,
+    UINT16                  NodeFlags,
     const char              *Format,
     ...);
 
+ACPI_PRINTF_LIKE(5)
 void ACPI_INTERNAL_VAR_XFACE
 AcpiUtPredefinedInfo (
     const char              *ModuleName,
     UINT32                  LineNumber,
     char                    *Pathname,
-    UINT                  NodeFlags,
+    UINT16                  NodeFlags,
     const char              *Format,
     ...);
 
+ACPI_PRINTF_LIKE(5)
 void ACPI_INTERNAL_VAR_XFACE
 AcpiUtPredefinedBiosError (
     const char              *ModuleName,
     UINT32                  LineNumber,
     char                    *Pathname,
-    UINT                  NodeFlags,
+    UINT16                  NodeFlags,
     const char              *Format,
     ...);
 
index c0c8290..5321eda 100644 (file)
@@ -659,7 +659,7 @@ AcpiNsLookup (
                 if (Flags & ACPI_NS_PREFIX_MUST_EXIST)
                 {
                     AcpiOsPrintf (ACPI_MSG_BIOS_ERROR
-                        "Object does not exist: %4.4s\n", &SimpleName);
+                        "Object does not exist: %4.4s\n", (char *) &SimpleName);
                 }
 #endif
                 /* Name not found in ACPI namespace */
index fb5cc71..b77725b 100644 (file)
@@ -315,7 +315,7 @@ AcpiNsInstallNode (
     Node->Type = (UINT8) Type;
 
     ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
-        "%4.4s (%s) [Node %p Owner %X] added to %4.4s (%s) [Node %p]\n",
+        "%4.4s (%s) [Node %p Owner %3.3X] added to %4.4s (%s) [Node %p]\n",
         AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type), Node, OwnerId,
         AcpiUtGetNodeName (ParentNode), AcpiUtGetTypeName (ParentNode->Type),
         ParentNode));
index cf03a11..67ff936 100644 (file)
@@ -272,7 +272,7 @@ AcpiNsDumpOneObject (
 
     /* Now we can print out the pertinent information */
 
-    AcpiOsPrintf (" %-12s %p %2.2X ",
+    AcpiOsPrintf (" %-12s %p %3.3X ",
         AcpiUtGetTypeName (Type), ThisNode, ThisNode->OwnerId);
 
     DbgLevel = AcpiDbgLevel;
index 6668ad1..88b8dc9 100644 (file)
@@ -181,7 +181,7 @@ static const ACPI_REPAIR_INFO       AcpiNsRepairableNames[] =
 
 #define ACPI_FDE_FIELD_COUNT        5
 #define ACPI_FDE_BYTE_BUFFER_SIZE   5
-#define ACPI_FDE_DWORD_BUFFER_SIZE  (ACPI_FDE_FIELD_COUNT * sizeof (UINT32))
+#define ACPI_FDE_DWORD_BUFFER_SIZE  (ACPI_FDE_FIELD_COUNT * (UINT32) sizeof (UINT32))
 
 
 /******************************************************************************
index 977eee8..e6ac5bb 100644 (file)
@@ -865,6 +865,7 @@ AcpiTbDeleteNamespaceByOwner (
     {
         return_ACPI_STATUS (Status);
     }
+
     AcpiNsDeleteNamespaceByOwner (OwnerId);
     AcpiUtReleaseWriteLock (&AcpiGbl_NamespaceRwLock);
     return_ACPI_STATUS (Status);
index 9ceed97..5835895 100644 (file)
@@ -214,7 +214,7 @@ AcpiDebugPrint (
      * Display the module name, current line number, thread ID (if requested),
      * current procedure nesting level, and the current procedure name
      */
-    AcpiOsPrintf ("%9s-%04ld ", ModuleName, LineNumber);
+    AcpiOsPrintf ("%9s-%04d ", ModuleName, LineNumber);
 
 #ifdef ACPI_APPLICATION
     /*
@@ -235,7 +235,7 @@ AcpiDebugPrint (
         FillCount = 0;
     }
 
-    AcpiOsPrintf ("[%02ld] %*s",
+    AcpiOsPrintf ("[%02d] %*s",
         AcpiGbl_NestingLevel, AcpiGbl_NestingLevel + 1, " ");
     AcpiOsPrintf ("%s%*s: ",
         AcpiUtTrimFunctionName (FunctionName), FillCount, " ");
index 7677894..52edc68 100644 (file)
@@ -80,7 +80,7 @@ AcpiUtPredefinedWarning (
     const char              *ModuleName,
     UINT32                  LineNumber,
     char                    *Pathname,
-    UINT                  NodeFlags,
+    UINT16                  NodeFlags,
     const char              *Format,
     ...)
 {
@@ -129,7 +129,7 @@ AcpiUtPredefinedInfo (
     const char              *ModuleName,
     UINT32                  LineNumber,
     char                    *Pathname,
-    UINT                  NodeFlags,
+    UINT16                  NodeFlags,
     const char              *Format,
     ...)
 {
@@ -178,7 +178,7 @@ AcpiUtPredefinedBiosError (
     const char              *ModuleName,
     UINT32                  LineNumber,
     char                    *Pathname,
-    UINT                  NodeFlags,
+    UINT16                  NodeFlags,
     const char              *Format,
     ...)
 {
index 8c0da51..d145055 100644 (file)
@@ -104,13 +104,14 @@ static ACPI_INTERFACE_INFO    AcpiDefaultSupportedInterfaces[] =
     {"Windows 2006 SP2",    NULL, 0, ACPI_OSI_WIN_VISTA_SP2},    /* Windows Vista SP2 - Added 09/2010 */
     {"Windows 2009",        NULL, 0, ACPI_OSI_WIN_7},            /* Windows 7 and Server 2008 R2 - Added 09/2009 */
     {"Windows 2012",        NULL, 0, ACPI_OSI_WIN_8},            /* Windows 8 and Server 2012 - Added 08/2012 */
-    {"Windows 2013",        NULL, 0, ACPI_OSI_WIN_8},            /* Windows 8.1 and Server 2012 R2 - Added 01/2014 */
+    {"Windows 2013",        NULL, 0, ACPI_OSI_WIN_8_1},          /* Windows 8.1 and Server 2012 R2 - Added 01/2014 */
     {"Windows 2015",        NULL, 0, ACPI_OSI_WIN_10},           /* Windows 10 - Added 03/2015 */
     {"Windows 2016",        NULL, 0, ACPI_OSI_WIN_10_RS1},       /* Windows 10 version 1607 - Added 12/2017 */
     {"Windows 2017",        NULL, 0, ACPI_OSI_WIN_10_RS2},       /* Windows 10 version 1703 - Added 12/2017 */
     {"Windows 2017.2",      NULL, 0, ACPI_OSI_WIN_10_RS3},       /* Windows 10 version 1709 - Added 02/2018 */
     {"Windows 2018",        NULL, 0, ACPI_OSI_WIN_10_RS4},       /* Windows 10 version 1803 - Added 11/2018 */
     {"Windows 2018.2",      NULL, 0, ACPI_OSI_WIN_10_RS5},       /* Windows 10 version 1809 - Added 11/2018 */
+    {"Windows 2019",        NULL, 0, ACPI_OSI_WIN_10_19H1},      /* Windows 10 version 1903 - Added 08/2019 */
 
     /* Feature Group Strings */
 
index ea98b81..8e723fa 100644 (file)
@@ -82,7 +82,7 @@ AcpiUtAllocateOwnerId (
     if (*OwnerId)
     {
         ACPI_ERROR ((AE_INFO,
-            "Owner ID [0x%2.2X] already exists", *OwnerId));
+            "Owner ID [0x%3.3X] already exists", *OwnerId));
         return_ACPI_STATUS (AE_ALREADY_EXISTS);
     }
 
@@ -138,13 +138,13 @@ AcpiUtAllocateOwnerId (
                 /*
                  * Construct encoded ID from the index and bit position
                  *
-                 * Note: Last [j].k (bit 255) is never used and is marked
+                 * Note: Last [j].k (bit 4095) is never used and is marked
                  * permanently allocated (prevents +1 overflow)
                  */
                 *OwnerId = (ACPI_OWNER_ID) ((k + 1) + ACPI_MUL_32 (j));
 
                 ACPI_DEBUG_PRINT ((ACPI_DB_VALUES,
-                    "Allocated OwnerId: %2.2X\n", (unsigned int) *OwnerId));
+                    "Allocated OwnerId: 0x%3.3X\n", (unsigned int) *OwnerId));
                 goto Exit;
             }
         }
@@ -164,7 +164,7 @@ AcpiUtAllocateOwnerId (
      */
     Status = AE_OWNER_ID_LIMIT;
     ACPI_ERROR ((AE_INFO,
-        "Could not allocate new OwnerId (255 max), AE_OWNER_ID_LIMIT"));
+        "Could not allocate new OwnerId (4095 max), AE_OWNER_ID_LIMIT"));
 
 Exit:
     (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES);
@@ -207,7 +207,7 @@ AcpiUtReleaseOwnerId (
 
     if (OwnerId == 0)
     {
-        ACPI_ERROR ((AE_INFO, "Invalid OwnerId: 0x%2.2X", OwnerId));
+        ACPI_ERROR ((AE_INFO, "Invalid OwnerId: 0x%3.3X", OwnerId));
         return_VOID;
     }
 
@@ -237,7 +237,7 @@ AcpiUtReleaseOwnerId (
     else
     {
         ACPI_ERROR ((AE_INFO,
-            "Release of non-allocated OwnerId: 0x%2.2X", OwnerId + 1));
+            "Attempted release of non-allocated OwnerId: 0x%3.3X", OwnerId + 1));
     }
 
     (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES);