rCore-Tutorial-v3/os/src/mm/mod.rs

27 lines
686 B
Rust
Raw Normal View History

mod heap_allocator;
2020-12-03 06:40:30 +04:00
mod address;
mod frame_allocator;
2020-12-04 13:23:35 +04:00
mod page_table;
mod memory_set;
2020-12-04 13:23:35 +04:00
use page_table::{PageTable, PTEFlags};
2020-12-16 06:18:38 +04:00
use address::VPNRange;
pub use address::{PhysAddr, VirtAddr, PhysPageNum, VirtPageNum, StepByOne};
pub use frame_allocator::{FrameTracker, frame_alloc, frame_dealloc,};
2020-12-10 07:57:26 +04:00
pub use page_table::{
PageTableEntry,
translated_byte_buffer,
translated_str,
translated_refmut,
2020-12-13 11:07:19 +04:00
UserBuffer,
UserBufferIterator,
2020-12-10 07:57:26 +04:00
};
pub use memory_set::{MemorySet, KERNEL_SPACE, MapPermission};
2020-12-04 13:23:35 +04:00
pub use memory_set::remap_test;
2020-12-03 06:40:30 +04:00
pub fn init() {
heap_allocator::init_heap();
frame_allocator::init_frame_allocator();
2020-12-04 13:23:35 +04:00
KERNEL_SPACE.clone().lock().activate();
2020-12-03 06:40:30 +04:00
}