feat(kernel): add WaitForInterrupt, AcknowledgeInterrupt, and WaitAny syscalls
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user