summaryrefslogtreecommitdiff
path: root/source/components
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2020-02-14 19:19:39 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2020-02-14 19:19:39 +0000
commitaa36cd6999384cddbfa0d030bcdd44e8bf9c7779 (patch)
tree4f865c7e1146baad112589d1fc57dc6b335c68ec /source/components
parent8bf5cb5c35eaf503e388d960914add6a539c1e06 (diff)
Notes
Diffstat (limited to 'source/components')
-rw-r--r--source/components/events/evevent.c2
-rw-r--r--source/components/events/evxfgpe.c38
-rw-r--r--source/components/hardware/hwgpe.c79
-rw-r--r--source/components/hardware/hwsleep.c10
-rw-r--r--source/components/namespace/nsnames.c6
-rw-r--r--source/components/namespace/nsxfname.c2
-rw-r--r--source/components/tables/tbxface.c12
-rw-r--r--source/components/utilities/utobject.c2
8 files changed, 139 insertions, 12 deletions
diff --git a/source/components/events/evevent.c b/source/components/events/evevent.c
index 800dd962b31e2..0afc7473d7654 100644
--- a/source/components/events/evevent.c
+++ b/source/components/events/evevent.c
@@ -299,7 +299,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/source/components/events/evxfgpe.c b/source/components/events/evxfgpe.c
index 131021f126cb3..d652c29fb8e51 100644
--- a/source/components/events/evxfgpe.c
+++ b/source/components/events/evxfgpe.c
@@ -1065,6 +1065,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/source/components/hardware/hwgpe.c b/source/components/hardware/hwgpe.c
index f0b32bd636387..e8ad8926ce116 100644
--- a/source/components/hardware/hwgpe.c
+++ b/source/components/hardware/hwgpe.c
@@ -637,6 +637,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
*
* PARAMETERS: None
@@ -715,4 +767,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/source/components/hardware/hwsleep.c b/source/components/hardware/hwsleep.c
index 3ad4ae23c3a43..016f62be3aa09 100644
--- a/source/components/hardware/hwsleep.c
+++ b/source/components/hardware/hwsleep.c
@@ -464,6 +464,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/source/components/namespace/nsnames.c b/source/components/namespace/nsnames.c
index eebdd1a2db9aa..a9509195c89ab 100644
--- a/source/components/namespace/nsnames.c
+++ b/source/components/namespace/nsnames.c
@@ -336,7 +336,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));
@@ -509,7 +509,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));
@@ -542,7 +542,7 @@ AcpiNsBuildPrefixedPathname (
char *FullPath = NULL;
char *ExternalPath = NULL;
char *PrefixPath = NULL;
- UINT32 PrefixPathLength = 0;
+ ACPI_SIZE PrefixPathLength = 0;
/* If there is a prefix, get the pathname to it */
diff --git a/source/components/namespace/nsxfname.c b/source/components/namespace/nsxfname.c
index 5b3d5a9bed6fa..53a2f4bfa2794 100644
--- a/source/components/namespace/nsxfname.c
+++ b/source/components/namespace/nsxfname.c
@@ -714,7 +714,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/source/components/tables/tbxface.c b/source/components/tables/tbxface.c
index 3c17ee001a3a2..682cb5a80d30a 100644
--- a/source/components/tables/tbxface.c
+++ b/source/components/tables/tbxface.c
@@ -368,14 +368,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/source/components/utilities/utobject.c b/source/components/utilities/utobject.c
index e4b9305802b2b..71244e5188260 100644
--- a/source/components/utilities/utobject.c
+++ b/source/components/utilities/utobject.c
@@ -192,7 +192,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!
*