mirror of
https://github.com/opnsense/src.git
synced 2026-03-07 07:44:13 -05:00
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).
This commit is contained in:
parent
4f6fbcd5db
commit
ac731af567
2 changed files with 11 additions and 12 deletions
|
|
@ -25,7 +25,7 @@
|
|||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd June 2, 2010
|
||||
.Dd October 12, 2010
|
||||
.Dt ACPI 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
|
|
@ -112,7 +112,6 @@ exiting to legacy mode first.
|
|||
Default is 0, leave ACPI enabled.
|
||||
.It Va hw.acpi.handle_reboot
|
||||
Use the ACPI Reset Register capability to reboot the system.
|
||||
Default is 0, use legacy reboot support.
|
||||
Some newer systems require use of this register, while some only work
|
||||
with legacy rebooting support.
|
||||
.It Va hw.acpi.lid_switch_state
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue