Page MenuHomeFreeBSD

sys/power.h: `enum power_sstate_transition`
Needs ReviewPublic

Authored by obiwac on Fri, Sep 12, 1:25 PM.
Tags
None
Referenced Files
F131824141: D52497.id161944.diff
Sat, Oct 11, 11:41 AM
Unknown Object (File)
Sat, Oct 11, 3:41 AM
Unknown Object (File)
Sat, Oct 11, 3:41 AM
Unknown Object (File)
Fri, Oct 10, 8:43 PM
Unknown Object (File)
Fri, Oct 10, 5:23 AM
Unknown Object (File)
Thu, Oct 2, 5:31 PM
Unknown Object (File)
Wed, Oct 1, 1:35 AM
Unknown Object (File)
Tue, Sep 30, 9:05 AM
Subscribers

Details

Reviewers
markj
jrm
mckusick
Summary

Turn POWER_SLEEP_STATE_* defines into enum power_sstate_transition.

Maybe I missed some places where just an int is being used for the sleep state, gonna look at this deeper later.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 66984
Build 63867: arc lint + arc unit

Event Timeline

sys/sys/power.h
55โ€“57

Is there a particular reason we'd want to explicitly set these values? Is it preferred style in FreeBSD to explicitly set these when an enum is used in an interface or something?

sys/dev/acpi_support/acpi_ibm.c
1454

Does this perhaps suggest that it isn't very useful in general to distinguish between SSTATE_TRANSITION_* and STYPE_*?

sys/sys/power.h
55โ€“57

That's not necessary for internal kernel interfaces.

obiwac added inline comments.
sys/dev/acpi_support/acpi_ibm.c
1454

can you elaborate on in what way this suggests the distinction is not useful? Other places need to know if the suspend type is s2idle or s2mem, I just added this comment to note that the use of the name "IBM_EVENT_SUSPEND_TO_RAM" here doesn't necessarily mean s2mem, but could also be s2idle