Page MenuHomeFreeBSD

ACPI: Implement power button on !x86
ClosedPublic

Authored by cperciva on Oct 12 2024, 5:33 PM.
Tags
None
Referenced Files
F157871493: D47094.id.diff
Tue, May 26, 12:55 AM
Unknown Object (File)
Sun, May 24, 12:51 AM
Unknown Object (File)
Thu, May 21, 9:27 AM
Unknown Object (File)
Tue, May 19, 6:18 AM
Unknown Object (File)
Wed, May 13, 2:23 PM
Unknown Object (File)
Wed, May 13, 11:24 AM
Unknown Object (File)
Wed, May 13, 6:07 AM
Unknown Object (File)
Tue, May 12, 12:38 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.