feat: implement configure_protection and map_shared with real page mapping, remove dead context_switch from Platform trait

This commit is contained in:
2026-10-18 02:39:36 +02:00
parent 7724a5bd0a
commit 896c78088a
5 changed files with 31 additions and 25 deletions

View File

@@ -1,6 +1,6 @@
#![no_std]
use domain::{memory::MemoryRegion, thread::SavedContext};
use domain::memory::MemoryRegion;
use types::{
address::{EntryPoint, PhysicalAddress, StackPointer},
bounded::PageCount,
@@ -9,11 +9,8 @@ use types::{
time::{Ticks, TimerDuration},
};
pub trait PlatformContext: Copy + Default {}
pub trait Platform {
fn configure_protection(&mut self, process: ProcessId, regions: &[MemoryRegion]);
fn context_switch(&mut self, from: &mut SavedContext, to: &SavedContext);
fn enable_user_mode(&mut self, entry: EntryPoint, stack: StackPointer) -> !;
fn set_timer(&mut self, duration: TimerDuration);
fn current_ticks(&self) -> Ticks;