RKH
rkhsma_prio.h File Reference

Specifies the native priority mechanism for active object scheduling. More...

#include "rkhcfg.h"
#include "rkhtype.h"
Include dependency graph for rkhsma_prio.h:

Go to the source code of this file.

Functions

void rkh_smaPrio_init (void)
 Initializes the native priority mechanism for active object scheduling.
 
rbool_t rkh_smaPrio_isNotReady (void)
 Evaluates to true if all active objects are not ready to run.
 
rbool_t rkh_smaPrio_isReady (void)
 Evaluates to true if any active object is ready to run.
 
void rkh_smaPrio_setReady (rui8_t prio)
 Making an active object ready-to-run inserting it into the ready list. More...
 
void rkh_smaPrio_setUnready (rui8_t prio)
 Removing an active object from the ready list. More...
 
rui8_t rkh_smaPrio_findHighest (void)
 Finding the highest priority active object ready to run. More...
 

Detailed Description

Specifies the native priority mechanism for active object scheduling.

Definition in file rkhsma_prio.h.

Function Documentation

void rkh_smaPrio_setReady ( rui8_t  prio)

Making an active object 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[].

Parameters
[in]prionumber of active object's priority.
void rkh_smaPrio_setUnready ( rui8_t  prio)

Removing an active object from the ready list.

Clears the ready bit of the active object in rkhrg.tbl[] and clears the bit in rkhrg.grp only if all active objects in a group are not ready to run, i.e. all bits in rkhrg.tbl[prio >> 3] are 0.

Parameters
[in]prionumber of active object's priority.
rui8_t rkh_smaPrio_findHighest ( void  )

Finding the highest priority active object 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. 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.