Page MenuHomeFreeBSD

Add ACPI support for _CLS
ClosedPublic

Authored by andrew on Dec 6 2016, 5:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 29, 9:54 AM
Unknown Object (File)
Thu, Apr 25, 8:28 PM
Unknown Object (File)
Mar 17 2024, 4:10 PM
Unknown Object (File)
Feb 11 2024, 8:18 PM
Unknown Object (File)
Feb 9 2024, 10:06 AM
Unknown Object (File)
Jan 27 2024, 9:20 PM
Unknown Object (File)
Jan 10 2024, 3:29 PM
Unknown Object (File)
Dec 23 2023, 3:14 PM
Subscribers

Details

Summary

Add support to read the _CLS entry if it's present. It is used by
memory-mapped devices that are normally PCIe drives. Devices can then
use the existing pci_get_class, etc. accessors to query this data.

The ivar values are different enough from the existing ACPI and ISA
values to not conflict.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 6259
Build 6502: arc lint + arc unit

Event Timeline

andrew retitled this revision from to Add ACPI support for _CLS.
andrew updated this object.
andrew edited the test plan for this revision. (Show Details)
andrew added reviewers: jhb, jkim.
andrew added a subscriber: emaste.

My only thought is if you want to read _CLS once during device enumeration and cache it's value in 'struct acpi_device' rather than invoking it for each ivar access. Aside from that this looks fine.

andrew edited edge metadata.

Read _CLS once

sys/dev/acpica/acpi.c
930

While this would seem useful, it's probably not in practice. Accessors like 'pci_get_class()' have no way to return an error. They always return whatever is in '*result' so the caller will just get garbage. I think it would be better to always return a value, but use specific invalid values for devices without _CLS (namely 0xff). You can do this by just setting acpi_cls_class to '0xffffff' when enumerating a device if _CLS isn't present or has an error and then having these bits of code return the acpi_cls_class value unconditionally.

sys/dev/acpica/acpivar.h
89

If you do the above suggestion you won't need this variable.

Return 0xff if _CLS is missing

jhb edited edge metadata.

I should have noticed earlier, but it would be nice to use the same 'ad_' prefix as the rest of the structure members, and you probably don't need a blank line between ad_flags and the new field.

This revision is now accepted and ready to land.Dec 15 2016, 8:43 PM
This revision was automatically updated to reflect the committed changes.