KernelFunc

Trait KernelFunc 

Source
pub trait KernelFunc {
    const PAGE_SIZE: usize = 4_096usize;

    // Required methods
    fn dma_alloc_coherent(&mut self, pages: usize) -> (usize, usize);
    fn dma_free_coherent(&mut self, vaddr: usize, pages: usize);
}
Expand description

Kernel functions that drivers must use

Provided Associated Constants§

Source

const PAGE_SIZE: usize = 4_096usize

Page size (usually 4K)

Required Methods§

Source

fn dma_alloc_coherent(&mut self, pages: usize) -> (usize, usize)

或请求分配irq Allocate consequent physical memory for DMA; Return (cpu virtual address, dma physical address) which is page aligned.

Source

fn dma_free_coherent(&mut self, vaddr: usize, pages: usize)

Deallocate DMA memory by virtual address

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.

Implementors§