Skip to content

Commit 7dbba7a

Browse files
sel4-capdl-initializer: lazy SC rebind for passive
Implements lazy Scheduling Context rebind for passive tasks inside the capDL initialiser. Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
1 parent e1fe22b commit 7dbba7a

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

crates/sel4-capdl-initializer/src/initialize.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,18 @@ impl<'a> Initializer<'a> {
833833
)?;
834834

835835
tcb.tcb_set_timeout_endpoint(temp_fault_ep)?;
836+
837+
if obj.extra.passive {
838+
if obj.sc().is_none() {
839+
panic!("A passive task must have its own Scheduling Context.");
840+
}
841+
if obj.bound_notification().is_none() {
842+
panic!("A passive task must have its own Notification.");
843+
}
844+
let bound_notification_cap =
845+
self.orig_cap::<cap_type::Notification>(obj.bound_notification().unwrap().object);
846+
sc.bind_ntfn(bound_notification_cap)?;
847+
}
836848
} else {
837849
let fault_ep = sel4::CPtr::from_bits(obj.extra.master_fault_ep.as_ref().unwrap().to_sel4());
838850

crates/sel4-capdl-initializer/types/src/spec.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,8 @@ pub mod object {
429429
pub gprs: Vec<Word>,
430430

431431
pub master_fault_ep: Option<Word>,
432+
433+
pub passive: bool,
432434
}
433435

434436
#[derive(Debug, Clone, Eq, PartialEq, IsObject, HasCapTable)]

0 commit comments

Comments
 (0)