summaryrefslogtreecommitdiff
path: root/source/components/hardware/hwgpe.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2016-08-31 21:40:51 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2016-08-31 21:40:51 +0000
commitbe99e84498e91a5930864ef7b92b1a7ceb815e44 (patch)
tree7f5a2883a75b1713bdfe7d36ffa6217bac9187e2 /source/components/hardware/hwgpe.c
parent8bc6ab62dbdb3e8b0d2253e0440f6f58ac9afd3d (diff)
Notes
Diffstat (limited to 'source/components/hardware/hwgpe.c')
-rw-r--r--source/components/hardware/hwgpe.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/source/components/hardware/hwgpe.c b/source/components/hardware/hwgpe.c
index 3dbf10ba0a40..ac9934db4f19 100644
--- a/source/components/hardware/hwgpe.c
+++ b/source/components/hardware/hwgpe.c
@@ -108,7 +108,7 @@ AcpiHwLowSetGpe (
UINT32 Action)
{
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
- ACPI_STATUS Status;
+ ACPI_STATUS Status = AE_OK;
UINT32 EnableMask;
UINT32 RegisterBit;
@@ -164,9 +164,12 @@ AcpiHwLowSetGpe (
return (AE_BAD_PARAMETER);
}
- /* Write the updated enable mask */
+ if (!(RegisterBit & GpeRegisterInfo->MaskForRun))
+ {
+ /* Write the updated enable mask */
- Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress);
+ Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress);
+ }
return (Status);
}
@@ -269,6 +272,13 @@ AcpiHwGetGpeStatus (
LocalEventStatus |= ACPI_EVENT_FLAG_ENABLED;
}
+ /* GPE currently masked? (masked for runtime?) */
+
+ if (RegisterBit & GpeRegisterInfo->MaskForRun)
+ {
+ LocalEventStatus |= ACPI_EVENT_FLAG_MASKED;
+ }
+
/* GPE enabled for wake? */
if (RegisterBit & GpeRegisterInfo->EnableForWake)
@@ -440,6 +450,7 @@ AcpiHwEnableRuntimeGpeBlock (
UINT32 i;
ACPI_STATUS Status;
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
+ UINT8 EnableMask;
/* NOTE: assumes that all GPEs are currently disabled */
@@ -456,8 +467,9 @@ AcpiHwEnableRuntimeGpeBlock (
/* Enable all "runtime" GPEs in this register */
- Status = AcpiHwGpeEnableWrite (GpeRegisterInfo->EnableForRun,
- GpeRegisterInfo);
+ EnableMask = GpeRegisterInfo->EnableForRun &
+ ~GpeRegisterInfo->MaskForRun;
+ Status = AcpiHwGpeEnableWrite (EnableMask, GpeRegisterInfo);
if (ACPI_FAILURE (Status))
{
return (Status);