Skip to content

Commit 4ced281

Browse files
authored
Merge pull request #296 from toku-sa-n/flush_new
feat(mapper): expose `MapperFlush(All)?::new`
2 parents a9cbf14 + 278e1fe commit 4ced281

File tree

1 file changed

+9
-3
lines changed
  • src/structures/paging/mapper

1 file changed

+9
-3
lines changed

src/structures/paging/mapper/mod.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,11 @@ pub struct MapperFlush<S: PageSize>(Page<S>);
381381

382382
impl<S: PageSize> MapperFlush<S> {
383383
/// Create a new flush promise
384+
///
385+
/// Note that this method is intended for implementing the [`Mapper`] trait and no other uses
386+
/// are expected.
384387
#[inline]
385-
fn new(page: Page<S>) -> Self {
388+
pub fn new(page: Page<S>) -> Self {
386389
MapperFlush(page)
387390
}
388391

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

410413
impl MapperFlushAll {
411414
/// Create a new flush promise
415+
///
416+
/// Note that this method is intended for implementing the [`Mapper`] trait and no other uses
417+
/// are expected.
412418
#[inline]
413-
fn new() -> Self {
419+
pub fn new() -> Self {
414420
MapperFlushAll(())
415421
}
416422

0 commit comments

Comments
 (0)