Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146928337
D55360.id172207.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D55360.id172207.diff
View Options
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -2663,37 +2663,46 @@
return (status);
}
+/* Return from this function indicates failure. */
static void
-acpi_shutdown_final(void *arg, int howto)
+acpi_poweroff(device_t acpi_dev)
{
- struct acpi_softc *sc = (struct acpi_softc *)arg;
- register_t intr;
- ACPI_STATUS status;
+ register_t intr;
+ ACPI_STATUS status;
- /*
- * XXX Shutdown code should only run on the BSP (cpuid 0).
- * Some chipsets do not power off the system correctly if called from
- * an AP.
- */
- if ((howto & RB_POWEROFF) != 0) {
- status = acpi_EnterSleepStatePrep(sc->acpi_dev, ACPI_STATE_S5);
+ device_printf(acpi_dev, "Powering system off...\n");
+ status = acpi_EnterSleepStatePrep(acpi_dev, ACPI_STATE_S5);
if (ACPI_FAILURE(status)) {
- device_printf(sc->acpi_dev, "Power-off preparation failed! - %s\n",
- AcpiFormatException(status));
+ device_printf(acpi_dev, "Power-off preparation failed! - %s\n",
+ AcpiFormatException(status));
return;
}
- device_printf(sc->acpi_dev, "Powering system off\n");
intr = intr_disable();
status = AcpiEnterSleepState(ACPI_STATE_S5);
if (ACPI_FAILURE(status)) {
intr_restore(intr);
- device_printf(sc->acpi_dev, "power-off failed - %s\n",
+ device_printf(acpi_dev, "Power-off failed! - %s\n",
AcpiFormatException(status));
} else {
DELAY(1000000);
intr_restore(intr);
- device_printf(sc->acpi_dev, "power-off failed - timeout\n");
+ device_printf(acpi_dev, "Power-off failed! - timeout\n");
}
+}
+
+static void
+acpi_shutdown_final(void *arg, int howto)
+{
+ struct acpi_softc *sc = (struct acpi_softc *)arg;
+ ACPI_STATUS status;
+
+ /*
+ * XXX Shutdown code should only run on the BSP (cpuid 0).
+ * Some chipsets do not power off the system correctly if called from
+ * an AP.
+ */
+ if ((howto & RB_POWEROFF) != 0) {
+ acpi_poweroff(sc->acpi_dev);
} else if ((howto & RB_HALT) == 0 && sc->acpi_handle_reboot) {
/* Reboot using the reset register. */
status = AcpiReset();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 7, 8:38 PM (15 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28894077
Default Alt Text
D55360.id172207.diff (2 KB)
Attached To
Mode
D55360: libc: Roll {l,ll,imax}div(3) manpages into just div(3)
Attached
Detach File
Event Timeline
Log In to Comment