Skip to content

Commit

Permalink
crates/sel4-capdl-initializer: Fix bug
Browse files Browse the repository at this point in the history
Use correct endpoint for fault EP on MCS

Signed-off-by: Nick Spinale <[email protected]>
  • Loading branch information
nspin committed Mar 5, 2024
1 parent f4d0c2d commit adfd26e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/sel4-capdl-initializer/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ impl<'a, N: ObjectName, D: Content, M: GetEmbeddedFrame, B: BorrowMut<[PerObject
Some(cap) => self.orig_cap::<cap_type::SchedContext>(cap.object),
};

let fault_ep = match obj.temp_fault_ep() {
let fault_ep = match obj.mcs_fault_ep() {
None => init_thread::slot::NULL.cap().cast::<cap_type::Endpoint>(),
Some(cap) => {
let orig = self.orig_cap::<cap_type::Endpoint>(cap.object);
Expand Down
5 changes: 5 additions & 0 deletions crates/sel4-capdl-initializer/types/src/cap_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ impl<'a> object::Tcb<'a> {
pub const SLOT_CSPACE: CapSlot = 0;
pub const SLOT_VSPACE: CapSlot = 1;
pub const SLOT_IPC_BUFFER: CapSlot = 4;
pub const SLOT_FAULT_EP: CapSlot = 5;
pub const SLOT_SC: CapSlot = 6;
pub const SLOT_TEMP_FAULT_EP: CapSlot = 7;
pub const SLOT_BOUND_NOTIFICATION: CapSlot = 8;
Expand All @@ -71,6 +72,10 @@ impl<'a> object::Tcb<'a> {
self.slot_as(Self::SLOT_IPC_BUFFER)
}

pub fn mcs_fault_ep(&self) -> Option<&cap::Endpoint> {
self.maybe_slot_as(Self::SLOT_FAULT_EP)
}

pub fn sc(&self) -> Option<&cap::SchedContext> {
self.maybe_slot_as(Self::SLOT_SC)
}
Expand Down

0 comments on commit adfd26e

Please sign in to comment.