diff options
author | njl <njl@FreeBSD.org> | 2004-05-25 02:41:19 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2004-05-25 02:41:19 +0000 |
commit | 43f044bb8cebf8c85e49516d87fa551091272959 (patch) | |
tree | 98084a924d3852a9d145a062e0280d08f8793605 /sys/contrib | |
parent | f5f00ea0addfa0016f8bfc2ffb0e1fc4fcb2ca8c (diff) | |
download | FreeBSD-src-43f044bb8cebf8c85e49516d87fa551091272959.zip FreeBSD-src-43f044bb8cebf8c85e49516d87fa551091272959.tar.gz |
Local change: don't hang forever if WAK_STS is never set.
Diffstat (limited to 'sys/contrib')
-rw-r--r-- | sys/contrib/dev/acpica/hwsleep.c | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/sys/contrib/dev/acpica/hwsleep.c b/sys/contrib/dev/acpica/hwsleep.c index d3c9841..bb4ef6a 100644 --- a/sys/contrib/dev/acpica/hwsleep.c +++ b/sys/contrib/dev/acpica/hwsleep.c @@ -2,7 +2,7 @@ /****************************************************************************** * * Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface - * $Revision: 66 $ + * $Revision: 69 $ * *****************************************************************************/ @@ -358,6 +358,8 @@ AcpiEnterSleepState ( return_ACPI_STATUS (Status); } + /* Clear all fixed and general purpose status bits */ + Status = AcpiHwClearAcpiStatus (ACPI_MTX_DO_NOT_LOCK); if (ACPI_FAILURE (Status)) { @@ -376,10 +378,17 @@ AcpiEnterSleepState ( } /* - * 1) Disable all runtime GPEs + * 1) Disable/Clear all GPEs * 2) Enable all wakeup GPEs */ - Status = AcpiHwPrepareGpesForSleep (); + Status = AcpiHwDisableAllGpes (); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + AcpiGbl_SystemAwakeAndRunning = FALSE; + + Status = AcpiHwEnableAllWakeupGpes (); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -531,10 +540,17 @@ AcpiEnterSleepStateS4bios ( } /* - * 1) Disable all runtime GPEs + * 1) Disable/Clear all GPEs * 2) Enable all wakeup GPEs */ - Status = AcpiHwPrepareGpesForSleep (); + Status = AcpiHwDisableAllGpes (); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + AcpiGbl_SystemAwakeAndRunning = FALSE; + + Status = AcpiHwEnableAllWakeupGpes (); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -658,10 +674,17 @@ AcpiLeaveSleepState ( /* * Restore the GPEs: - * 1) Disable all wakeup GPEs + * 1) Disable/Clear all GPEs * 2) Enable all runtime GPEs */ - Status = AcpiHwRestoreGpesOnWake (); + Status = AcpiHwDisableAllGpes (); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + AcpiGbl_SystemAwakeAndRunning = TRUE; + + Status = AcpiHwEnableAllRuntimeGpes (); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -669,9 +692,9 @@ AcpiLeaveSleepState ( /* Enable power button */ - AcpiSetRegister(AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].EnableRegisterId, + (void) AcpiSetRegister(AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].EnableRegisterId, 1, ACPI_MTX_DO_NOT_LOCK); - AcpiSetRegister(AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].StatusRegisterId, + (void) AcpiSetRegister(AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].StatusRegisterId, 1, ACPI_MTX_DO_NOT_LOCK); /* Enable BM arbitration */ |