pub trait Hal {
// Required methods
fn dma_alloc(pages: usize) -> usize;
fn dma_dealloc(paddr: usize, pages: usize) -> i32;
fn phys_to_virt(paddr: usize) -> usize;
fn virt_to_phys(vaddr: usize) -> usize;
}Expand description
The interface which a particular hardware implementation must implement.
Required Methods§
Sourcefn dma_alloc(pages: usize) -> usize
fn dma_alloc(pages: usize) -> usize
Allocates the given number of contiguous physical pages of DMA memory for virtio use.
Sourcefn dma_dealloc(paddr: usize, pages: usize) -> i32
fn dma_dealloc(paddr: usize, pages: usize) -> i32
Deallocates the given contiguous physical DMA memory pages.
Sourcefn phys_to_virt(paddr: usize) -> usize
fn phys_to_virt(paddr: usize) -> usize
Converts a physical address used for virtio to a virtual address which the program can access.
Sourcefn virt_to_phys(vaddr: usize) -> usize
fn virt_to_phys(vaddr: usize) -> usize
Converts a virtual address which the program can access to the corresponding physical address to use for virtio.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.