@@ -260,6 +260,38 @@ ranges:
260260For example, configuring 5 cooperative priorities and 10 preemptive priorities
261261results in the ranges -5 to -1 and 0 to 9, respectively.
262262
263+ .. _metairq_priorities :
264+
265+ Meta-IRQ Priorities
266+ ===================
267+
268+ When enabled (see :kconfig: `CONFIG_NUM_METAIRQ_PRIORITIES `), there is a special
269+ subclass of cooperative priorities at the highest (numerically lowest)
270+ end of the priority space: meta-IRQ threads. These are scheduled
271+ according to their normal priority, but also have the special ability
272+ to preempt all other threads (and other meta-irq threads) at lower
273+ priorities, even if those threads are cooperative and/or have taken a
274+ scheduler lock.
275+
276+ This behavior makes the act of unblocking a meta-IRQ thread (by any
277+ means, e.g. creating it, calling k_sem_give(), etc.) into the
278+ equivalent of a synchronous system call when done by a lower
279+ priority thread, or an ARM-like "pended IRQ" when done from true
280+ interrupt context. The intent is that this feature will be used to
281+ implement interrupt "bottom half" processing and/or "tasklet" features
282+ in driver subsystems. The thread, once woken, will be guaranteed to
283+ run before the current CPU returns into application code.
284+
285+ Unlike similar features in other OSes, meta-IRQ threads are true
286+ threads and run on their own stack (which must be allocated normally),
287+ not the per-CPU interrupt stack. Design work to enable the use of the
288+ IRQ stack on supported architectures is pending.
289+
290+ Note that because this breaks the promise made to cooperative
291+ threads by the Zephyr API (namely that the OS won't schedule other
292+ thread until the current thread deliberately blocks), it should be
293+ used only with great care from application code. These are not simply
294+ very high priority threads and should not be used as such.
263295
264296.. _thread_options_v2 :
265297
0 commit comments