Page MenuHomeFreeBSD

zzz: Rewrite to use new power device
AcceptedPublic

Authored by obiwac on Sun, May 10, 8:54 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 15, 11:54 AM
Unknown Object (File)
Thu, May 14, 11:09 AM
Unknown Object (File)
Wed, May 13, 11:22 PM
Unknown Object (File)
Wed, May 13, 10:52 AM
Unknown Object (File)
Tue, May 12, 2:43 PM
Unknown Object (File)
Tue, May 12, 2:42 PM
Unknown Object (File)
Mon, May 11, 4:06 PM
Unknown Object (File)
Mon, May 11, 4:39 AM
Subscribers

Details

Reviewers
olce
imp
Summary

Previous script called acpiconf(8) (or apm(8) if ACPI wasn't supported,
although this was anyway redundant because APMIO just uses ACPI now).

Since a new generic power management interface was introduced, this isn't
sufficient, as this would only work for ACPI systems and for ACPI S3 suspend
(so no way to select suspend-to-idle). Rewrite in C to take advantage of the
new power interface.

We may want to add a switch to manually override the kern.power.suspend sysctl,
which is otherwise what the power device uses to decide which suspend type to
switch to (suspend-to-idle or firmware suspend), but this will require us to
amend the power interface.

Sponsored by: The FreeBSD Foundation

Test Plan

Still need to test this on an ACPI machine. Expected behaviour on machines which support S3: just suspend to S3 when running zzz.

If someone with a machine that supports ACPI S3 could test this works that'd be great :)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 72999
Build 69882: arc lint + arc unit

Event Timeline

also, TODO, update manpage

usr.sbin/zzz/Makefile
3

probably don't want this to be in the acpi package! but I don't know what the most appropriate thing here is.

usr.sbin/zzz/zzz.c
41–43

I don't know if it's worth adding fallback support to APCIIO or APMIO?

This revision is now accepted and ready to land.Mon, May 11, 9:37 PM