Skip to content

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

Merged
josephlr merged 3 commits intorust-osdev:masterfrom
kevinaboos:make_handler_addr_pub
Mar 25, 2022
Merged

Make Entry::handler_addr() a public method#354
josephlr merged 3 commits intorust-osdev:masterfrom
kevinaboos:make_handler_addr_pub

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.

@kevinaboos kevinaboos requested a review from josephlr March 24, 2022 21:48
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