1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-24 11:29:10 +00:00

Add a new sysctl, hw.acpi.handle_reboot. If set, acpi will attempt to

perform the reboot action via the reset register instead of our legacy
method.  Default is 0 (use legacy).  This is needed because some systems
hang on reboot even though they claim to support the reset register.

MFC after:	2 days
This commit is contained in:
Nate Lawson 2006-07-29 21:46:16 +00:00
parent 31c9ecbf46
commit d1b16e1864
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=160824
2 changed files with 7 additions and 2 deletions

View File

@ -525,6 +525,9 @@ acpi_attach(device_t dev)
SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree),
OID_AUTO, "disable_on_reboot", CTLFLAG_RW,
&sc->acpi_do_disable, 0, "Disable ACPI when rebooting/halting system");
SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree),
OID_AUTO, "handle_reboot", CTLFLAG_RW,
&sc->acpi_handle_reboot, 0, "Use ACPI Reset Register to reboot");
/*
* Default to 1 second before sleeping to give some machines time to
@ -1658,7 +1661,8 @@ acpi_shutdown_final(void *arg, int howto)
DELAY(1000000);
printf("ACPI power-off failed - timeout\n");
}
} else if ((howto & RB_HALT) == 0 && AcpiGbl_FADT->ResetRegSup) {
} else if ((howto & RB_HALT) == 0 && AcpiGbl_FADT->ResetRegSup &&
sc->acpi_handle_reboot) {
/* Reboot using the reset register. */
status = AcpiHwLowLevelWrite(
AcpiGbl_FADT->ResetRegister.RegisterBitWidth,

View File

@ -47,7 +47,7 @@
struct acpi_softc {
device_t acpi_dev;
struct cdev *acpi_dev_t;
struct cdev *acpi_dev_t;
struct resource *acpi_irq;
int acpi_irq_rid;
@ -70,6 +70,7 @@ struct acpi_softc {
int acpi_s4bios;
int acpi_do_disable;
int acpi_verbose;
int acpi_handle_reboot;
bus_dma_tag_t acpi_waketag;
bus_dmamap_t acpi_wakemap;