Page MenuHomeFreeBSD

acpi: Move supported states arrays into the softc
AcceptedPublic

Authored by olce on Wed, Jun 3, 4:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 11, 7:33 PM
Unknown Object (File)
Thu, Jun 11, 4:33 AM
Unknown Object (File)
Thu, Jun 11, 2:46 AM
Unknown Object (File)
Wed, Jun 10, 10:22 PM
Unknown Object (File)
Tue, Jun 9, 7:42 AM
Unknown Object (File)
Mon, Jun 8, 8:56 PM
Unknown Object (File)
Mon, Jun 8, 8:16 PM
Unknown Object (File)
Sun, Jun 7, 10:50 PM
Subscribers

Details

Reviewers
obiwac
Summary

This is done in preparation of having some machine-dependent code access
these arrays through the softc.

Before this change, these arrays were static. We chose to make them
part of the softc, instead of just exporting them ('acpi_quirks' remains
a known offender; some better way forward is to declare the whole ACPI
softc as static).

Some sysctl handlers now need to be passed the softc to access the
arrays, and some already needed to be passed a pointer to a field in the
softc. As sysctl handlers are provided with a single pointer (arg1) and
a single integer (arg2), and now that the softc has to be passed into
the pointer argument (arg1), point indirectly to the wanted softc's
field by passing its offset in the integer argument (arg2).

To preserve the statically sized array in the signature of
power_pm_register(), and consequently avoid constructing such a dummy
array in early initialization (after this change, we can't pass
acpi_supported_stypes[] anymore as there is no existing ACPI softc at
this point), just remove the early ACPI registration via
power_pm_register(). This existed in the past as a hack to ensure ACPI
would be registered in priority, but for a long time now ACPI has been
the only subsystem that registers itself to the generic power
infrastructure, so this early registration has not been needed.

Sponsored by: The FreeBSD Foundation

Diff Detail

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