-
Notifications
You must be signed in to change notification settings - Fork 151
feat(mapper): make OffsetPageTable a type alias
#576
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
Conversation
|
One thing I am not sure about is whether we should deprecate the type alias and eventually remove it. This would reduce possibly confusing documentation entries and deduplicate some methods but would force the user to use longer method chains to replace them. |
8fa2354 to
463dfa9
Compare
Yes, please create a separate PR for that. Were there any merge issues you had to resolve?
I'd err on the side of caution and say yes. If someone has a use-case for this, we can always add it later.
Tbh, I'm not loving the new name of the Thanks for your work on all of this (including splitting up the PRs), I appreciate it! |
463dfa9 to
b7b3d04
Compare
Done. 👍
Ah, I had changed the code already but did not update the PR's description.
Thanks for the swift and helpful reviews! :) Any thoughts on whether to deprecate or remove anything? |
Freax13
left a comment
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, thanks! ![]()
- Make
OffsetPageTablea type alias. This allows callingMappedPageTablemethods onOffsetPageTable. User migration should be as easy as replacingOffsetPageTable::newwithOffsetPageTable::new_offset.Tbh, I'm not loving the new name of the
new_offsetfunction, but I think it's worth the trade-off for unifyingMappedPageTableandOffsetPageTable.Ah, I had changed the code already but did not update the PR's description. I had changed it to
from_phys_offset, aligning to both thePhysOffsettype and thephys_offset: VirtAddrargument.OffsetPageTable::from_phys_offsetandMappedPageTable::from_offsetdo not look too bad in my opinion, but I am happy to change it back or to something else if you prefer that.
Ah, nice, I didn't notice that. I like that name better, good call.
Any thoughts on whether to deprecate or remove anything? If not, this should be ready to merge from my side, barring any change requests from you.
I think the OffsetPageTable type alias is useful to keep around as a short-cut.
This PR is split off from #574 to discuss and merge the
OffsetPageTablechanges separately.Best reviewed commit by commit:
PhysOffset::offsettophys_offset. This change does not change the public API but aligns the internal field's name to the public API.PhysOffsetpublic. This straightforwardPageTableFrameMappingimplementation makesMappedPageTableusable as anOffsetPageTable, which is useful for generic code that otherwise would need to distinguish between the two.OffsetPageTablea type alias. This allows callingMappedPageTablemethods onOffsetPageTable. User migration should be as easy as replacingOffsetPageTable::newwithOffsetPageTable::from_phys_offset.