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

feat(mapper): expose MapperFlush(All)?::new #296

Merged
merged 1 commit into from
Aug 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/structures/paging/mapper/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,11 @@ pub struct MapperFlush<S: PageSize>(Page<S>);

impl<S: PageSize> MapperFlush<S> {
/// Create a new flush promise
josephlr marked this conversation as resolved.
Show resolved Hide resolved
///
/// Note that this method is intended for implementing the [`Mapper`] trait and no other uses
/// are expected.
#[inline]
fn new(page: Page<S>) -> Self {
pub fn new(page: Page<S>) -> Self {
MapperFlush(page)
}

Expand All @@ -403,14 +406,17 @@ impl<S: PageSize> MapperFlush<S> {
/// The old mapping might be still cached in the translation lookaside buffer (TLB), so it needs
/// to be flushed from the TLB before it's accessed. This type is returned from a function that
/// made the change to ensure that the TLB flush is not forgotten.
#[derive(Debug)]
#[derive(Debug, Default)]
#[must_use = "Page Table changes must be flushed or ignored."]
pub struct MapperFlushAll(());

impl MapperFlushAll {
/// Create a new flush promise
///
/// Note that this method is intended for implementing the [`Mapper`] trait and no other uses
/// are expected.
#[inline]
fn new() -> Self {
pub fn new() -> Self {
josephlr marked this conversation as resolved.
Show resolved Hide resolved
MapperFlushAll(())
}

Expand Down