[−][src]Trait sunrise_kernel::paging::hierarchical_table::HierarchicalTable
A hierarchical paging is composed of tables. All tables must implement the following trait A table of entries, either the top-level directory or one of the page tables. A table is a parent table if its child are also tables, instead of regular pages.
Associated Types
type EntryType: HierarchicalEntry
The Entry our table has
type CacheFlusherType: PagingCacheFlusher
A Flusher that should be called on table modifications
type ChildTableType: HierarchicalTable
If we're a parent table, the type of our child tables. If we're not a parent, this type will never be used and you can set it to Self.
Required methods
fn entries(&mut self) -> &mut [Self::EntryType]
gets the raw array of entries
fn table_level() -> usize
Called to check if this table's entries should be treated as pointers to child tables. Level 0 = simple table, level 1 = parent of simple tables, level 2 = parent of parent of simple tables, ...
fn get_child_table(
&mut self,
index: usize
) -> PageState<SmartHierarchicalTable<Self::ChildTableType>>
&mut self,
index: usize
) -> PageState<SmartHierarchicalTable<Self::ChildTableType>>
Gets a reference to a child page table.
Panics
Should panic if called on a table which isn't a parent table.
fn create_child_table(
&mut self,
index: usize
) -> SmartHierarchicalTable<Self::ChildTableType>
&mut self,
index: usize
) -> SmartHierarchicalTable<Self::ChildTableType>
Allocates a child page table, zero it and add an entry pointing to it.
Panics
Should panic if called on a table which isn't a parent table. Should panic if entry was not available.
Provided methods
fn zero(&mut self)
zero out the whole table
fn guard_all_entries(&mut self)
Makes all entries guarded
fn map_nth_entry(
&mut self,
entry: usize,
paddr: PhysicalAddress,
flags: <Self::EntryType as HierarchicalEntry>::EntryFlagsType
)
&mut self,
entry: usize,
paddr: PhysicalAddress,
flags: <Self::EntryType as HierarchicalEntry>::EntryFlagsType
)
Creates a mapping on the nth entry of a table
fn guard_nth_entry(&mut self, entry: usize)
Marks the nth entry as guard page
fn unmap_nth_entry(&mut self, entry: usize)
Marks the nth entry as guard page
fn entry_vm_size() -> usize
the size an entry in this table spans in virtual memory. should be something like PAGE_SIZE * (ENTRY_COUNT ^ table level)
fn get_child_table_or_create(
&mut self,
index: usize
) -> PageState<SmartHierarchicalTable<Self::ChildTableType>>
&mut self,
index: usize
) -> PageState<SmartHierarchicalTable<Self::ChildTableType>>
Gets the child page table at given index, or creates it if it does not exist
Panics
Should panic if called on a table which isn't a parent table.
Implementations on Foreign Types
impl HierarchicalTable for ()
[src]
type EntryType = Entry
type CacheFlusherType = NoFlush
type ChildTableType = ()
fn entries(&mut self) -> &mut [Entry]
[src]
fn table_level() -> usize
[src]
fn get_child_table(
&mut self,
_index: usize
) -> PageState<SmartHierarchicalTable<Self::ChildTableType>>
[src]
&mut self,
_index: usize
) -> PageState<SmartHierarchicalTable<Self::ChildTableType>>
fn create_child_table(
&mut self,
_index: usize
) -> SmartHierarchicalTable<Self::ChildTableType>
[src]
&mut self,
_index: usize
) -> SmartHierarchicalTable<Self::ChildTableType>
Implementors
impl HierarchicalTable for ActivePageDirectory
[src]
type EntryType = I386Entry
type CacheFlusherType = TlbFlush
type ChildTableType = ActivePageTable
fn entries(&mut self) -> &mut [I386Entry]
[src]
fn table_level() -> usize
[src]
fn get_child_table(
&mut self,
index: usize
) -> PageState<SmartHierarchicalTable<ActivePageTable>>
[src]
&mut self,
index: usize
) -> PageState<SmartHierarchicalTable<ActivePageTable>>
Gets a child ActivePageTable through recursive mapping.
fn create_child_table(
&mut self,
index: usize
) -> SmartHierarchicalTable<ActivePageTable>
[src]
&mut self,
index: usize
) -> SmartHierarchicalTable<ActivePageTable>
Creates a child ActivePageTable, maps it at the given index, and returns it.
Panics
Panics if the entry was not available.
impl HierarchicalTable for ActivePageTable
[src]
type EntryType = I386Entry
type CacheFlusherType = TlbFlush
type ChildTableType = Self
fn entries(&mut self) -> &mut [I386Entry]
[src]
fn table_level() -> usize
[src]
fn get_child_table(
&mut self,
_index: usize
) -> PageState<SmartHierarchicalTable<Self::ChildTableType>>
[src]
&mut self,
_index: usize
) -> PageState<SmartHierarchicalTable<Self::ChildTableType>>
Panics, a page table has no children.
fn create_child_table(
&mut self,
_index: usize
) -> SmartHierarchicalTable<Self::ChildTableType>
[src]
&mut self,
_index: usize
) -> SmartHierarchicalTable<Self::ChildTableType>
Panics, a page table has no children.
impl HierarchicalTable for InactivePageDirectory
[src]
type EntryType = I386Entry
type CacheFlusherType = NoFlush
type ChildTableType = InactivePageTable
fn entries(&mut self) -> &mut [I386Entry]
[src]
fn table_level() -> usize
[src]
fn get_child_table(
&mut self,
index: usize
) -> PageState<SmartHierarchicalTable<InactivePageTable>>
[src]
&mut self,
index: usize
) -> PageState<SmartHierarchicalTable<InactivePageTable>>
Gets the child InactivePageTable at the given index. Temporarily maps it if it is present.
fn create_child_table(
&mut self,
index: usize
) -> SmartHierarchicalTable<InactivePageTable>
[src]
&mut self,
index: usize
) -> SmartHierarchicalTable<InactivePageTable>
Creates a child InactivePageTable at the given index, temporarily maps it, and returns it.
Panics
Panics if the entry was not available.
impl HierarchicalTable for InactivePageTable
[src]
type EntryType = I386Entry
type CacheFlusherType = NoFlush
type ChildTableType = Self
fn entries(&mut self) -> &mut [I386Entry]
[src]
fn table_level() -> usize
[src]
fn get_child_table(
&mut self,
_index: usize
) -> PageState<SmartHierarchicalTable<Self::ChildTableType>>
[src]
&mut self,
_index: usize
) -> PageState<SmartHierarchicalTable<Self::ChildTableType>>
Panics, a page table has no children.
fn create_child_table(
&mut self,
_index: usize
) -> SmartHierarchicalTable<Self::ChildTableType>
[src]
&mut self,
_index: usize
) -> SmartHierarchicalTable<Self::ChildTableType>
Panics, a page table has no children.