pub(crate) const RT_PRIORITY_LEVELS: usize = 99;
pub(crate) const fn rt_priority_index(priority: u8) -> usize {
assert!(priority != 0 && priority <= RT_PRIORITY_LEVELS as u8);
(RT_PRIORITY_LEVELS as u8 - priority) as usize
}
pub(crate) const fn rt_priority_from_index(index: usize) -> u8 {
assert!(index < RT_PRIORITY_LEVELS);
RT_PRIORITY_LEVELS as u8 - index as u8
}
pub(crate) fn bitmap_highest_rt_priority(bitmap: u128) -> Option<u8> {
let index = bitmap.trailing_zeros() as usize;
(index < RT_PRIORITY_LEVELS).then(|| rt_priority_from_index(index))
}