Skip to content

Conversation

@seijikun
Copy link
Contributor

@seijikun seijikun commented Nov 5, 2025

I finally gave up on trying to achieve the PCI bus device enumeration without allocation - that's not gonna happen.
I therefore accepted my fate and transformed my version with allocations into an upstreamable state.

This implementation uses the RootBridge's configuration() method to query ACPI information about the bridge. This contains ranges of valid bus addresses (setup & configured by the UEFI firmware), which are then used as starting points for the recursive bus/device/function scan.
The result of this recursive scan is written into a BTreeSet - which now has the ordering you'd expect and are used to from tools like lspci.

Best consumed commit-by-commit :P

Checklist

  • Sensible git history (for example, squash "typo" or "fix" commits). See the Rewriting History guide for help.
  • Update the changelog (if necessary)

@seijikun seijikun changed the title Mr pci enumerate uefi: Implement PciRootBridgeIo bus device enumeration logic Nov 5, 2025
@seijikun seijikun marked this pull request as draft November 5, 2025 20:11
This sorting now actually makes sense from a logical point of view.
This is now also the ordering you get by using typical tools like lspci.
@seijikun seijikun force-pushed the mr-pci-enumerate branch 4 times, most recently from 8a96ebf to c801389 Compare November 5, 2025 20:25
@seijikun seijikun force-pushed the mr-pci-enumerate branch 3 times, most recently from 8577e6f to 50999b8 Compare November 5, 2025 20:43
@seijikun seijikun marked this pull request as ready for review November 5, 2025 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant