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
F157291708: D56878.id177760.diff
Wed, May 20, 2:00 AM
F157286855: D56878.id177659.diff
Wed, May 20, 12:58 AM
F157206434: D56878.id177412.diff
Tue, May 19, 8:12 AM
F157206204: D56878.id177412.diff
Tue, May 19, 8:08 AM
Unknown Object (File)
Mon, May 18, 6:09 PM
Unknown Object (File)
Sun, May 17, 9:22 AM
Unknown Object (File)
Sun, May 17, 2:10 AM
Unknown Object (File)
Sat, May 16, 10:08 PM
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 Not Applicable
Unit
Tests Not Applicable

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
246–261

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

406–407

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
246–261

Sure.

406–407

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