https://git.reactos.org/?p=reactos.git;a=commitdiff;h=696cdc635b770b26c99ed…
commit 696cdc635b770b26c99ed39f6527129eea03d2f2
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Fri Feb 14 22:09:08 2020 +0100
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Sat Feb 15 20:45:53 2020 +0100
[ACPICA] Update to version 20200214. CORE-16696
---
drivers/bus/acpi/acpica/events/evevent.c | 2 +-
drivers/bus/acpi/acpica/events/evxfgpe.c | 38 +++++++++++++
drivers/bus/acpi/acpica/hardware/hwgpe.c | 79 ++++++++++++++++++++++++++++
drivers/bus/acpi/acpica/hardware/hwsleep.c | 10 ++++
drivers/bus/acpi/acpica/include/acconvert.h | 3 +-
drivers/bus/acpi/acpica/include/achware.h | 4 ++
drivers/bus/acpi/acpica/include/acmacros.h | 4 +-
drivers/bus/acpi/acpica/include/acpixf.h | 6 ++-
drivers/bus/acpi/acpica/include/actbl1.h | 2 +-
drivers/bus/acpi/acpica/include/actypes.h | 7 +--
drivers/bus/acpi/acpica/namespace/nsnames.c | 6 +--
drivers/bus/acpi/acpica/namespace/nsxfname.c | 2 +-
drivers/bus/acpi/acpica/tables/tbxface.c | 12 ++---
drivers/bus/acpi/acpica/utilities/utobject.c | 2 +-
14 files changed, 156 insertions(+), 21 deletions(-)
diff --git a/drivers/bus/acpi/acpica/events/evevent.c
b/drivers/bus/acpi/acpica/events/evevent.c
index ac4af80e0d3..f41eb36561f 100644
--- a/drivers/bus/acpi/acpica/events/evevent.c
+++ b/drivers/bus/acpi/acpica/events/evevent.c
@@ -191,7 +191,7 @@ AcpiEvFixedEventInitialize (
/*
* Initialize the structure that keeps track of fixed event handlers and
- * enable the fixed events.
+ * disable all of the fixed events.
*/
for (i = 0; i < ACPI_NUM_FIXED_EVENTS; i++)
{
diff --git a/drivers/bus/acpi/acpica/events/evxfgpe.c
b/drivers/bus/acpi/acpica/events/evxfgpe.c
index a3c28a281eb..d4190f56126 100644
--- a/drivers/bus/acpi/acpica/events/evxfgpe.c
+++ b/drivers/bus/acpi/acpica/events/evxfgpe.c
@@ -957,6 +957,44 @@ AcpiEnableAllWakeupGpes (
ACPI_EXPORT_SYMBOL (AcpiEnableAllWakeupGpes)
+/******************************************************************************
+ *
+ * FUNCTION: AcpiAnyGpeStatusSet
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Whether or not the status bit is set for any GPE
+ *
+ * DESCRIPTION: Check the status bits of all enabled GPEs and return TRUE if any
+ * of them is set or FALSE otherwise.
+ *
+ ******************************************************************************/
+
+UINT32
+AcpiAnyGpeStatusSet (
+ void)
+{
+ ACPI_STATUS Status;
+ UINT8 Ret;
+
+
+ ACPI_FUNCTION_TRACE (AcpiAnyGpeStatusSet);
+
+ Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
+ if (ACPI_FAILURE (Status))
+ {
+ return (FALSE);
+ }
+
+ Ret = AcpiHwCheckAllGpes ();
+ (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
+
+ return (Ret);
+}
+
+ACPI_EXPORT_SYMBOL(AcpiAnyGpeStatusSet)
+
+
/*******************************************************************************
*
* FUNCTION: AcpiInstallGpeBlock
diff --git a/drivers/bus/acpi/acpica/hardware/hwgpe.c
b/drivers/bus/acpi/acpica/hardware/hwgpe.c
index 81576b986ac..69061928726 100644
--- a/drivers/bus/acpi/acpica/hardware/hwgpe.c
+++ b/drivers/bus/acpi/acpica/hardware/hwgpe.c
@@ -527,6 +527,58 @@ AcpiHwEnableWakeupGpeBlock (
}
+/******************************************************************************
+ *
+ * FUNCTION: AcpiHwGetGpeBlockStatus
+ *
+ * PARAMETERS: GpeXruptInfo - GPE Interrupt info
+ * GpeBlock - Gpe Block info
+ *
+ * RETURN: Success
+ *
+ * DESCRIPTION: Produce a combined GPE status bits mask for the given block.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiHwGetGpeBlockStatus(
+ ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
+ ACPI_GPE_BLOCK_INFO *GpeBlock,
+ void *RetPtr)
+{
+ ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
+ UINT64 InEnable;
+ UINT64 InStatus;
+ ACPI_STATUS Status;
+ UINT8 *Ret = RetPtr;
+ UINT32 i;
+
+
+ /* Examine each GPE Register within the block */
+
+ for (i = 0; i < GpeBlock->RegisterCount; i++)
+ {
+ GpeRegisterInfo = &GpeBlock->RegisterInfo[i];
+
+ Status = AcpiHwRead (&InEnable, &GpeRegisterInfo->EnableAddress);
+ if (ACPI_FAILURE (Status))
+ {
+ continue;
+ }
+
+ Status = AcpiHwRead (&InStatus, &GpeRegisterInfo->StatusAddress);
+ if (ACPI_FAILURE (Status))
+ {
+ continue;
+ }
+
+ *Ret |= InEnable & InStatus;
+ }
+
+ return (AE_OK);
+}
+
+
/******************************************************************************
*
* FUNCTION: AcpiHwDisableAllGpes
@@ -607,4 +659,31 @@ AcpiHwEnableAllWakeupGpes (
return_ACPI_STATUS (Status);
}
+
+/******************************************************************************
+ *
+ * FUNCTION: AcpiHwCheckAllGpes
+ *
+ * PARAMETERS: None
+ *
+ * RETURN: Combined status of all GPEs
+ *
+ * DESCRIPTION: Check all enabled GPEs in all GPE blocks and return TRUE if the
+ * status bit is set for at least one of them of FALSE otherwise.
+ *
+ ******************************************************************************/
+
+UINT8
+AcpiHwCheckAllGpes (
+ void)
+{
+ UINT8 Ret = 0;
+
+
+ ACPI_FUNCTION_TRACE (AcpiHwCheckAllGpes);
+
+ (void) AcpiEvWalkGpeList (AcpiHwGetGpeBlockStatus, &Ret);
+ return (Ret != 0);
+}
+
#endif /* !ACPI_REDUCED_HARDWARE */
diff --git a/drivers/bus/acpi/acpica/hardware/hwsleep.c
b/drivers/bus/acpi/acpica/hardware/hwsleep.c
index 60e5aa61c30..3d65e4394ff 100644
--- a/drivers/bus/acpi/acpica/hardware/hwsleep.c
+++ b/drivers/bus/acpi/acpica/hardware/hwsleep.c
@@ -356,6 +356,16 @@ AcpiHwLegacyWake (
AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].StatusRegisterId,
ACPI_CLEAR_STATUS);
+ /* Enable sleep button */
+
+ (void) AcpiWriteBitRegister (
+ AcpiGbl_FixedEventInfo[ACPI_EVENT_SLEEP_BUTTON].EnableRegisterId,
+ ACPI_ENABLE_EVENT);
+
+ (void) AcpiWriteBitRegister (
+ AcpiGbl_FixedEventInfo[ACPI_EVENT_SLEEP_BUTTON].StatusRegisterId,
+ ACPI_CLEAR_STATUS);
+
AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WORKING);
return_ACPI_STATUS (Status);
}
diff --git a/drivers/bus/acpi/acpica/include/acconvert.h
b/drivers/bus/acpi/acpica/include/acconvert.h
index 56efab3128f..071ff4a4c58 100644
--- a/drivers/bus/acpi/acpica/include/acconvert.h
+++ b/drivers/bus/acpi/acpica/include/acconvert.h
@@ -129,8 +129,7 @@ CgWriteAmlComment (
void
CvInitFileTree (
ACPI_TABLE_HEADER *Table,
- UINT8 *AmlStart,
- UINT32 AmlLength);
+ FILE *RootFile);
void
CvClearOpComments (
diff --git a/drivers/bus/acpi/acpica/include/achware.h
b/drivers/bus/acpi/acpica/include/achware.h
index 0346525cd25..824bc4337d6 100644
--- a/drivers/bus/acpi/acpica/include/achware.h
+++ b/drivers/bus/acpi/acpica/include/achware.h
@@ -207,6 +207,10 @@ ACPI_STATUS
AcpiHwEnableAllWakeupGpes (
void);
+UINT8
+AcpiHwCheckAllGpes (
+ void);
+
ACPI_STATUS
AcpiHwEnableRuntimeGpeBlock (
ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
diff --git a/drivers/bus/acpi/acpica/include/acmacros.h
b/drivers/bus/acpi/acpica/include/acmacros.h
index 67a89b295b0..1806328a75c 100644
--- a/drivers/bus/acpi/acpica/include/acmacros.h
+++ b/drivers/bus/acpi/acpica/include/acmacros.h
@@ -517,7 +517,7 @@
#define ASL_CV_PRINT_ONE_COMMENT(a,b,c,d) CvPrintOneCommentType (a,b,c,d);
#define ASL_CV_PRINT_ONE_COMMENT_LIST(a,b) CvPrintOneCommentList (a,b);
#define ASL_CV_FILE_HAS_SWITCHED(a) CvFileHasSwitched(a)
-#define ASL_CV_INIT_FILETREE(a,b,c) CvInitFileTree(a,b,c);
+#define ASL_CV_INIT_FILETREE(a,b) CvInitFileTree(a,b);
#else
@@ -532,7 +532,7 @@
#define ASL_CV_PRINT_ONE_COMMENT(a,b,c,d)
#define ASL_CV_PRINT_ONE_COMMENT_LIST(a,b)
#define ASL_CV_FILE_HAS_SWITCHED(a) 0
-#define ASL_CV_INIT_FILETREE(a,b,c)
+#define ASL_CV_INIT_FILETREE(a,b)
#endif
diff --git a/drivers/bus/acpi/acpica/include/acpixf.h
b/drivers/bus/acpi/acpica/include/acpixf.h
index 4b86b08eaf5..0669a5712cf 100644
--- a/drivers/bus/acpi/acpica/include/acpixf.h
+++ b/drivers/bus/acpi/acpica/include/acpixf.h
@@ -46,7 +46,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20200110
+#define ACPI_CA_VERSION 0x20200214
#include "acconfig.h"
#include "actypes.h"
@@ -1001,6 +1001,10 @@ ACPI_STATUS
AcpiEnableAllWakeupGpes (
void))
+ACPI_HW_DEPENDENT_RETURN_UINT32 (
+ UINT32 AcpiAnyGpeStatusSet (
+ void))
+
ACPI_HW_DEPENDENT_RETURN_STATUS (
ACPI_STATUS
AcpiGetGpeDevice (
diff --git a/drivers/bus/acpi/acpica/include/actbl1.h
b/drivers/bus/acpi/acpica/include/actbl1.h
index 547a213cb2b..4c17bdbfd7f 100644
--- a/drivers/bus/acpi/acpica/include/actbl1.h
+++ b/drivers/bus/acpi/acpica/include/actbl1.h
@@ -1041,7 +1041,7 @@ enum AcpiErstInstructions
enum AcpiErstCommandStatus
{
- ACPI_ERST_SUCESS = 0,
+ ACPI_ERST_SUCCESS = 0,
ACPI_ERST_NO_SPACE = 1,
ACPI_ERST_NOT_AVAILABLE = 2,
ACPI_ERST_FAILURE = 3,
diff --git a/drivers/bus/acpi/acpica/include/actypes.h
b/drivers/bus/acpi/acpica/include/actypes.h
index 0f8ad4cd5e6..ad5c21d73d6 100644
--- a/drivers/bus/acpi/acpica/include/actypes.h
+++ b/drivers/bus/acpi/acpica/include/actypes.h
@@ -575,11 +575,12 @@ typedef UINT64 ACPI_INTEGER;
strnlen (a, ACPI_NAMESEG_SIZE) ==
ACPI_NAMESEG_SIZE)
/*
- * Algorithm to obtain access bit width.
- * Can be used with AccessWidth of ACPI_GENERIC_ADDRESS and AccessSize of
+ * Algorithm to obtain access bit or byte width.
+ * Can be used with AccessSize field of ACPI_GENERIC_ADDRESS and
* ACPI_RESOURCE_GENERIC_REGISTER.
*/
-#define ACPI_ACCESS_BIT_WIDTH(size) (1 << ((size) + 2))
+#define ACPI_ACCESS_BIT_WIDTH(AccessSize) (1 << ((AccessSize) + 2))
+#define ACPI_ACCESS_BYTE_WIDTH(AccessSize) (1 << ((AccessSize) - 1))
/*******************************************************************************
diff --git a/drivers/bus/acpi/acpica/namespace/nsnames.c
b/drivers/bus/acpi/acpica/namespace/nsnames.c
index 04dac8e660c..87f4bea030f 100644
--- a/drivers/bus/acpi/acpica/namespace/nsnames.c
+++ b/drivers/bus/acpi/acpica/namespace/nsnames.c
@@ -228,7 +228,7 @@ AcpiNsHandleToPathname (
/* Build the path in the caller buffer */
(void) AcpiNsBuildNormalizedPath (Node, Buffer->Pointer,
- RequiredSize, NoTrailing);
+ (UINT32) RequiredSize, NoTrailing);
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%s [%X]\n",
(char *) Buffer->Pointer, (UINT32) RequiredSize));
@@ -401,7 +401,7 @@ AcpiNsGetNormalizedPathname (
/* Build the path in the allocated buffer */
- (void) AcpiNsBuildNormalizedPath (Node, NameBuffer, Size, NoTrailing);
+ (void) AcpiNsBuildNormalizedPath (Node, NameBuffer, (UINT32) Size, NoTrailing);
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES, "%s: Path \"%s\"\n",
ACPI_GET_FUNCTION_NAME, NameBuffer));
@@ -434,7 +434,7 @@ AcpiNsBuildPrefixedPathname (
char *FullPath = NULL;
char *ExternalPath = NULL;
char *PrefixPath = NULL;
- SIZE_T PrefixPathLength = 0;
+ ACPI_SIZE PrefixPathLength = 0;
/* If there is a prefix, get the pathname to it */
diff --git a/drivers/bus/acpi/acpica/namespace/nsxfname.c
b/drivers/bus/acpi/acpica/namespace/nsxfname.c
index ee533c9c75d..17c0aad7afe 100644
--- a/drivers/bus/acpi/acpica/namespace/nsxfname.c
+++ b/drivers/bus/acpi/acpica/namespace/nsxfname.c
@@ -606,7 +606,7 @@ AcpiInstallMethod (
MethodFlags = *ParserState.Aml++;
AmlStart = ParserState.Aml;
- AmlLength = ACPI_PTR_DIFF (ParserState.PkgEnd, AmlStart);
+ AmlLength = (UINT32) ACPI_PTR_DIFF (ParserState.PkgEnd, AmlStart);
/*
* Allocate resources up-front. We don't want to have to delete a new
diff --git a/drivers/bus/acpi/acpica/tables/tbxface.c
b/drivers/bus/acpi/acpica/tables/tbxface.c
index 1e2432e19d7..38908e4a7e7 100644
--- a/drivers/bus/acpi/acpica/tables/tbxface.c
+++ b/drivers/bus/acpi/acpica/tables/tbxface.c
@@ -260,14 +260,14 @@ ACPI_EXPORT_SYMBOL_INIT (AcpiReallocateRootTable)
*
* PARAMETERS: Signature - ACPI signature of needed table
* Instance - Which instance (for SSDTs)
- * OutTableHeader - The pointer to the table header to fill
+ * OutTableHeader - The pointer to the where the table header
+ * is returned
*
- * RETURN: Status and pointer to mapped table header
+ * RETURN: Status and a copy of the table header
*
- * DESCRIPTION: Finds an ACPI table header.
- *
- * NOTE: Caller is responsible in unmapping the header with
- * AcpiOsUnmapMemory
+ * DESCRIPTION: Finds and returns an ACPI table header. Caller provides the
+ * memory where a copy of the header is to be returned
+ * (fixed length).
*
******************************************************************************/
diff --git a/drivers/bus/acpi/acpica/utilities/utobject.c
b/drivers/bus/acpi/acpica/utilities/utobject.c
index 0067876bbc5..775361fafab 100644
--- a/drivers/bus/acpi/acpica/utilities/utobject.c
+++ b/drivers/bus/acpi/acpica/utilities/utobject.c
@@ -84,7 +84,7 @@ AcpiUtGetElementLength (
*
* NOTE: We always allocate the worst-case object descriptor because
* these objects are cached, and we want them to be
- * one-size-satisifies-any-request. This in itself may not be
+ * one-size-satisfies-any-request. This in itself may not be
* the most memory efficient, but the efficiency of the object
* cache should more than make up for this!
*