/// Constructs an identity map but with an offset added to the region.
///
/// This can be useful for example to map physical memory above `KERNEL_BASE`.
Constructs an identity map but with an offset added to the region.
This can be useful for example to map physical memory above `KERNEL_BASE`.
Constructs an identity map but with an offset added to the region . This can be useful for example to map physical memory above ` KERNEL_BASE ` .
pub(crate) fn map_identity_with_offset(
        &mut self,
        at_offset: PAddr,
        pbase: PAddr,
        size: usize,
        rights: MapAction,
    ) -> Result<(), KError> {
        assert!(at_offset.is_base_page_aligned());
        assert!(pbase.is_base_page_aligned());
        assert_eq!(size % BASE_PAGE_SIZE, 0, "Size not a multiple of page-size");
        let vbase = VAddr::from_u64((at_offset + pbase).as_u64());
        debug!(
            "map_identity_with_offset {:#x} -- {:#x} -> {:#x} -- {:#x}",
            vbase,
            vbase + size,
            pbase,
            pbase + size
        );
        self.map_generic(vbase, (pbase, size), rights, true)
    }
pub ( crate ) fn map_identity_with_offset ( & mut self , at_offset : PAddr , pbase : PAddr , size : usize , rights : MapAction , ) -> Result < ( ) , KError > { assert ! ( at_offset is_base_page_aligned ( ) ) ; assert ! ( pbase is_base_page_aligned ( ) ) ; assert_eq ! ( size BASE_PAGE_SIZE 0 " " ) ; let vbase = VAddr :: from_u64 ( ( at_offset + pbase ) . as_u64 ( ) ) ; debug ! ( " " vbase vbase size pbase pbase size ) ; self . map_generic ( vbase , ( pbase , size ) , rights , true ) }
Constructs an identity map but with an offset added to the region.
Constructs an identity map but with an offset added to the region .
&mut self
at_offset
PAddr
pbase
PAddr
size
usize
rights
MapAction