pub trait CleanUp {
    // Required methods
    unsafe fn clean_up<D>(&mut self, frame_deallocator: &mut D)
       where D: FrameDeallocator<Size4KiB>;
    unsafe fn clean_up_addr_range<D>(
        &mut self,
        range: PageRangeInclusive,
        frame_deallocator: &mut D
    )
       where D: FrameDeallocator<Size4KiB>;
}
Expand description

Provides methods for cleaning up unused entries.

Required Methods§

source

unsafe fn clean_up<D>(&mut self, frame_deallocator: &mut D)

Remove all empty P1-P3 tables

§Safety

The caller has to guarantee that it’s safe to free page table frames: All page table frames must only be used once and only in this page table (e.g. no reference counted page tables or reusing the same page tables for different virtual addresses ranges in the same page table).

source

unsafe fn clean_up_addr_range<D>( &mut self, range: PageRangeInclusive, frame_deallocator: &mut D )

Remove all empty P1-P3 tables in a certain range

// clean up all page tables in the lower half of the address space
let lower_half = Page::range_inclusive(
    Page::containing_address(VirtAddr::new(0)),
    Page::containing_address(VirtAddr::new(0x0000_7fff_ffff_ffff)),
);
page_table.clean_up_addr_range(lower_half, frame_deallocator);
§Safety

The caller has to guarantee that it’s safe to free page table frames: All page table frames must only be used once and only in this page table (e.g. no reference counted page tables or reusing the same page tables for different virtual addresses ranges in the same page table).

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a> CleanUp for OffsetPageTable<'a>

Available on 64-bit only.
source§

impl<'a> CleanUp for RecursivePageTable<'a>

Available on crate feature instructions only.
source§

impl<'a, P: PageTableFrameMapping> CleanUp for MappedPageTable<'a, P>