# mod.rs - source
Source of the Rust file `src/mm/mod.rs`.
Keywords: rust, rustlang, rust-lang

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19

    mod address;
    mod frame_allocator;
    mod heap_allocator;
    mod memory_set;
    mod page_table;

    pub use address::{PhysAddr, PhysPageNum, VirtAddr, VirtPageNum};
    use address::{StepByOne, VPNRange};
    pub use frame_allocator::{frame_alloc, FrameTracker};
    pub use memory_set::remap_test;
    pub use memory_set::{MapPermission, MemorySet, KERNEL_SPACE};
    pub use page_table::{translated_byte_buffer, translated_refmut, translated_str, PageTableEntry};
    use page_table::{PTEFlags, PageTable};

    pub fn init() {
        heap_allocator::init_heap();
        frame_allocator::init_frame_allocator();
        KERNEL_SPACE.exclusive_access().activate();
    }