Implement domain and endpoint modules with capability management, message passing, and scheduling features
This commit is contained in:
@@ -1,14 +1,23 @@
|
||||
pub fn add(left: u64, right: u64) -> u64 {
|
||||
left + right
|
||||
}
|
||||
#![no_std]
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use domain::{resource::MemoryRegion, thread::SavedContext};
|
||||
use types::{
|
||||
address::{EntryPoint, StackPointer},
|
||||
id::{CoreId, IrqId, ProcessId},
|
||||
time::{Ticks, TimerDuration},
|
||||
};
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
let result = add(2, 2);
|
||||
assert_eq!(result, 4);
|
||||
}
|
||||
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;
|
||||
fn mask_irq(&mut self, irq: IrqId);
|
||||
fn unmask_irq(&mut self, irq: IrqId);
|
||||
fn send_ipi(&mut self, target: CoreId);
|
||||
fn core_id(&self) -> CoreId;
|
||||
fn num_cores(&self) -> u8;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user