feat(kernel): add WaitForInterrupt, AcknowledgeInterrupt, and WaitAny syscalls

This commit is contained in:
2026-10-18 00:26:11 +02:00
parent e7835c0435
commit 8912a944b8
4 changed files with 260 additions and 5 deletions

View File

@@ -11,6 +11,28 @@ pub struct WaitSet {
interrupts: [Option<CapSlot>; 4],
}
impl WaitSet {
pub fn new(
endpoints: [Option<CapSlot>; 4],
interrupts: [Option<CapSlot>; 4],
) -> Self {
Self { endpoints, interrupts }
}
pub fn endpoints(&self) -> &[Option<CapSlot>; 4] {
&self.endpoints
}
pub fn interrupts(&self) -> &[Option<CapSlot>; 4] {
&self.interrupts
}
pub fn is_empty(&self) -> bool {
self.endpoints.iter().all(|s| s.is_none())
&& self.interrupts.iter().all(|s| s.is_none())
}
}
pub enum WakeReason {
MessageReady(CapSlot),
InterruptFired(CapSlot),