fn create_next_table<'b, A>(
        &self,
        entry: &'b mut PageTableEntry,
        allocator: &mut A,
    ) -> Result<&'b mut PageTable, PageTableCreateError>
    where
        A: FrameAllocator<Size4KiB>,
    {
        let created;

        if entry.is_unused() {
            if let Some(frame) = allocator.allocate_frame() {
                entry.set_frame(
                    frame,
                    PageTableFlags::default_table(),
                    PageTableAttribute::new(0, 0, 0),
                );
                created = true;
            } else {
                return Err(PageTableCreateError::FrameAllocationFailed);
            }
        } else {
            created = false;
        }

        let page_table = match self.next_table_mut(entry) {
            Err(PageTableWalkError::MappedToHugePage) => {
                Err(PageTableCreateError::MappedToHugePage)?
            }
            Err(PageTableWalkError::NotMapped) => panic!("entry should be mapped at this point"),
            Ok(page_table) => page_table,
        };

        if created {
            #[cfg(target_arch = "aarch64")]
            unsafe {
                crate::barrier::dsb(crate::barrier::ISHST);
            }
            page_table.zero();
        }
        Ok(page_table)
    }
/// Internal helper function to create the page table of the next level if needed.
///
/// If the passed entry is unused, a new frame is allocated from the given allocator, zeroed,
/// and the entry is updated to that address. If the passed entry is already mapped, the next
/// table is returned directly.
///
/// Returns `MapToError::FrameAllocationFailed` if the entry is unused and the allocator
/// returned `None`. Returns `MapToError::ParentEntryHugePage` if the `HUGE_PAGE` flag is set
/// in the passed entry.
Internal helper function to create the page table of the next level if needed.
If the passed entry is unused, a new frame is allocated from the given allocator, zeroed,
and the entry is updated to that address. If the passed entry is already mapped, the next
table is returned directly.

Returns `MapToError::FrameAllocationFailed` if the entry is unused and the allocator
returned `None`. Returns `MapToError::ParentEntryHugePage` if the `HUGE_PAGE` flag is set
in the passed entry.
Internal helper function to create the page table of the next level if needed . If the passed entry is unused a new frame is allocated from the given allocator zeroed and the entry is updated to that address . If the passed entry is already mapped the next table is returned directly . Returns ` MapToError :: FrameAllocationFailed ` if the entry is unused and the allocator returned ` None ` . Returns ` MapToError :: ParentEntryHugePage ` if the ` HUGE_PAGE ` flag is set in the passed entry .
fn create_next_table<'b, A>(
        &self,
        entry: &'b mut PageTableEntry,
        allocator: &mut A,
    ) -> Result<&'b mut PageTable, PageTableCreateError>
    where
        A: FrameAllocator<Size4KiB>,
    {
        let created;
        if entry.is_unused() {
            if let Some(frame) = allocator.allocate_frame() {
                entry.set_frame(
                    frame,
                    PageTableFlags::default_table(),
                    PageTableAttribute::new(0, 0, 0),
                );
                created = true;
            } else {
                return Err(PageTableCreateError::FrameAllocationFailed);
            }
        } else {
            created = false;
        }
        let page_table = match self.next_table_mut(entry) {
            Err(PageTableWalkError::MappedToHugePage) => {
                Err(PageTableCreateError::MappedToHugePage)?
            }
            Err(PageTableWalkError::NotMapped) => panic!("entry should be mapped at this point"),
            Ok(page_table) => page_table,
        };
        if created {
            #[cfg(target_arch = "aarch64")]
            unsafe {
                crate::barrier::dsb(crate::barrier::ISHST);
            }
            page_table.zero();
        }
        Ok(page_table)
    }
fn create_next_table < ' b , A > ( & self , entry : & ' b mut PageTableEntry , allocator : & mut A , ) -> Result < & ' b mut PageTable , PageTableCreateError > where A : FrameAllocator < Size4KiB > , { let created ; if entry . is_unused ( ) { if let Some ( frame ) = allocator . allocate_frame ( ) { entry . set_frame ( frame , PageTableFlags :: default_table ( ) , PageTableAttribute :: new ( 0 , 0 , 0 ) , ) ; created = true ; } else { return Err ( PageTableCreateError :: FrameAllocationFailed ) ; } } else { created = false ; } let page_table = match self . next_table_mut ( entry ) { Err ( PageTableWalkError :: MappedToHugePage ) => { Err ( PageTableCreateError :: MappedToHugePage ) ? } Err ( PageTableWalkError :: NotMapped ) => panic ! ( " " ) , Ok ( page_table ) => page_table , } ; if created { # [ cfg ( target_arch " " ) ] unsafe { crate :: barrier :: dsb ( crate :: barrier :: ISHST ) ; } page_table . zero ( ) ; } Ok ( page_table ) }
Internal helper function to create the page table of the next level if needed.
Internal helper function to create the page table of the next level if needed .
&self
entry
&'b mut PageTableEntry
allocator
&mut A