pub struct SchedTaskSpec<'a> {Show 13 fields
pub name: &'a str,
pub groups: &'a [(&'a str, &'a str, &'a str)],
pub priority: i64,
pub stack_bytes: usize,
pub spin_period_us: u64,
pub core: Option<u32>,
pub preempt_threshold: Option<i64>,
pub time_slice_us: Option<u64>,
pub class: Option<&'a str>,
pub period_us: Option<u64>,
pub budget_us: Option<u64>,
pub deadline_us: Option<u64>,
pub deadline_policy: Option<&'a str>,
}Expand description
One sched task: an RTOS task running an Executor over the
shared session, admitting only the listed callback groups.
All fields are literal-constructible so the codegen emitter can bake
a const/static array of these straight from the resolved sched task
table in nros-plan.json.
Fields§
§name: &'a strSched task name (matches the system.toml [tasks.<name>] key); used
for the spawned task’s debug name.
groups: &'a [(&'a str, &'a str, &'a str)]Callback groups admitted on this sched task, as (node name, node namespace, group). Passed verbatim to Executor::set_active_groups; an empty
slice = wildcard.
The group id ALONE was ambiguous: two nodes may declare
the same one on different sched tasks, and the filter admitted both. The C
side carries the same information as a FLAT array of 3N strings so
nros_native_sched_task_spec_t stays byte-identical; Rust uses a tuple so
the compiler enforces the grouping instead of a convention doing it.
(the original note follows)
Passed verbatim to
Executor::set_active_groups; an empty slice = wildcard
(admit every group — the single-sched-task degenerate case).
priority: i64Raw per-RTOS task priority — the value passed straight to the
native spawn call. The system author writes it in
[tasks.<name>.<rtos>].priority, so it is already in the target
kernel’s scale (FreeRTOS 0–7, ThreadX 0–31 lower=higher, …);
i64 admits Zephyr’s negative coop priorities. (The
*_priority_for mappers in this module are a separate utility for
authors who prefer a normalized 0–31 scale; the codegen path uses
the raw value verbatim.)
stack_bytes: usizeTask stack size in bytes. 0 = let the board pick its default.
spin_period_us: u64Spin period for this sched task’s spin_once loop, in microseconds.
core: Option<u32>CPU core to pin the sched task to (SMP boards); None = unpinned.
preempt_threshold: Option<i64>ThreadX preemption threshold (ThreadX targets only; bake-validated).
time_slice_us: Option<u64>Round-robin time slice in µs: Some requests time-slicing among
same-priority sched tasks. ThreadX-only today (bake-validated); None = FIFO.
class: Option<&'a str>Scheduling class: "best_effort" | "real_time" |
"time_triggered" (bake rejects "interrupt"); None = plain
priority sched task.
period_us: Option<u64>Callback period (µs) — time_triggered window period / sporadic
replenishment period.
budget_us: Option<u64>Execution-time budget (µs) — sporadic-server budget (W3 wires it
into the executor’s SchedContext).
deadline_us: Option<u64>Relative deadline (µs) for the deadline monitor (W3).
deadline_policy: Option<&'a str>On deadline miss: "ignore" | "warn" | "skip" | "fault".
Implementations§
Source§impl<'a> SchedTaskSpec<'a>
impl<'a> SchedTaskSpec<'a>
Sourcepub const fn single() -> SchedTaskSpec<'static>
pub const fn single() -> SchedTaskSpec<'static>
A degenerate single sched task: wildcard groups, normal priority, the board’s default stack. Equivalent to today’s single-task entry.
Trait Implementations§
Source§impl<'a> Clone for SchedTaskSpec<'a>
impl<'a> Clone for SchedTaskSpec<'a>
Source§fn clone(&self) -> SchedTaskSpec<'a>
fn clone(&self) -> SchedTaskSpec<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more