Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions crates/sel4-capdl-initializer/src/initialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,8 @@ impl<'a> Initializer<'a> {
let max_prio = obj.extra.max_prio.into();
let prio = obj.extra.prio.into();

let fpu = obj.extra.fpu.into();

#[allow(unused_variables)]
let affinity = obj.extra.affinity.to_sel4();

Expand Down Expand Up @@ -806,6 +808,11 @@ impl<'a> Initializer<'a> {
fault_ep,
)?;

tcb.tcb_set_flags(
0,
fpu,
);

tcb.tcb_set_timeout_endpoint(temp_fault_ep)?;
} else {
let fault_ep = sel4::CPtr::from_bits(obj.extra.master_fault_ep.as_ref().unwrap().to_sel4());
Expand All @@ -825,6 +832,11 @@ impl<'a> Initializer<'a> {
prio,
)?;

tcb.tcb_set_flags(
0,
fpu,
);

sel4::sel4_cfg_if! {
if #[sel4_cfg(not(MAX_NUM_NODES = "1"))] {
tcb.tcb_set_affinity(affinity)?;
Expand Down
1 change: 1 addition & 0 deletions crates/sel4-capdl-initializer/types/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ pub mod object {
pub affinity: Word,
pub prio: u8,
pub max_prio: u8,
pub fpu: bool,
pub resume: bool,

pub ip: Word,
Expand Down
10 changes: 10 additions & 0 deletions crates/sel4/src/invocations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use core::mem;

use sel4_config::{sel4_cfg, sel4_cfg_if};
use sel4_sys::seL4_TCB_SetFlags_ret;

use crate::{
AbsoluteCPtr, CNodeCapData, CPtr, CapRights, Error, InvocationContext, ObjectBlueprint, Result,
Expand Down Expand Up @@ -124,6 +125,15 @@ impl<C: InvocationContext> Tcb<C> {
}))
}

// Corresponds to `seL4_TCB_SetFlags`.
pub fn tcb_set_flags(self, clear: Word, set: Word) -> seL4_TCB_SetFlags_ret {
self.invoke(|cptr, ipc_buffer| {
ipc_buffer
.inner_mut()
.seL4_TCB_SetFlags(cptr.bits(), clear, set)
})
}

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