Implement domain and endpoint modules with capability management, message passing, and scheduling features
This commit is contained in:
64
crates/domain/src/syscall.rs
Normal file
64
crates/domain/src/syscall.rs
Normal file
@@ -0,0 +1,64 @@
|
||||
use types::{
|
||||
address::{DataRef, EntryPoint, StackPointer, VirtualAddress},
|
||||
bounded::{CapSlot, PageCount},
|
||||
permission::PermissionSet,
|
||||
};
|
||||
|
||||
use crate::message::Message;
|
||||
|
||||
pub struct WaitSet {
|
||||
endpoints: [Option<CapSlot>; 4],
|
||||
interrupts: [Option<CapSlot>; 4],
|
||||
}
|
||||
|
||||
pub enum WakeReason {
|
||||
MessageReady(CapSlot),
|
||||
InterruptFired(CapSlot),
|
||||
}
|
||||
|
||||
pub enum Syscall {
|
||||
Send {
|
||||
endpoint: CapSlot,
|
||||
message: Message,
|
||||
},
|
||||
Receive {
|
||||
endpoint: CapSlot,
|
||||
},
|
||||
Delegate {
|
||||
slot: CapSlot,
|
||||
to_endpoint: CapSlot,
|
||||
permissions: PermissionSet,
|
||||
},
|
||||
WaitForInterrupt {
|
||||
irq: CapSlot,
|
||||
},
|
||||
AcknowledgeInterrupt {
|
||||
irq: CapSlot,
|
||||
},
|
||||
WaitAny {
|
||||
sources: WaitSet,
|
||||
},
|
||||
CreateProcess {
|
||||
create_cap: CapSlot,
|
||||
image: DataRef,
|
||||
},
|
||||
Kill {
|
||||
process: CapSlot,
|
||||
},
|
||||
SpawnThread {
|
||||
entry: EntryPoint,
|
||||
stack: StackPointer,
|
||||
},
|
||||
ExitThread,
|
||||
RequestPages {
|
||||
count: PageCount,
|
||||
},
|
||||
ReleasePages {
|
||||
addr: VirtualAddress,
|
||||
count: PageCount,
|
||||
},
|
||||
GetTime,
|
||||
GetProcessId,
|
||||
Yield,
|
||||
Exit,
|
||||
}
|
||||
Reference in New Issue
Block a user