Skip to content
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

Make Entry::handler_addr() a public method #354

Merged
merged 3 commits into from
Mar 25, 2022

Conversation

kevinaboos
Copy link
Contributor

This is a very minor change that's both harmless and useful for various purposes in an OS.

PR submitted at the request of @phil-opp (see here)

Potential changes

Note that we could gate the function (or just its pub-ness) behind cfg(feature = "instructions") for consistency, but then we'd need to change the implementation of Debug for Entry. Seems best to leave it as is.

We could also construct a VirtAddr from the return value and return that instead, but personally I believe that adds unnecessary complexity. I also think some of this crate's other functions assume VirtAddrs in a lot of high-level wrapper functions where the value doesn't necessarily represent a virtual address (but that's a matter for a separate issue), so I'm inclined to not return a VirtAddr here.

src/structures/idt.rs Outdated Show resolved Hide resolved
Signed-off-by: Joe Richey <joerichey@google.com>
@josephlr josephlr enabled auto-merge March 25, 2022 23:36
@josephlr josephlr merged commit 2c9a807 into rust-osdev:master Mar 25, 2022
@kevinaboos kevinaboos deleted the make_handler_addr_pub branch March 25, 2022 23:43
@kevinaboos
Copy link
Contributor Author

Thanks for adding the clarifying comment and for merging it in! Much appreciated.

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.

2 participants