Mark3 Realtime Kernel
Mark3::PriorityMapL1< T, C > Class Template Reference

The PriorityMapL1 class This class implements a priority bitmap data structure. Each bit in the objects internal storage represents a priority. When a bit is set, it indicates that something is scheduled at the bit's corresponding priority, when a bit is clear it indicates that no entities are scheduled at that priority. This object provides the fundamental logic required to implement efficient priority-based scheduling for the thread + coroutine schedulers in the kernel. More...

#include <priomapl1.h>

Public Member Functions

 PriorityMapL1 ()
 PriorityMap Initialize the priority map object, clearing the bitamp data to all 0's. More...
 
void Set (T uXPrio_)
 Set Set the priority map bitmap data, at all levels, for the given priority. More...
 
void Clear (T uXPrio_)
 Clear Clear the priority map bitmap data, at all levels, for the given priority. More...
 
HighestPriority (void)
 HighestPriority Computes the numeric priority of the highest-priority thread represented in the priority map. More...
 

Static Private Member Functions

static T PrioBit (T prio)
 
static T PrioMapWordIndex (T prio)
 
static T PriorityFromBitmap (T uXPrio_)
 

Private Attributes

m_uXPriorityMap
 

Static Private Attributes

static constexpr size_t m_uXPrioMapShiftLUT [9] = {0, 3, 4, 0, 5, 0, 0, 0, 6}
 
static constexpr auto m_uXPrioMapWordShift = T { m_uXPrioMapShiftLUT[sizeof(T)] }
 
static constexpr auto m_uXPrioMapBits = T { 8 * sizeof(T) }
 
static constexpr auto m_uXPrioMapBitMask = T { (1 << m_uXPrioMapWordShift) - 1 }
 

Detailed Description

template<typename T, size_t C>
class Mark3::PriorityMapL1< T, C >

The PriorityMapL1 class This class implements a priority bitmap data structure. Each bit in the objects internal storage represents a priority. When a bit is set, it indicates that something is scheduled at the bit's corresponding priority, when a bit is clear it indicates that no entities are scheduled at that priority. This object provides the fundamental logic required to implement efficient priority-based scheduling for the thread + coroutine schedulers in the kernel.

The L1 version of the datastructure uses a single unsigned integer (specified by the templated typname "T"), to support "C" priorities. Thus, the maximum number of priorities supported in the map is the number of bits in the "T" parameter.

Definition at line 45 of file priomapl1.h.

Constructor & Destructor Documentation

◆ PriorityMapL1()

template<typename T , size_t C>
Mark3::PriorityMapL1< T, C >::PriorityMapL1 ( )
inline

PriorityMap Initialize the priority map object, clearing the bitamp data to all 0's.

Definition at line 52 of file priomapl1.h.

Member Function Documentation

◆ Clear()

template<typename T , size_t C>
void Mark3::PriorityMapL1< T, C >::Clear ( uXPrio_)
inline

Clear Clear the priority map bitmap data, at all levels, for the given priority.

Parameters
uXPrio_Priority level to clear the bitmap data for.

Definition at line 73 of file priomapl1.h.

◆ HighestPriority()

template<typename T , size_t C>
T Mark3::PriorityMapL1< T, C >::HighestPriority ( void  )
inline

HighestPriority Computes the numeric priority of the highest-priority thread represented in the priority map.

Returns
Highest priority ready-thread's number.

Definition at line 86 of file priomapl1.h.

◆ PrioBit()

template<typename T , size_t C>
static T Mark3::PriorityMapL1< T, C >::PrioBit ( prio)
inlinestaticprivate

Definition at line 93 of file priomapl1.h.

◆ PrioMapWordIndex()

template<typename T , size_t C>
static T Mark3::PriorityMapL1< T, C >::PrioMapWordIndex ( prio)
inlinestaticprivate

Definition at line 95 of file priomapl1.h.

◆ PriorityFromBitmap()

template<typename T , size_t C>
static T Mark3::PriorityMapL1< T, C >::PriorityFromBitmap ( uXPrio_)
inlinestaticprivate

Definition at line 97 of file priomapl1.h.

◆ Set()

template<typename T , size_t C>
void Mark3::PriorityMapL1< T, C >::Set ( uXPrio_)
inline

Set Set the priority map bitmap data, at all levels, for the given priority.

Parameters
uXPrio_Priority level to set the bitmap data for.

Definition at line 62 of file priomapl1.h.

Member Data Documentation

◆ m_uXPrioMapBitMask

template<typename T , size_t C>
constexpr auto Mark3::PriorityMapL1< T, C >::m_uXPrioMapBitMask = T { (1 << m_uXPrioMapWordShift) - 1 }
staticprivate

Definition at line 122 of file priomapl1.h.

◆ m_uXPrioMapBits

template<typename T , size_t C>
constexpr auto Mark3::PriorityMapL1< T, C >::m_uXPrioMapBits = T { 8 * sizeof(T) }
staticprivate

Definition at line 121 of file priomapl1.h.

◆ m_uXPrioMapShiftLUT

template<typename T , size_t C>
constexpr size_t Mark3::PriorityMapL1< T, C >::m_uXPrioMapShiftLUT[9] = {0, 3, 4, 0, 5, 0, 0, 0, 6}
staticprivate

Definition at line 119 of file priomapl1.h.

◆ m_uXPrioMapWordShift

template<typename T , size_t C>
constexpr auto Mark3::PriorityMapL1< T, C >::m_uXPrioMapWordShift = T { m_uXPrioMapShiftLUT[sizeof(T)] }
staticprivate

Definition at line 120 of file priomapl1.h.

◆ m_uXPriorityMap

template<typename T , size_t C>
T Mark3::PriorityMapL1< T, C >::m_uXPriorityMap
private

Definition at line 124 of file priomapl1.h.


The documentation for this class was generated from the following file: