Skip to content

Commit

Permalink
Add TCB_SetSpace invocation
Browse files Browse the repository at this point in the history
Signed-off-by: Alwin Joshy <[email protected]>
  • Loading branch information
alwin-joshy authored and nspin committed May 10, 2024
1 parent 6a15043 commit 09708cd
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions crates/sel4/src/invocations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@ use core::mem;
use sel4_config::{sel4_cfg, sel4_cfg_if};

use crate::{
cap::*, sys, AbsoluteCPtr, CNodeCapData, CapRights, Error, InvocationContext, ObjectBlueprint,
Result, UserContext, Word,
cap::*, ipc_buffer, sys, AbsoluteCPtr, CNodeCapData, CPtr, CapRights, Error, InvocationContext,
ObjectBlueprint, Result, UserContext, Word,
};

#[sel4_cfg(KERNEL_MCS)]
use crate::Badge;

#[sel4_cfg(not(KERNEL_MCS))]
use crate::CPtr;

/// Corresponds to `seL4_Time`.
#[sel4_cfg(KERNEL_MCS)]
pub type Time = u64;
Expand Down Expand Up @@ -159,6 +156,26 @@ impl<C: InvocationContext> Tcb<C> {
}
}

/// Corresponds to `seL4_TCB_SetSpace`.
pub fn tcb_set_space(
self,
fault_ep: CPtr,
cspace_root: CNode,
cspace_root_data: CNodeCapData,
vspace_root: VSpace,
) -> Result<()> {
Error::wrap(self.invoke(|cptr, ipc_buffer| {
ipc_buffer.inner_mut().seL4_TCB_SetSpace(
cptr.bits(),
fault_ep.bits(),
cspace_root.bits(),
cspace_root_data.into_word(),
vspace_root.bits(),
0, /* HACK */
)
}))
}

sel4_cfg_if! {
if #[sel4_cfg(KERNEL_MCS)] {
/// Corresponds to `seL4_TCB_SetSchedParams`.
Expand Down

0 comments on commit 09708cd

Please sign in to comment.