pub fn new_contiguous(pages: usize, align_log2: usize) -> ZxResult<Arc<Self>> {
        let vmo = Self::new(pages);
        let mut frames = PhysFrame::new_contiguous(pages, align_log2 - PAGE_SIZE_LOG2);
        if frames.is_empty() {
            return Err(ZxError::NO_MEMORY);
        }
        {
            let (_guard, mut inner) = vmo.get_inner_mut();
            inner.contiguous = true;
            for (i, f) in frames.drain(0..).enumerate() {
                kernel_hal::mem::pmem_zero(f.paddr(), PAGE_SIZE);
                let mut state = PageState::new(f);
                state.pin_count += 1;
                inner.frames.insert(i, state);
            }
        }
        Ok(vmo)
    }
/// Create a new VMO backing on contiguous pages.
Create a new VMO backing on contiguous pages.
Create a new VMO backing on contiguous pages .
pub fn new_contiguous(pages: usize, align_log2: usize) -> ZxResult<Arc<Self>> {
        let vmo = Self::new(pages);
        let mut frames = PhysFrame::new_contiguous(pages, align_log2 - PAGE_SIZE_LOG2);
        if frames.is_empty() {
            return Err(ZxError::NO_MEMORY);
        }
        {
            let (_guard, mut inner) = vmo.get_inner_mut();
            inner.contiguous = true;
            for (i, f) in frames.drain(0..).enumerate() {
                kernel_hal::mem::pmem_zero(f.paddr(), PAGE_SIZE);
                let mut state = PageState::new(f);
                state.pin_count += 1;
                inner.frames.insert(i, state);
            }
        }
        Ok(vmo)
    }
pub fn new_contiguous ( pages : usize , align_log2 : usize ) -> ZxResult < Arc < Self > > { let vmo = Self :: new ( pages ) ; let mut frames = PhysFrame :: new_contiguous ( pages , align_log2 - PAGE_SIZE_LOG2 ) ; if frames . is_empty ( ) { return Err ( ZxError :: NO_MEMORY ) ; } { let ( _guard , mut inner ) = vmo . get_inner_mut ( ) ; inner . contiguous = true ; for ( i , f ) in frames . drain ( 0 .. ) . enumerate ( ) { kernel_hal :: mem :: pmem_zero ( f . paddr ( ) , PAGE_SIZE ) ; let mut state = PageState :: new ( f ) ; state . pin_count += 1 ; inner . frames . insert ( i , state ) ; } } Ok ( vmo ) }
Create a new VMO backing on contiguous pages.
Create a new VMO backing on contiguous pages .
pages
usize
align_log2
usize
pages
usize
align_log2
usize