Skip to content

Add set_interrupt_model_used method for calling \_PIC - #357

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

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

Conversation

@ChocolateLoverRaj

Copy link
Copy Markdown
Contributor

Closes #356

Tested on QEMU q35 and Lenovo Ideapad Z560.

Tested on QEMU q35 and Lenovo Ideapad Z560.
Comment thread src/aml/interrupt_model_used.rs Outdated
Comment thread src/aml/interrupt_model_used.rs Outdated
@martin-hughes

Copy link
Copy Markdown
Contributor

Looks pretty reasonable from a first look. A couple of minor points, and one other thought:

  • I think it would read better as just InterruptModel rather than InterruptModelUsed.

What do you think?

@ChocolateLoverRaj

Copy link
Copy Markdown
Contributor Author

My only concern with naming it InterruptModel is that there is already an InterruptModel type.

#[derive(Debug, Clone, Copy)]
pub enum InterruptModelUsed {
/// 0 - PIC mode
PicMode,

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.

Any reason not to either add the values to the first three, or remove from the last three?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I left the first 3 to 0,1,2 implicitly, there's no reason not to add the values to them, I just felt lazy ig. The important thing is that 3 is left as Reserved.

@martin-hughes

Copy link
Copy Markdown
Contributor

My only concern with naming it InterruptModel is that there is already an InterruptModel type.

Ah that does make sense! 😆 Thanks for the tweaks. In principle I'm happy, but I want to think a little more about the interrupt model types and names.

(Although I'm aware that we need to do a semver version bump in the future anyway, so we could adjust this later. I won't leave this hanging PR too long.)

@martin-hughes

Copy link
Copy Markdown
Contributor

I guess InterruptModelUsed and InterruptModel as a pair are analogous to the pair ObjectType and Object. I didn't think of a better name for InterruptModelUsed, so I'll merge.

@martin-hughes
martin-hughes merged commit 147973c into rust-osdev:main Sep 24, 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.

Mention calling \_PIC AML method in docs

2 participants