[][src]Trait sunrise_bootstrap::paging::table::PageDirectoryTrait

pub trait PageDirectoryTrait: HierarchicalTable {
    type PageTableType: PageTableTrait;
    type FlusherType: Flusher;
    fn get_table(
        &mut self,
        index: usize
    ) -> PageState<SmartHierarchicalTable<Self::PageTableType>>;
fn create_table(
        &mut self,
        index: usize
    ) -> SmartHierarchicalTable<Self::PageTableType>; fn get_table_or_create(
        &mut self,
        index: usize
    ) -> SmartHierarchicalTable<Self::PageTableType> { ... }
fn map_to(
        &mut self,
        page: Frame,
        address: VirtualAddress,
        flags: I386EntryFlags
    ) { ... }
fn guard(&mut self, address: VirtualAddress) { ... }
fn __unmap(&mut self, page: VirtualAddress) -> PageState<Frame> { ... }
fn find_available_virtual_space_aligned<Land: VirtualSpaceLand>(
        &mut self,
        page_nb: usize,
        alignement: usize
    ) -> Option<VirtualAddress> { ... } }

A trait describing all the things that a PageDirectory can do.

Implementer only has to provide functions to map a table and create one, and the trait does the rest.

Thanks to this we can have the same api for every kind of directories, the only difference is the way we access the page tables for writing :

Associated Types

type PageTableType: PageTableTrait

type FlusherType: Flusher

Loading content...

Required methods

fn get_table(
    &mut self,
    index: usize
) -> PageState<SmartHierarchicalTable<Self::PageTableType>>

Gets a reference to a page table

fn create_table(
    &mut self,
    index: usize
) -> SmartHierarchicalTable<Self::PageTableType>

Allocates a page table, zero it and add an entry to the directory pointing to it

Loading content...

Provided methods

fn get_table_or_create(
    &mut self,
    index: usize
) -> SmartHierarchicalTable<Self::PageTableType>

Gets the page table at given index, or creates it if it does not exist

Panics

Panics if the whole page table is guarded.

fn map_to(
    &mut self,
    page: Frame,
    address: VirtualAddress,
    flags: I386EntryFlags
)

Creates a mapping in the page tables with the given flags

Panics

Panics if entry was already in use Panics if address is not page-aligned.

fn guard(&mut self, address: VirtualAddress)

Creates a guard page

Panics

Panics if entry was already in use Panics if address is not page-aligned.

fn __unmap(&mut self, page: VirtualAddress) -> PageState<Frame>

Deletes a mapping in the page tables, returning the frame if it existed.

Panics

Panics if address is not page-aligned.

fn find_available_virtual_space_aligned<Land: VirtualSpaceLand>(
    &mut self,
    page_nb: usize,
    alignement: usize
) -> Option<VirtualAddress>

Finds a virtual space hole that can contain page_nb consecutive pages Alignment is the bitshift of a mask that the first page address must satisfy (ex: 24 for 0x**000000)

Loading content...

Implementors

impl PageDirectoryTrait for ActivePageDirectory[src]

type PageTableType = ActivePageTable

type FlusherType = TlbFlush

fn get_table(
    &mut self,
    index: usize
) -> PageState<SmartHierarchicalTable<Self::PageTableType>>
[src]

Gets a reference to a page table through recursive mapping

fn create_table(
    &mut self,
    index: usize
) -> SmartHierarchicalTable<Self::PageTableType>
[src]

Allocates a page table, zero it and add an entry to the directory pointing to it

impl PageDirectoryTrait for InactivePageDirectory[src]

type PageTableType = InactivePageTable

type FlusherType = NoFlush

fn get_table(
    &mut self,
    index: usize
) -> PageState<SmartHierarchicalTable<Self::PageTableType>>
[src]

Temporary map the table

fn create_table(
    &mut self,
    index: usize
) -> SmartHierarchicalTable<Self::PageTableType>
[src]

Allocates a page table, temporarily map it, zero it and add an entry to the directory pointing to it

impl PageDirectoryTrait for PagingOffDirectory[src]

type PageTableType = PagingOffTable

type FlusherType = NoFlush

fn get_table(
    &mut self,
    index: usize
) -> PageState<SmartHierarchicalTable<Self::PageTableType>>
[src]

Simply cast pointed frame as PageTable

fn create_table(
    &mut self,
    index: usize
) -> SmartHierarchicalTable<Self::PageTableType>
[src]

Allocates a page table, zero it and add an entry to the directory pointing to it

Loading content...