diff --git a/nucleus/src/arch/aarch64/memory/features.rs b/nucleus/src/arch/aarch64/memory/features.rs index fd93aa3..7dd4412 100644 --- a/nucleus/src/arch/aarch64/memory/features.rs +++ b/nucleus/src/arch/aarch64/memory/features.rs @@ -1,3 +1,5 @@ +//! Print MMU suported features for debugging. + use { crate::println, cortex_a::regs::{RegisterReadOnly, RegisterReadWrite, ID_AA64MMFR0_EL1, SCTLR_EL1, TCR_EL1}, diff --git a/nucleus/src/arch/aarch64/memory/mmu.rs b/nucleus/src/arch/aarch64/memory/mmu.rs index a63820d..ab310c6 100644 --- a/nucleus/src/arch/aarch64/memory/mmu.rs +++ b/nucleus/src/arch/aarch64/memory/mmu.rs @@ -282,6 +282,7 @@ pub trait HierarchicalLevel: TableLevel { // fn translate() -> Directory; } +/// Specify allowed page size for each level. pub trait HierarchicalPageLevel: TableLevel { /// Size of the page that can be contained in this table level. type PageLevel: PageSize; @@ -479,9 +480,11 @@ where /// Errors from mapping layer #[derive(Debug, Snafu)] pub enum TranslationError { + /// No page found. @todo NoPage, } +/// Virtual address space. @todo pub struct VirtSpace { l0: Unique>, } diff --git a/nucleus/src/arch/aarch64/memory/mod.rs b/nucleus/src/arch/aarch64/memory/mod.rs index 12dbef9..22cb456 100644 --- a/nucleus/src/arch/aarch64/memory/mod.rs +++ b/nucleus/src/arch/aarch64/memory/mod.rs @@ -29,9 +29,11 @@ pub use addr::VirtAddr; pub use page_size::PageSize; pub use phys_frame::PhysFrame; -// @todo ?? +/// @todo ?? pub trait FrameAllocator { + /// Allocate a physical memory frame. fn allocate_frame(&mut self) -> Option; // @todo Result<> + /// Deallocate a physical frame. fn deallocate_frame(&mut self, frame: PhysFrame); }