Page MenuHomeFreeBSD

ACPI: Implement power button on !x86
ClosedPublic

Authored by cperciva on Oct 12 2024, 5:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 9, 12:21 PM
Unknown Object (File)
Thu, Dec 5, 6:24 PM
Unknown Object (File)
Mon, Dec 2, 11:39 AM
Unknown Object (File)
Nov 12 2024, 10:14 PM
Unknown Object (File)
Nov 3 2024, 8:05 PM
Unknown Object (File)
Oct 25 2024, 7:31 PM
Unknown Object (File)
Oct 19 2024, 9:06 PM
Unknown Object (File)
Oct 19 2024, 5:57 PM
Subscribers

Details

Summary

ACPI sleep states are only implemented on x86 systems, so having the
ACPI power button attempt to enter "S5" (or other state as configured
via the hw.acpi.power_button_state sysctl) is not useful.

On non-x86 systems, implement the power button with a call to

shutdown_nice(RB_POWEROFF)

to shut down the system.

Sponsored by: Amazon
Tested on: Graviton 2
MFC after: 2 weeks

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I could add a sysctl to disable this if anyone thinks that making the power button not power-off the system would be a useful option.

Maybe? There are a number of different ways to tell a system to turn off, so I don't know for certain whether the ACPI shutdown event from QEMU is this particular one.

This revision is now accepted and ready to land.Oct 17 2024, 10:05 AM
This revision was automatically updated to reflect the committed changes.