diff options
author | iwasaki <iwasaki@FreeBSD.org> | 2002-08-29 01:51:24 +0000 |
---|---|---|
committer | iwasaki <iwasaki@FreeBSD.org> | 2002-08-29 01:51:24 +0000 |
commit | 1824f192010fc0c0826e9889892e534075b58793 (patch) | |
tree | bbc04a2733724f3f0ab5cecb259948ac9a9723d7 /sys/contrib/dev/acpica/evxfevnt.c | |
parent | 3f86517f16a9cf970e93e483e90066da6eb323dd (diff) | |
download | FreeBSD-src-1824f192010fc0c0826e9889892e534075b58793.zip FreeBSD-src-1824f192010fc0c0826e9889892e534075b58793.tar.gz |
Vendor import of the Intel ACPI CA 20020815 drop.
Diffstat (limited to 'sys/contrib/dev/acpica/evxfevnt.c')
-rw-r--r-- | sys/contrib/dev/acpica/evxfevnt.c | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/sys/contrib/dev/acpica/evxfevnt.c b/sys/contrib/dev/acpica/evxfevnt.c index 919e5da..9e70832 100644 --- a/sys/contrib/dev/acpica/evxfevnt.c +++ b/sys/contrib/dev/acpica/evxfevnt.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Module Name: evxfevnt - External Interfaces, ACPI event disable/enable - * $Revision: 55 $ + * $Revision: 57 $ * *****************************************************************************/ @@ -145,17 +145,15 @@ AcpiEnable (void) ACPI_FUNCTION_TRACE ("AcpiEnable"); - /* Make sure we have ACPI tables */ + /* Make sure we have the FADT*/ - if (!AcpiGbl_DSDT) + if (!AcpiGbl_FADT) { - ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "No ACPI tables present!\n")); + ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "No FADT information present!\n")); return_ACPI_STATUS (AE_NO_ACPI_TABLES); } - AcpiGbl_OriginalMode = AcpiHwGetMode (); - - if (AcpiGbl_OriginalMode == ACPI_SYS_MODE_ACPI) + if (AcpiHwGetMode() == ACPI_SYS_MODE_ACPI) { ACPI_DEBUG_PRINT ((ACPI_DB_OK, "Already in ACPI mode.\n")); } @@ -185,8 +183,7 @@ AcpiEnable (void) * * RETURN: Status * - * DESCRIPTION: Returns the system to original ACPI/legacy mode, and - * uninstalls the SCI interrupt handler. + * DESCRIPTION: Transfers the system into LEGACY mode. * ******************************************************************************/ @@ -198,22 +195,30 @@ AcpiDisable (void) ACPI_FUNCTION_TRACE ("AcpiDisable"); + if (!AcpiGbl_FADT) + { + ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "No FADT information present!\n")); + return_ACPI_STATUS (AE_NO_ACPI_TABLES); + } - if (AcpiHwGetMode () != AcpiGbl_OriginalMode) + if (AcpiHwGetMode() == ACPI_SYS_MODE_LEGACY) { - /* Restore original mode */ + ACPI_DEBUG_PRINT ((ACPI_DB_OK, "Already in LEGACY mode.\n")); + } + else + { + /* Transition to LEGACY mode */ + Status = AcpiHwSetMode (ACPI_SYS_MODE_LEGACY); - Status = AcpiHwSetMode (AcpiGbl_OriginalMode); if (ACPI_FAILURE (Status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Unable to transition to original mode")); + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not transition to LEGACY mode.")); return_ACPI_STATUS (Status); } - } - /* Unload the SCI interrupt handler */ + ACPI_DEBUG_PRINT ((ACPI_DB_OK, "Transition to LEGACY mode successful\n")); + } - Status = AcpiEvRemoveSciHandler (); return_ACPI_STATUS (Status); } |