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

Change signature of PhysToVirt::phys_to_virt #213

Closed
wants to merge 2 commits into from

Conversation

phil-opp
Copy link
Member

@phil-opp phil-opp commented Dec 28, 2020

Instead of translating PhysFrames to *mut PageTable pointers as before, it now performs a more general PhysAddr to VirtAddr conversion. Since the implementer must make sure that the returned address is valid and accessible, the trait is now unsafe to implement. Because of this requirement we also need to remove the generic implementation of this trait for closures.

This is a breaking change.

Instead of translating `PhysFrame`s to `*mut PageTable` pointers as before, it now performs a more general `PhysAddr` to `VirtAddr` conversion. Since the implementer must make sure that the returned address is valid and accessible, the trait is now unsafe to implement. Because of this requirement we also need to remove the generic implementation of this trait for closures.
@phil-opp phil-opp mentioned this pull request Dec 28, 2020
14 tasks
@phil-opp
Copy link
Member Author

Unfortunately this approach doesn't work since MappedPageTable should also work on non-x86_64 systems, where conversions from VirtAddr to pointers might not be possible (e.g. on 32 bit systems).

@phil-opp phil-opp closed this Dec 28, 2020
@phil-opp phil-opp deleted the improve-phys-to-virt branch December 28, 2020 13:20
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.

1 participant