-
Notifications
You must be signed in to change notification settings - Fork 142
Returning FrameAlreadyMapped error when it shouldn't #461
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
Comments
Is there a reason why you aren't using
|
Sorry, I didn't see this function ! |
I think there are some users of the mapping function that expect it to return an error if the entry is already present even if that entry contains the same frame. Changing this behavior would be a breaking change and a subtle one. |
Yes I'm okay, but also why do we have Mapper::update_flags but not Mapper::get_flags, I think it would be a cool addition |
That sounds reasonable to me. Feel free to open a PR :) |
The |
Okay thanks ! |
Do you think it's mainly a documentation issue or do you see a way how we could make the API itself simpler? |
The API should change, because I think the update_flags and get_flags should be on the same object |
You can check the docs for a specific page table type to see all supported methods, e.g. https://docs.rs/x86_64/latest/x86_64/structures/paging/mapper/struct.OffsetPageTable.html. Keeping the traits separate allows creating custom read-only or write-only page table types.
I agree that such a comment would be useful. Could you submit a PR? |
The MapToError::FrameAlreadyMapped is returned when we try to map a frame that is already mapped.
From the offset_page_table -> Size4Kib code:
We get this error when we try to change the page flags, which isn't right, we should only return this error if the frame address's are different.
Something like:
Also why do we return the user inputted frame and not the previously mapped frame ?
The text was updated successfully, but these errors were encountered: