ove/priority.rs
1// Copyright (C) 2026 Kamil Lulko <kamil.lulko@gmail.com>
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4//
5// This file is part of oveRTOS.
6
7//! Thread priority levels for oveRTOS.
8
9/// Thread priority levels, matching `ove_prio_t`.
10///
11/// Variants are ordered from lowest (`Idle`) to highest (`Critical`) so that
12/// standard comparison operators (`<`, `>`) work intuitively.
13#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
14#[repr(u32)]
15pub enum Priority {
16 /// Lowest priority, typically the RTOS idle task level.
17 Idle = 0,
18 /// Low background priority.
19 Low = 1,
20 /// Below-normal priority.
21 BelowNormal = 2,
22 /// Default priority for most application threads.
23 Normal = 3,
24 /// Above-normal priority for time-sensitive work.
25 AboveNormal = 4,
26 /// High priority for latency-critical tasks.
27 High = 5,
28 /// Real-time priority; preempts most other threads.
29 Realtime = 6,
30 /// Highest priority; reserved for system-critical tasks.
31 Critical = 7,
32}