aboutsummaryrefslogtreecommitdiff
path: root/.devcontainer/x86-64
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@ost.ch>2026-11-24 13:38:48 +0100
committerFelix Morgner <felix.morgner@ost.ch>2026-11-24 13:38:48 +0100
commit2b2fb619966bf63c0c862a35d769ca48a1ed98b3 (patch)
tree1fc5a1f9c08b1d2e3927594b857512f7d2d8875c /.devcontainer/x86-64
parentc9fdf7c17782cc4fa60ae41fb8d8a28ee93f43d5 (diff)
downloadkernel-fmorgner/pci-device-tree.tar.xz
kernel-fmorgner/pci-device-tree.zip
kernel/bus: add PCI matching contractfmorgner/pci-device-tree
This change implements the PCI matching contract for devices and drivers. Device-driver pairings are ranked based on the specificity of the match between a pci_id and a function_info object. An exact match of the vendor_id and device_id of a pci_id and a function_info object scores 0x10. Each matching class_code, subclass_code, and programming_interface adds 1 point to the score. Matching is performed independently for each entry in a driver's match table, with the highest scoring entry determining the final match score for a single driver. Any malformed entries in the match tables are ignored. Specifically, an entry is considered malformed if it names a vendor_id without a device_id or vice versa. An entry is also considered malformed if it names a programming_interface without a subclass_code or a subclass_code without a class_code. An entry naming no fields is also considered malformed. This change also introduces the following types for PCI devices, drivers, and buses: pci_id, pci_claim, pci_signature, and pci_protocol. pci_protocol is an abstract class because the host bridge and PCI-to-PCI bridges will differ in their implementations of pci_protocol::enumerate. Both bridge types will share the same ranking algorithm for device-driver pairings. The included tests exercise the PCI matching algorithm, including scoring of valid matches, malformed entries, and driver selection through the global driver registry.
Diffstat (limited to '.devcontainer/x86-64')
0 files changed, 0 insertions, 0 deletions