Skip to content

Create pci_routing::Pin::from_pci_interrupt_pin convenience fn. - #359

Merged
martin-hughes merged 2 commits into
rust-osdev:mainfrom
ChocolateLoverRaj:pin_from_pci
Sep 21, 2026
Merged

martin-hughes merged 2 commits into
rust-osdev:mainfrom
ChocolateLoverRaj:pin_from_pci

Conversation

@ChocolateLoverRaj

Copy link
Copy Markdown
Contributor

Closes #358

Tested on QEMU q35.

Comment thread src/aml/pci_routing.rs
@martin-hughes

Copy link
Copy Markdown
Contributor

Good idea in principle, although I think your code could have explained this a bit more:

This would add some convenience and also reduce confusion since PCI pin starts with 1 is INTA#, while AML starts with 0 is INTA#

Which is why I suggest the extra function in my comment.

Comment thread src/aml/pci_routing.rs
}

#[derive(Debug, Clone, Copy)]
pub struct InvalidPciInterruptPinError(pub u8);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm of two minds about this. I feel like it should be a "true" error (impl Error) for similar reasons to those in this article, but I also see that AmlError doesn't do this.

It's probably fine to leave as it is, but @IsaacWoods, any thoughts?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the reason for this is purely me ignoring Error while it was std-only for a long while and then me being out of date! I definitely don't see any reason we shouldn't be implementing it for both errors like this and very likely for AmlError.

Doesn't necessarily need to block this PR, but up to you.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Quite happy to leave it and reconsider if (when!) we think about errors a bit more

@martin-hughes martin-hughes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for the updates! I'm happy to merge. I'll give Isaac a bit of time to reply, but I think I'm happy to leave these error types and to consider error-handling again later.

@martin-hughes
martin-hughes merged commit ff3dda5 into rust-osdev:main Sep 21, 2026
6 checks passed
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.

Add method to create a pci_routing::Pin from the PCI interrupt pin field

3 participants