Skip to main content

boot_tier_index

Function boot_tier_index 

Source
pub fn boot_tier_index(
    tiers: &[TierSpec<'_>],
    direction: PriorityDirection,
) -> usize
Expand description

Index of the tier the BOOT task should run: the least urgent one.

Issue 0636 — the boot task owns the session and spins forever, so it must not outrank the tiers it spawned. See the module docs for what happened when it did.

  • Ties keep the earliest index, so a table whose tiers all declare the same priority (or none) behaves exactly as tiers[0] did.
  • An undeclared priority is least urgent, but only where 0 is out of range. On bigger-wins kernels the valid range starts at 1 and 0 is the “inherit” sentinel every board already tests for, so a tier that declared nothing makes no claim and is the safest owner. On smaller-wins kernels 0 is a REAL priority — a very urgent one on ThreadX — and treating it as a sentinel would hand the session to the most urgent tier, which is the bug this function exists to prevent.