-
Notifications
You must be signed in to change notification settings - Fork 111
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
Permit page table static to be updated #4792
Conversation
3b00f0d
to
06b1acd
Compare
/// Replaces the current pagetable with the parameter, returning the old | ||
/// pagetable if there was one. Does not issue the instructions update the | ||
/// page table on the CPU level. | ||
pub fn replace(&mut self, new_pt: RootPageTable) -> Option<RootPageTable> { | ||
self.inner.replace(new_pt) | ||
} |
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.
This isn't used yet, but will be in the future
@@ -267,3 +267,35 @@ impl Translator for RootPageTable { | |||
self.inner.translate_physical_frame(frame) | |||
} | |||
} | |||
|
|||
/// Wrapper struct that holds the current page table is there one. | |||
pub struct CurrentPageTable { |
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.
nit: perhaps emphasize the fact that this is the current root page table in the name (e.g. CurrentRootPageTable)
inner: Option<RootPageTable>, | ||
} | ||
|
||
impl CurrentPageTable { |
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.
This doesn't seem to add much over just using Option<RootPageTable
, apart from changing the names of some functions. Do you plan on adding more functionality to this wrapper in future?
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.
I would expect it to later on update the pagetable on the CPU level upon updating.
The other difference is that it cannot be set back to None
.
No description provided.