pub trait Hal {
    fn dma_alloc(pages: usize) -> PhysAddr;
    fn dma_dealloc(paddr: PhysAddr, pages: usize) -> i32;
    fn phys_to_virt(paddr: PhysAddr) -> VirtAddr;
    fn virt_to_phys(vaddr: VirtAddr) -> PhysAddr;
}
Expand description

The interface which a particular hardware implementation must implement.

Required Methods

Allocates the given number of contiguous physical pages of DMA memory for virtio use.

Deallocates the given contiguous physical DMA memory pages.

Converts a physical address used for virtio to a virtual address which the program can access.

Converts a virtual address which the program can access to the corresponding physical address to use for virtio.

Implementors