RKH
rkhfwk_rdygrp.h File Reference

... More...

#include "rkhitl.h"
Include dependency graph for rkhfwk_rdygrp.h:

Go to the source code of this file.

Data Structures

struct  RKHRdyGrp
 SMA ready table. More...
 

Functions

void rkh_rdygrp_init (RKHRdyGrp *const me)
 Initializes the ready mechanism for active objects. More...
 
rbool_t rkh_rdygrp_isReady (RKHRdyGrp *const me)
 Evaluates to true if any active object is ready. More...
 
void rkh_rdygrp_setReady (RKHRdyGrp *const me, rui8_t prio)
 Making an active object ready inserting it into the ready list. More...
 
void rkh_rdygrp_setUnready (RKHRdyGrp *const me, rui8_t prio)
 Removing an active object from the ready list. More...
 
rui8_t rkh_rdygrp_findHighest (RKHRdyGrp *const me)
 Finding the highest priority active object ready. More...
 
rui8_t rkh_rdygrp_traverse (RKHRdyGrp *const me, void(*rdyCb)(RdyCbArg *), RdyCbArg *rdyCbArg)
 Traverse a ready list to find the ready active objects and thus invoking a callback function. More...
 

Detailed Description

...

...

Definition in file rkhfwk_rdygrp.h.

Function Documentation

◆ rkh_rdygrp_init()

void rkh_rdygrp_init ( RKHRdyGrp *const  me)

Initializes the ready mechanism for active objects.

Parameters
[in]me

◆ rkh_rdygrp_isReady()

rbool_t rkh_rdygrp_isReady ( RKHRdyGrp *const  me)

Evaluates to true if any active object is ready.

Parameters
[in]me

◆ rkh_rdygrp_setReady()

void rkh_rdygrp_setReady ( RKHRdyGrp *const  me,
rui8_t  prio 
)

Making an active object ready 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]me
[in]prionumber of active object's priority.

◆ rkh_rdygrp_setUnready()

void rkh_rdygrp_setUnready ( RKHRdyGrp *const  me,
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]me
[in]prionumber of active object's priority.

◆ rkh_rdygrp_findHighest()

rui8_t rkh_rdygrp_findHighest ( RKHRdyGrp *const  me)

Finding the highest priority active object ready.

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.

Parameters
[in]me

◆ rkh_rdygrp_traverse()

rui8_t rkh_rdygrp_traverse ( RKHRdyGrp *const  me,
void(*)(RdyCbArg *)  rdyCb,
RdyCbArg *  rdyCbArg 
)

Traverse a ready list to find the ready active objects and thus invoking a callback function.

Parameters
[in]me
[in]rdyCbinvoked callback function to every found ready active object.
[in]rdyCbArgargument of callback function rdyCb
Returns
The number of found ready active objects