-
-
Notifications
You must be signed in to change notification settings - Fork 185
uefi: Add device path generation for discovered devices in a PciTree #1831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
ab46f2d to
582714a
Compare
6f6f35b to
8a4ab00
Compare
8a4ab00 to
c31575d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with two nits!
PS: You do not have to fix it here but do you have an opinion on #1817? I'd like to hear a direction that we should go for (Box<DevicePath> vs PoolDevicePath)
|
|
||
| /// Returns an owned pool copy of this path. | ||
| #[cfg(feature = "alloc")] | ||
| pub fn to_pool(&self) -> Result<PoolDevicePath, DevicePathUtilitiesError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct me if I'm wrong but I think #[cfg(feature = "alloc")] is not needed here. PoolDevicePath works with the underlying UEFI allocator and does not interfer with the global Rust allocator at all?
The feature alloc is only for the global Rust allocator and not all allocations in general.
|
|
||
| /// Error type used by the device path construction of [`PciTree`]. | ||
| #[derive(Debug)] | ||
| pub enum PciDevicePathBuildError { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should implement core::error::Error and should also implement fn source() properly.
Initial implementation for device path generation of discovered pci devices in a
PciTreeinstance.Unfortunately, it's a bit clunky to use, since you have to query the
DevicePathcorresponding to yourPciRootBridgeIoinstance yourself and pass that in:I tried getting the
DevicePathof thePciRootBridgeIoinstance withinPciRootBridgeIo::enumerate()and pass that on to thePciTree, but I couldn't find a way to get theDevicePathinstance - other than ugly workarounds.Best consumed Commit-By-Commit. Contains #1830..
Steps to Undraft
Checklist