Skip to content

Commit d20b04c

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 990e954 commit d20b04c

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

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

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

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

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)