refactor(kernel): split ipc/memory/lib/thread by concern; trim comments
This commit is contained in:
@@ -26,9 +26,7 @@ pub enum MapError {
|
||||
/// The kernel's contract with an architecture. The kernel decides what is
|
||||
/// mapped where; the platform only applies those decisions to hardware.
|
||||
pub trait Platform {
|
||||
/// User mappings live in `[USER_VA_START, USER_VA_END)`. The platform
|
||||
/// guarantees nothing else is mapped in that window in any address
|
||||
/// space, so page tables covering it are private to each process.
|
||||
/// User mappings live in `[USER_VA_START, USER_VA_END)`; nothing else is mapped there in any space.
|
||||
const USER_VA_START: usize;
|
||||
const USER_VA_END: usize;
|
||||
|
||||
@@ -50,9 +48,7 @@ pub trait Platform {
|
||||
) -> Result<(), MapError>;
|
||||
/// Removes the mapping at `va` and flushes it from the TLB.
|
||||
fn unmap_page(&mut self, process: ProcessId, va: VirtualAddress);
|
||||
/// The frame `va` is mapped to in `process`, if any. Only a lookup:
|
||||
/// the kernel confirms every answer against its own frame table, so a
|
||||
/// wrong answer can make the kernel refuse but never trust a frame.
|
||||
/// The frame `va` maps to in `process`, if any. Advisory: the kernel confirms against its frame table.
|
||||
fn translate(&self, process: ProcessId, va: VirtualAddress) -> Option<PhysicalAddress>;
|
||||
/// Fills a frame with zeros before it is handed to a process.
|
||||
fn zero_frame(&mut self, pa: PhysicalAddress);
|
||||
|
||||
Reference in New Issue
Block a user