summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/hwacpi.c
diff options
context:
space:
mode:
authoriwasaki <iwasaki@FreeBSD.org>2002-08-29 01:51:24 +0000
committeriwasaki <iwasaki@FreeBSD.org>2002-08-29 01:51:24 +0000
commit1824f192010fc0c0826e9889892e534075b58793 (patch)
treebbc04a2733724f3f0ab5cecb259948ac9a9723d7 /sys/contrib/dev/acpica/hwacpi.c
parent3f86517f16a9cf970e93e483e90066da6eb323dd (diff)
downloadFreeBSD-src-1824f192010fc0c0826e9889892e534075b58793.zip
FreeBSD-src-1824f192010fc0c0826e9889892e534075b58793.tar.gz
Vendor import of the Intel ACPI CA 20020815 drop.
Diffstat (limited to 'sys/contrib/dev/acpica/hwacpi.c')
-rw-r--r--sys/contrib/dev/acpica/hwacpi.c34
1 files changed, 29 insertions, 5 deletions
diff --git a/sys/contrib/dev/acpica/hwacpi.c b/sys/contrib/dev/acpica/hwacpi.c
index 8391e55..9dffda3 100644
--- a/sys/contrib/dev/acpica/hwacpi.c
+++ b/sys/contrib/dev/acpica/hwacpi.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: hwacpi - ACPI Hardware Initialization/Mode Interface
- * $Revision: 58 $
+ * $Revision: 60 $
*
*****************************************************************************/
@@ -190,13 +190,36 @@ AcpiHwSetMode (
ACPI_FUNCTION_TRACE ("HwSetMode");
+ /*
+ * ACPI 2.0 clarified that if SMI_CMD in FADT is zero,
+ * system does not support mode transition.
+ */
+ if (!AcpiGbl_FADT->SmiCmd)
+ {
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No SMI_CMD in FADT, mode transition failed.\n"));
+ return_ACPI_STATUS (AE_NO_HARDWARE_RESPONSE);
+ }
+
+ /*
+ * ACPI 2.0 clarified the meaning of ACPI_ENABLE and ACPI_DISABLE
+ * in FADT: If it is zero, enabling or disabling is not supported.
+ * As old systems may have used zero for mode transition,
+ * we make sure both the numbers are zero to determine these
+ * transitions are not supported.
+ */
+ if (!AcpiGbl_FADT->AcpiEnable && !AcpiGbl_FADT->AcpiDisable)
+ {
+ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "No mode transition supported in this system.\n"));
+ return_ACPI_STATUS (AE_OK);
+ }
+
switch (Mode)
{
case ACPI_SYS_MODE_ACPI:
/* BIOS should have disabled ALL fixed and GP events */
- Status = AcpiOsWritePort (AcpiGbl_FADT->SmiCmd,
+ Status = AcpiOsWritePort (AcpiGbl_FADT->SmiCmd,
(ACPI_INTEGER) AcpiGbl_FADT->AcpiEnable, 8);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Attempting to enable ACPI mode\n"));
break;
@@ -207,7 +230,7 @@ AcpiHwSetMode (
* BIOS should clear all fixed status bits and restore fixed event
* enable bits to default
*/
- Status = AcpiOsWritePort (AcpiGbl_FADT->SmiCmd,
+ Status = AcpiOsWritePort (AcpiGbl_FADT->SmiCmd,
(ACPI_INTEGER) AcpiGbl_FADT->AcpiDisable, 8);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Attempting to enable Legacy (non-ACPI) mode\n"));
@@ -231,12 +254,13 @@ AcpiHwSetMode (
{
Status = AE_NO_HARDWARE_RESPONSE;
- if (AcpiHwGetMode() == Mode) {
+ if (AcpiHwGetMode() == Mode)
+ {
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Mode %X successfully enabled\n", Mode));
Status = AE_OK;
break;
}
- AcpiOsStall(1000);
+ AcpiOsStall(1000);
Retry--;
}
OpenPOWER on IntegriCloud