Page MenuHomeFreeBSD

acpi_spmc(4): Factor out testing for present DSMs/functions
ClosedPublic

Authored by olce on Thu, May 7, 8:18 PM.
Tags
None
Referenced Files
F157457391: D56878.id.diff
Thu, May 21, 4:26 PM
F157437867: D56878.id177659.diff
Thu, May 21, 11:38 AM
F157437187: D56878.id177760.diff
Thu, May 21, 11:27 AM
F157411832: D56878.id177412.diff
Thu, May 21, 3:11 AM
Unknown Object (File)
Wed, May 20, 2:00 AM
Unknown Object (File)
Wed, May 20, 12:58 AM
Unknown Object (File)
Tue, May 19, 8:12 AM
Unknown Object (File)
Tue, May 19, 8:08 AM
Subscribers

Details

Summary

Since we are now keeping in the softc the information about which DSM
functions are available (in supported_functions[]), the 'dsms' field
there is somewhat redundant.

Make it completely redundant by keeping the bit representing the
enumeration function itself in each element of supported_functions[],
and then remove the field.

As a result, convert has_dsm() to rely on supports_function().

Adapt acpi_spmc_dsm_check_functions() so that it does not take into
account the enumeration function bit.

While here, use the self-explanatory stance
IDX_TO_BIT(DSM_ENUM_FUNCTIONS) instead of a hardcoded 1.

Sponsored by: The FreeBSD Foundation

Diff Detail

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

Event Timeline

olce requested review of this revision.Thu, May 7, 8:18 PM

yeah, this logic is much better

sys/dev/acpica/acpi_spmc.c
245–260

can we just move these functions in the revision they were added? esp since at least supports_function() will have more history than just the commit in which it was added, which we'd thus lose in a blame

387–389

i remember this was moved in a revision somewhere down the stack, and here it's just being moved back. Can we just not move it in that revision?

This revision is now accepted and ready to land.Mon, May 11, 9:28 AM
olce added inline comments.
sys/dev/acpica/acpi_spmc.c
245–260

Sure.

387–389

Yes. I moved the KASSERT() to be closer to the first use assuming the checked invariant, which causes it to move back and forth. Will remove that.

olce marked 2 inline comments as done.Mon, May 11, 4:58 PM

Impacts of changes in earlier revisions, no real change.

This revision now requires review to proceed.Tue, May 12, 1:42 PM
This revision is now accepted and ready to land.Tue, May 12, 2:15 PM