refactor(kernel): split ipc/memory/lib/thread by concern; trim comments

This commit is contained in:
2026-10-27 13:21:53 +01:00
parent b814bd9570
commit 95dbe7b9d5
34 changed files with 1239 additions and 1231 deletions

View File

@@ -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);