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)
Fri, Oct 10, 10:02 PM
Unknown Object (File)
Wed, Oct 8, 4:52 AM
Unknown Object (File)
Sun, Oct 5, 3:47 AM
Unknown Object (File)
Wed, Sep 24, 12:17 AM
Unknown Object (File)
Sun, Sep 21, 7:00 PM
Unknown Object (File)
Sun, Sep 21, 9:38 AM
Unknown Object (File)
Sep 13 2025, 9:16 PM
Unknown Object (File)
Sep 10 2025, 10:15 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.