pub fn kernel_allocate_physical(
    size: usize,
    paddr: PhysAddr,
    mmu_flags: MMUFlags,
    cache_policy: CachePolicy,
) -> ZxResult<VirtAddr> {
    if !page_aligned(paddr) {
        return Err(ZxError::INVALID_ARGS);
    }
    let size = roundup_pages(size);
    let vmo = VmObject::new_physical(paddr, pages(size));
    vmo.set_cache_policy(cache_policy)?;
    let flags = mmu_flags - MMUFlags::CACHE_1 - MMUFlags::CACHE_2;
    KERNEL_ASPACE.map(None, vmo, 0, size, flags)
}
/// Allocate memory in kernel address space at given physical address.
Allocate memory in kernel address space at given physical address.
Allocate memory in kernel address space at given physical address .
pub fn kernel_allocate_physical(
    size: usize,
    paddr: PhysAddr,
    mmu_flags: MMUFlags,
    cache_policy: CachePolicy,
) -> ZxResult<VirtAddr> {
    if !page_aligned(paddr) {
        return Err(ZxError::INVALID_ARGS);
    }
    let size = roundup_pages(size);
    let vmo = VmObject::new_physical(paddr, pages(size));
    vmo.set_cache_policy(cache_policy)?;
    let flags = mmu_flags - MMUFlags::CACHE_1 - MMUFlags::CACHE_2;
    KERNEL_ASPACE.map(None, vmo, 0, size, flags)
}
pub fn kernel_allocate_physical ( size : usize , paddr : PhysAddr , mmu_flags : MMUFlags , cache_policy : CachePolicy , ) -> ZxResult < VirtAddr > { if ! page_aligned ( paddr ) { return Err ( ZxError :: INVALID_ARGS ) ; } let size = roundup_pages ( size ) ; let vmo = VmObject :: new_physical ( paddr , pages ( size ) ) ; vmo . set_cache_policy ( cache_policy ) ? ; let flags = mmu_flags - MMUFlags :: CACHE_1 - MMUFlags :: CACHE_2 ; KERNEL_ASPACE . map ( None , vmo , 0 , size , flags ) }
Allocate memory in kernel address space at given physical address.
Allocate memory in kernel address space at given physical address .
size
usize
paddr
PhysAddr
mmu_flags
MMUFlags
cache_policy
CachePolicy
size
usize
paddr
PhysAddr
mmu_flags
MMUFlags
cache_policy
CachePolicy