pub struct SchedTaskMemory<const STACK_U64S: usize, const TCB_U64S: usize = nros_node::::executor::backing::SchedTaskMemory::{constant#0}> { /* private fields */ }Expand description
Each spawned sched task’s TASK memory (stack + control block):
nros::main! emits one SchedTaskMemory static per spawned sched task, sized from
its stack_bytes, and hands the SchedTaskMemorySet rows to a board whose
sched task runner creates the task over them (FreeRTOS xTaskCreateStatic).
One spawned sched task’s stack and control block, as ONE named static
the entry owns. STACK_U64S is the sched task’s stack in 8-byte words;
TCB_U64S the control-block region, SCHED_TASK_TCB_U64S by default and
0 for a kernel whose control block the port keeps itself (Zephyr’s
struct k_thread — a Rust entry cannot size it).
The control block comes first and the struct is 64-byte aligned, so the stack starts on a boundary every in-tree kernel accepts for a thread stack (the TCB region is a whole number of 64-byte lines).
Implementations§
Source§impl<const STACK_U64S: usize, const TCB_U64S: usize> SchedTaskMemory<STACK_U64S, TCB_U64S>
impl<const STACK_U64S: usize, const TCB_U64S: usize> SchedTaskMemory<STACK_U64S, TCB_U64S>
Sourcepub const fn new() -> SchedTaskMemory<STACK_U64S, TCB_U64S>
pub const fn new() -> SchedTaskMemory<STACK_U64S, TCB_U64S>
An untouched reservation, const so it initialises a static
(all-zero .bss, no flash).
Sourcepub const fn raw(&'static self) -> SchedTaskMemoryRaw
pub const fn raw(&'static self) -> SchedTaskMemoryRaw
The raw row for this static — const, so the entry builds its
SchedTaskMemorySet in a static initialiser.