pub fn try_handle_page_fault(
        &mut self,
        mapping: &mut ActiveMapping,
        fault_addr: VirtAddr,
    ) -> bool {
        if likely(self.is_contained(fault_addr)) {
            let flags = self.flags();
            let map_addr = fault_addr.align_down();

            // After the mapping is successful, we need to clear the memory to avoid information leaks.
            if mapping.get_and_map_single(map_addr, flags).is_ok() {
                let ptr: *mut u8 = map_addr.as_mut();
                // Safe because valid pointer and valid size.
                unsafe {
                    page_clear(ptr);
                }

                return true;
            }
        }

        false
    }
/// Try handle a page fault.
Try handle a page fault.
Try handle a page fault .
pub fn try_handle_page_fault(
        &mut self,
        mapping: &mut ActiveMapping,
        fault_addr: VirtAddr,
    ) -> bool {
        if likely(self.is_contained(fault_addr)) {
            let flags = self.flags();
            let map_addr = fault_addr.align_down();
            // After the mapping is successful, we need to clear the memory to avoid information leaks.
            if mapping.get_and_map_single(map_addr, flags).is_ok() {
                let ptr: *mut u8 = map_addr.as_mut();
                // Safe because valid pointer and valid size.
                unsafe {
                    page_clear(ptr);
                }
                return true;
            }
        }
        false
    }
pub fn try_handle_page_fault ( & mut self , mapping : & mut ActiveMapping , fault_addr : VirtAddr , ) -> bool { if likely ( self . is_contained ( fault_addr ) ) { let flags = self . flags ( ) ; let map_addr = fault_addr . align_down ( ) ; // After the mapping is successful, we need to clear the memory to avoid information leaks. if mapping . get_and_map_single ( map_addr , flags ) . is_ok ( ) { let ptr : * mut u8 = map_addr . as_mut ( ) ; // Safe because valid pointer and valid size. unsafe { page_clear ( ptr ) ; } return true ; } } false }
Try handle a page fault.
Try handle a page fault .
&mut self
mapping
&mut ActiveMapping
fault_addr
VirtAddr
&mut self
mapping
&mut ActiveMapping
fault_addr
VirtAddr