Function memory::create_mapping

source ·
pub fn create_mapping<F: Into<PteFlagsArch>>(
    size_in_bytes: usize,
    flags: F
) -> Result<MappedPages, &'static str>
Expand description

A convenience function that creates a new memory mapping. The pages allocated are contiguous in memory but there’s no guarantee that the frames they are mapped to are also contiguous in memory. If contiguous frames are required then see create_contiguous_mapping(). Returns the new MappedPages.

Locking / Deadlock

Currently, this function acquires the lock on the kernel’s MemoryManagementInfo instance. Thus, the caller should ensure that lock is not held when invoking this function.