Skip to main content

TableMemory

Trait TableMemory 

Source
pub trait TableMemory {
    // Required methods
    fn alloc_table(&mut self) -> Option<u64>;
    fn free_table(&mut self, table: u64);
    fn read_entry(&self, table: u64, index: usize) -> u64;
    fn write_entry(&mut self, table: u64, index: usize, value: u64);
}
Expand description

Memory provider for the tables (allocation, read, write).

The kernel implements this trait by allocating frames and going through the HHDM; the tests use a host-memory table. Each handle (table) identifies a table of 512 8-byte entries.

Required Methods§

Source

fn alloc_table(&mut self) -> Option<u64>

Allocates a zeroed table and returns its handle (physical identifier).

Source

fn free_table(&mut self, table: u64)

Frees a previously allocated table.

Source

fn read_entry(&self, table: u64, index: usize) -> u64

Reads entry index of the table.

Source

fn write_entry(&mut self, table: u64, index: usize, value: u64)

Writes entry index of the table.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§