summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2010-10-13 00:21:53 +0000
committerjkim <jkim@FreeBSD.org>2010-10-13 00:21:53 +0000
commiteb994eb349fb4a02d6fb78be086b538e11eafd52 (patch)
tree948c0601cea74a5572831d8c1181ccbf1caecaaa /sys/dev/acpica
parent910485b93adc9bef14a86316486f8b98591f0597 (diff)
downloadFreeBSD-src-eb994eb349fb4a02d6fb78be086b538e11eafd52.zip
FreeBSD-src-eb994eb349fb4a02d6fb78be086b538e11eafd52.tar.gz
Use AcpiReset() from ACPICA instead of rolling our own, which is actually
incomplete. If FADT says the register is available, enable the capability by default. Remove the previous default value from acpi(4).
Diffstat (limited to 'sys/dev/acpica')
-rw-r--r--sys/dev/acpica/acpi.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index fa73818..f9b981b 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -587,6 +587,10 @@ acpi_attach(device_t dev)
freeenv(env);
}
+ /* Only enable reboot by default if the FADT says it is available. */
+ if (AcpiGbl_FADT.Flags & ACPI_FADT_RESET_REGISTER)
+ sc->acpi_handle_reboot = 1;
+
/* Only enable S4BIOS by default if the FACS says it is available. */
if (AcpiGbl_FACS->Flags & ACPI_FACS_S4_BIOS_PRESENT)
sc->acpi_s4bios = 1;
@@ -1819,19 +1823,15 @@ acpi_shutdown_final(void *arg, int howto)
DELAY(1000000);
device_printf(sc->acpi_dev, "power-off failed - timeout\n");
}
- } else if ((howto & RB_HALT) == 0 &&
- (AcpiGbl_FADT.Flags & ACPI_FADT_RESET_REGISTER) &&
- sc->acpi_handle_reboot) {
+ } else if ((howto & RB_HALT) == 0 && sc->acpi_handle_reboot) {
/* Reboot using the reset register. */
- status = AcpiWrite(
- AcpiGbl_FADT.ResetValue, &AcpiGbl_FADT.ResetRegister);
- if (ACPI_FAILURE(status))
- device_printf(sc->acpi_dev, "reset failed - %s\n",
- AcpiFormatException(status));
- else {
+ status = AcpiReset();
+ if (ACPI_SUCCESS(status)) {
DELAY(1000000);
device_printf(sc->acpi_dev, "reset failed - timeout\n");
- }
+ } else if (status != AE_NOT_EXIST)
+ device_printf(sc->acpi_dev, "reset failed - %s\n",
+ AcpiFormatException(status));
} else if (sc->acpi_do_disable && panicstr == NULL) {
/*
* Only disable ACPI if the user requested. On some systems, writing
OpenPOWER on IntegriCloud