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§
Sourcefn alloc_table(&mut self) -> Option<u64>
fn alloc_table(&mut self) -> Option<u64>
Allocates a zeroed table and returns its handle (physical identifier).
Sourcefn free_table(&mut self, table: u64)
fn free_table(&mut self, table: u64)
Frees a previously allocated table.
Sourcefn read_entry(&self, table: u64, index: usize) -> u64
fn read_entry(&self, table: u64, index: usize) -> u64
Reads entry index of the table.
Sourcefn write_entry(&mut self, table: u64, index: usize, value: u64)
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".