From adfd26ee11cf0ab6034b0ba996333588fca1a5ad Mon Sep 17 00:00:00 2001 From: Nick Spinale Date: Tue, 5 Mar 2024 08:33:10 +0000 Subject: [PATCH] crates/sel4-capdl-initializer: Fix bug Use correct endpoint for fault EP on MCS Signed-off-by: Nick Spinale --- crates/sel4-capdl-initializer/core/src/lib.rs | 2 +- crates/sel4-capdl-initializer/types/src/cap_table.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/sel4-capdl-initializer/core/src/lib.rs b/crates/sel4-capdl-initializer/core/src/lib.rs index dbd4ec27f..6d29e2b59 100644 --- a/crates/sel4-capdl-initializer/core/src/lib.rs +++ b/crates/sel4-capdl-initializer/core/src/lib.rs @@ -652,7 +652,7 @@ impl<'a, N: ObjectName, D: Content, M: GetEmbeddedFrame, B: BorrowMut<[PerObject Some(cap) => self.orig_cap::(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::(), Some(cap) => { let orig = self.orig_cap::(cap.object); diff --git a/crates/sel4-capdl-initializer/types/src/cap_table.rs b/crates/sel4-capdl-initializer/types/src/cap_table.rs index f8946eee7..5539f8692 100644 --- a/crates/sel4-capdl-initializer/types/src/cap_table.rs +++ b/crates/sel4-capdl-initializer/types/src/cap_table.rs @@ -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; @@ -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) }