Mark3 Realtime Kernel
|
The PriorityMapL2 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 <priomapl2.h>
Public Member Functions | |
PriorityMapL2 () | |
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... | |
T | 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 | |
T | m_auXPriorityMap [m_uXPrioMapNumWords] |
T | m_uXPriorityMapL2 |
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 } |
static constexpr auto | m_uXPrioMapNumWords = T { (C + (m_uXPrioMapBits - 1)) / m_uXPrioMapBits } |
The PriorityMapL2 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 L2 version of the datastructure uses a two-layer nested map structure, where a first layer bitmap contains a single unsigned integer of type "T", where each bit corresponds to an array entry in the second layer table. The second layer consists of an array of unsigned integers of type "T", where each bit in each element corresponds to a level of priority supported by the map structure. As a result, the maximum number of priorities ("C") supported by the object is n*n, where n is the number of bits in the "T" parameter. i.e., if an 8-bit unsigned int is used, this object supports up to 64 priorities; and if a 32-bit unsigned int is used, the object supports up to 1024 priorities.
Definition at line 50 of file priomapl2.h.
|
inline |
PriorityMap Initialize the priority map object, clearing the bitamp data to all 0's.
Definition at line 57 of file priomapl2.h.
|
inline |
Clear Clear the priority map bitmap data, at all levels, for the given priority.
uXPrio_ | Priority level to clear the bitmap data for. |
Definition at line 82 of file priomapl2.h.
|
inline |
HighestPriority Computes the numeric priority of the highest-priority thread represented in the priority map.
Definition at line 100 of file priomapl2.h.
|
inlinestaticprivate |
Definition at line 113 of file priomapl2.h.
|
inlinestaticprivate |
Definition at line 115 of file priomapl2.h.
|
inlinestaticprivate |
Definition at line 117 of file priomapl2.h.
|
inline |
Set Set the priority map bitmap data, at all levels, for the given priority.
uXPrio_ | Priority level to set the bitmap data for. |
Definition at line 68 of file priomapl2.h.
|
private |
Definition at line 148 of file priomapl2.h.
|
staticprivate |
Definition at line 142 of file priomapl2.h.
|
staticprivate |
Definition at line 141 of file priomapl2.h.
|
staticprivate |
Definition at line 146 of file priomapl2.h.
|
staticprivate |
Definition at line 139 of file priomapl2.h.
|
staticprivate |
Definition at line 140 of file priomapl2.h.
|
private |
Definition at line 149 of file priomapl2.h.