Expand description
phase-509 P7 (RFC-0108 D8.1, D8.2) – which level an executor is, and whether every level of the image is alive.
A supervisor that owns a route per level, or feeds a hardware watchdog, needs two facts the executor alone knows:
- Identity. Each executor runs one level (
Executor::level): 0, the most urgent, unless its runner set another (Executor::set_level). The generated entry names each node’s level at build time (NROS_ENTRY_LEVEL_OF_<node>innros_priority_plan.h) by the same rule the runner applies: a level’s index is its tier’s urgency order among the image’s tiers (until phase-509 P9 a level is a tier). - Liveness. Every spin of an executor checks its level in here, with
the time (
level_last_spin_us) and a spin count. The watchdog feed istake_every_level_alive:trueonly when every level of the image (0..level_count()) has checked in since the lasttrue, which it then clears. A level blocked behind a stuck callback stops checking in, so the feed stops even while another level spins on (RFC-0108 D8.2).
The registry is per image (a static): the levels are separate executors
on separate threads until P9, and the watchdog is per image. Lock-free,
32-bit atomics only, so it works on a core without 64-bit atomics; a time
is the low 32 bits of the executor’s microsecond clock, so a consumer
compares two of them with a wrapping difference (71 minutes of range).
Constants§
- MAX_
LEVELS - Levels one image can have:
CONFIG_NROS_EXECUTOR_MAX_LEVELS’s upper end, one bit each in the check-in word.
Functions§
- every_
level_ alive - Whether every level of the image has checked in since the last
take_every_level_alivethat returnedtrue. - level_
count - How many levels the image runs.
- level_
last_ spin_ us - The low 32 bits of the executor clock, in microseconds, at
level’s latest spin;Nonewhen it has not spun (or spins with no clock). - level_
spins - How many times
levelhas spun. - set_
level_ count - State how many levels the image runs (its runner does, once, before the
levels spin).
false, and nothing changed, for 0 or more thanMAX_LEVELS. An image that never states it has one level. - take_
every_ level_ alive - The watchdog feed:
truewhen every level has checked in since the lasttrue, and the check-ins are then cleared;false, and nothing cleared, while any level has not. - tier_
level tier_level_byover a slice of priorities.- tier_
level_ by - The level of tier
indexof an image whosentiers have the kernel prioritiespriority_of(0..n): its urgency order, 0 the most urgent, equal priorities in array order. Until phase-509 P9 a level is a tier, so this is how a runner places each tier’s executor (Executor::set_level).nros codegen entrywritesNROS_ENTRY_LEVEL_OF_<node>by the same rule, over the same array.Nonewhenindexis out of range.