RKH
|
Native priority management. More...
Go to the source code of this file.
Data Structures | |
struct | RKH_RG_T |
SMA ready table. More... | |
Macros | |
#define | RKH_RDY_IS_EMPTY(rg) ((rg).grp == 0) |
This macro evaluates to true if all SMAs are not ready to run. More... | |
#define | RKH_RDY_ISNOT_EMPTY(rg) ((rg).grp != 0) |
This macro evaluates to true if any SMA is ready to run. More... | |
#define | RKH_RDY_INSERT(rg, p) |
Making a SMA ready-to-run inserting it into the ready list. More... | |
#define | RKH_RDY_REM(rg, p) |
Removing a SMA from the ready list. More... | |
#define | RKH_RDY_FIND_HIGHEST(rg, p) |
Finding the highest priority SMA ready to run. More... | |
Native priority management.
Definition in file rkhrdy.h.
#define RKH_RDY_IS_EMPTY | ( | rg | ) | ((rg).grp == 0) |
#define RKH_RDY_ISNOT_EMPTY | ( | rg | ) | ((rg).grp != 0) |
#define RKH_RDY_INSERT | ( | rg, | |
p | |||
) |
Making a SMA ready-to-run inserting it into the ready list.
The lower 3 bits of the SMA's priority are used to determine the bit position in rkhrg.tbl[], while the next three most significant bits are used to determine the index into rkhrg.tbl[]. Note that rkh_maptbl[] is a table in ROM, used to equate an index from 0 to 7 to a bit mask.
[in] | rg | ready group. |
[in] | p | number of SMA's priotity. |
#define RKH_RDY_REM | ( | rg, | |
p | |||
) |
Removing a SMA from the ready list.
Clears the ready bit of the SMA in rkhrg.tbl[] and clears the bit in rkhrg.grp only if all SMAs in a group are not ready to run, i.e. all bits in rkhrg.tbl[prio >> 3] are 0.
[in] | rg | ready group. |
[in] | p | number of SMA's priotity. |
#define RKH_RDY_FIND_HIGHEST | ( | rg, | |
p | |||
) |
Finding the highest priority SMA ready to run.
Another table lookup is performed, rather than scanning through the table starting with rkhrg.tbl[0] to find the highest priority task ready to run. rkh_unmaptbl[256] is a priority resolution table. Eight bits are used to represent when tasks are ready in a group. The least significant bit has the highest priority. Using this byte to index the table returns the bit position of the highest priority bit set, a number between 0 and 7.
[in] | rg | ready group. |
[in] | p | the found highest priority is assigned to p. |