summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/components/hardware
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/components/hardware')
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwacpi.c4
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwesleep.c2
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwgpe.c84
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwpci.c17
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwregs.c12
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwsleep.c16
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwtimer.c4
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwvalid.c4
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwxface.c12
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwxfsleep.c4
10 files changed, 104 insertions, 55 deletions
diff --git a/sys/contrib/dev/acpica/components/hardware/hwacpi.c b/sys/contrib/dev/acpica/components/hardware/hwacpi.c
index 3cd3a44..a91b66f 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwacpi.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwacpi.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __HWACPI_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
diff --git a/sys/contrib/dev/acpica/components/hardware/hwesleep.c b/sys/contrib/dev/acpica/components/hardware/hwesleep.c
index 6717801..460b6ff 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwesleep.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwesleep.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/sys/contrib/dev/acpica/components/hardware/hwgpe.c b/sys/contrib/dev/acpica/components/hardware/hwgpe.c
index 99c0de6..9cc511e 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwgpe.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwgpe.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -58,6 +58,11 @@ AcpiHwEnableWakeupGpeBlock (
ACPI_GPE_BLOCK_INFO *GpeBlock,
void *Context);
+static ACPI_STATUS
+AcpiHwGpeEnableWrite (
+ UINT8 EnableMask,
+ ACPI_GPE_REGISTER_INFO *GpeRegisterInfo);
+
/******************************************************************************
*
@@ -128,13 +133,13 @@ AcpiHwLowSetGpe (
/* Set or clear just the bit that corresponds to this GPE */
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
- switch (Action)
+ switch (Action & ~ACPI_GPE_SAVE_MASK)
{
case ACPI_GPE_CONDITIONAL_ENABLE:
- /* Only enable if the EnableForRun bit is set */
+ /* Only enable if the corresponding EnableMask bit is set */
- if (!(RegisterBit & GpeRegisterInfo->EnableForRun))
+ if (!(RegisterBit & GpeRegisterInfo->EnableMask))
{
return (AE_BAD_PARAMETER);
}
@@ -160,6 +165,10 @@ AcpiHwLowSetGpe (
/* Write the updated enable mask */
Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress);
+ if (ACPI_SUCCESS (Status) && (Action & ACPI_GPE_SAVE_MASK))
+ {
+ GpeRegisterInfo->EnableMask = (UINT8) EnableMask;
+ }
return (Status);
}
@@ -241,6 +250,14 @@ AcpiHwGetGpeStatus (
return (AE_BAD_PARAMETER);
}
+ /* GPE currently handled? */
+
+ if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) !=
+ ACPI_GPE_DISPATCH_NONE)
+ {
+ LocalEventStatus |= ACPI_EVENT_FLAG_HAS_HANDLER;
+ }
+
/* Get the info block for the entire GPE register */
GpeRegisterInfo = GpeEventInfo->RegisterInfo;
@@ -285,6 +302,37 @@ AcpiHwGetGpeStatus (
/******************************************************************************
*
+ * FUNCTION: AcpiHwGpeEnableWrite
+ *
+ * PARAMETERS: EnableMask - Bit mask to write to the GPE register
+ * GpeRegisterInfo - Gpe Register info
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Write the enable mask byte to the given GPE register.
+ *
+ ******************************************************************************/
+
+static ACPI_STATUS
+AcpiHwGpeEnableWrite (
+ UINT8 EnableMask,
+ ACPI_GPE_REGISTER_INFO *GpeRegisterInfo)
+{
+ ACPI_STATUS Status;
+
+
+ Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress);
+ if (ACPI_SUCCESS (Status))
+ {
+ GpeRegisterInfo->EnableMask = EnableMask;
+ }
+
+ return (Status);
+}
+
+
+/******************************************************************************
+ *
* FUNCTION: AcpiHwDisableGpeBlock
*
* PARAMETERS: GpeXruptInfo - GPE Interrupt info
@@ -312,7 +360,7 @@ AcpiHwDisableGpeBlock (
{
/* Disable all GPEs in this register */
- Status = AcpiHwWrite (0x00, &GpeBlock->RegisterInfo[i].EnableAddress);
+ Status = AcpiHwGpeEnableWrite (0x00, &GpeBlock->RegisterInfo[i]);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -385,6 +433,7 @@ AcpiHwEnableRuntimeGpeBlock (
{
UINT32 i;
ACPI_STATUS Status;
+ ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
/* NOTE: assumes that all GPEs are currently disabled */
@@ -393,15 +442,16 @@ AcpiHwEnableRuntimeGpeBlock (
for (i = 0; i < GpeBlock->RegisterCount; i++)
{
- if (!GpeBlock->RegisterInfo[i].EnableForRun)
+ GpeRegisterInfo = &GpeBlock->RegisterInfo[i];
+ if (!GpeRegisterInfo->EnableForRun)
{
continue;
}
/* Enable all "runtime" GPEs in this register */
- Status = AcpiHwWrite (GpeBlock->RegisterInfo[i].EnableForRun,
- &GpeBlock->RegisterInfo[i].EnableAddress);
+ Status = AcpiHwGpeEnableWrite (GpeRegisterInfo->EnableForRun,
+ GpeRegisterInfo);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -434,21 +484,21 @@ AcpiHwEnableWakeupGpeBlock (
{
UINT32 i;
ACPI_STATUS Status;
+ ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
/* Examine each GPE Register within the block */
for (i = 0; i < GpeBlock->RegisterCount; i++)
{
- if (!GpeBlock->RegisterInfo[i].EnableForWake)
- {
- continue;
- }
-
- /* Enable all "wake" GPEs in this register */
-
- Status = AcpiHwWrite (GpeBlock->RegisterInfo[i].EnableForWake,
- &GpeBlock->RegisterInfo[i].EnableAddress);
+ GpeRegisterInfo = &GpeBlock->RegisterInfo[i];
+
+ /*
+ * Enable all "wake" GPEs in this register and disable the
+ * remaining ones.
+ */
+ Status = AcpiHwGpeEnableWrite (GpeRegisterInfo->EnableForWake,
+ GpeRegisterInfo);
if (ACPI_FAILURE (Status))
{
return (Status);
diff --git a/sys/contrib/dev/acpica/components/hardware/hwpci.c b/sys/contrib/dev/acpica/components/hardware/hwpci.c
index a89a3dd..165d26c 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwpci.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwpci.c
@@ -5,7 +5,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __HWPCI_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
@@ -161,11 +159,12 @@ AcpiHwDerivePciId (
/* Walk the list, updating the PCI device/function/bus numbers */
Status = AcpiHwProcessPciList (PciId, ListHead);
- }
- /* Always delete the list */
+ /* Delete the list */
+
+ AcpiHwDeletePciList (ListHead);
+ }
- AcpiHwDeletePciList (ListHead);
return_ACPI_STATUS (Status);
}
@@ -213,6 +212,9 @@ AcpiHwBuildPciList (
Status = AcpiGetParent (CurrentDevice, &ParentDevice);
if (ACPI_FAILURE (Status))
{
+ /* Must delete the list before exit */
+
+ AcpiHwDeletePciList (*ReturnListHead);
return (Status);
}
@@ -227,6 +229,9 @@ AcpiHwBuildPciList (
ListElement = ACPI_ALLOCATE (sizeof (ACPI_PCI_DEVICE));
if (!ListElement)
{
+ /* Must delete the list before exit */
+
+ AcpiHwDeletePciList (*ReturnListHead);
return (AE_NO_MEMORY);
}
diff --git a/sys/contrib/dev/acpica/components/hardware/hwregs.c b/sys/contrib/dev/acpica/components/hardware/hwregs.c
index 9c3f2a9..9d601c5 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwregs.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwregs.c
@@ -6,7 +6,7 @@
******************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,8 +42,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __HWREGS_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acevents.h>
@@ -310,17 +308,19 @@ AcpiHwClearAcpiStatus (
Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1_STATUS,
ACPI_BITMASK_ALL_FIXED_STATUS);
+
+ AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags);
+
if (ACPI_FAILURE (Status))
{
- goto UnlockAndExit;
+ goto Exit;
}
/* Clear the GPE Bits in all GPE registers in all GPE blocks */
Status = AcpiEvWalkGpeList (AcpiHwClearGpeBlock, NULL);
-UnlockAndExit:
- AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags);
+Exit:
return_ACPI_STATUS (Status);
}
diff --git a/sys/contrib/dev/acpica/components/hardware/hwsleep.c b/sys/contrib/dev/acpica/components/hardware/hwsleep.c
index 0e6691a..2bc434e 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwsleep.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwsleep.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -72,7 +72,6 @@ AcpiHwLegacySleep (
UINT32 Pm1aControl;
UINT32 Pm1bControl;
UINT32 InValue;
- UINT32 Retry;
ACPI_STATUS Status;
@@ -192,7 +191,6 @@ AcpiHwLegacySleep (
/* Wait for transition back to Working State */
- Retry = 1000;
do
{
Status = AcpiReadBitRegister (ACPI_BITREG_WAKE_STATUS, &InValue);
@@ -201,18 +199,6 @@ AcpiHwLegacySleep (
return_ACPI_STATUS (Status);
}
- if (AcpiGbl_EnableInterpreterSlack)
- {
- /*
- * Some BIOSs don't set WAK_STS at all. Give up waiting after
- * 1000 retries if it still isn't set.
- */
- if (Retry-- == 0)
- {
- break;
- }
- }
-
} while (!InValue);
return_ACPI_STATUS (AE_OK);
diff --git a/sys/contrib/dev/acpica/components/hardware/hwtimer.c b/sys/contrib/dev/acpica/components/hardware/hwtimer.c
index e103014..39c9e57 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwtimer.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwtimer.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,6 +41,8 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
+#define EXPORT_ACPI_INTERFACES
+
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
diff --git a/sys/contrib/dev/acpica/components/hardware/hwvalid.c b/sys/contrib/dev/acpica/components/hardware/hwvalid.c
index 85a87d1..ade53ad 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwvalid.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwvalid.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,8 +41,6 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __HWVALID_C__
-
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
diff --git a/sys/contrib/dev/acpica/components/hardware/hwxface.c b/sys/contrib/dev/acpica/components/hardware/hwxface.c
index 8e0e5be..fcd5c9e 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwxface.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwxface.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,6 +41,8 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
+#define EXPORT_ACPI_INTERFACES
+
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
#include <contrib/dev/acpica/include/acnamesp.h>
@@ -90,9 +92,15 @@ AcpiReset (
* For I/O space, write directly to the OSL. This bypasses the port
* validation mechanism, which may block a valid write to the reset
* register.
+ *
+ * NOTE:
+ * The ACPI spec requires the reset register width to be 8, so we
+ * hardcode it here and ignore the FADT value. This maintains
+ * compatibility with other ACPI implementations that have allowed
+ * BIOS code with bad register width values to go unnoticed.
*/
Status = AcpiOsWritePort ((ACPI_IO_ADDRESS) ResetReg->Address,
- AcpiGbl_FADT.ResetValue, ResetReg->BitWidth);
+ AcpiGbl_FADT.ResetValue, ACPI_RESET_REGISTER_WIDTH);
}
else
{
diff --git a/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c b/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
index 8c3ec41..8d5ba97 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2013, Intel Corp.
+ * Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,6 +41,8 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
+#define EXPORT_ACPI_INTERFACES
+
#include <contrib/dev/acpica/include/acpi.h>
#include <contrib/dev/acpica/include/accommon.h>
OpenPOWER on IntegriCloud