qpset.h File Reference

platform-independent priority sets of 8 or 64 elements. More...

Go to the source code of this file.

Data Structures

struct  QPSet8
 Priority Set of up to 8 elements for building various schedulers. More...
struct  QPSet64
 Priority Set of up to 64 elements for building various schedulers. More...

Defines

#define QPSet8_isEmpty(me_)   ((me_)->bits == (uint8_t)0)
 the macro evaluates to TRUE if the priority set me has elements
#define QPSet8_notEmpty(me_)   ((me_)->bits != (uint8_t)0)
 the macro evaluates to TRUE if the priority set me is empty
#define QPSet8_hasElement(me_, n_)   (((me_)->bits & Q_ROM_BYTE(QF_pwr2Lkup[n_])) != 0)
 the macro evaluates to TRUE if the priority set me_ has element n_.
#define QPSet8_insert(me_, n_)   ((me_)->bits |= Q_ROM_BYTE(QF_pwr2Lkup[n_]))
 insert element n_ into the set me_, n_= 1..8
#define QPSet8_remove(me_, n_)   ((me_)->bits &= Q_ROM_BYTE(QF_invPwr2Lkup[n_]))
 remove element n_ from the set me_, n_= 1..8
#define QPSet8_findMax(me_, n_)   ((n_) = Q_ROM_BYTE(QF_log2Lkup[(me_)->bits]))
 find the maximum element in the set, and assign it to n_,
#define QPSet64_isEmpty(me_)   QPSet8_isEmpty(&(me_)->super)
 the macro evaluates to TRUE if the priority set me_ has elements
#define QPSet64_notEmpty(me_)   QPSet8_notEmpty(&(me_)->super)
 the macro evaluates to TRUE if the priority set me is empty
#define QPSet64_hasElement(me_, n_)   QPSet8_hasElement(&(me_)->subset[Q_ROM_BYTE(QF_div8Lkup[n_]], n_)
 the macro evaluates to TRUE if the priority set me_ has element n_.
#define QPSet64_insert(me_, n_)
 insert element n_ into the set me_, n_= 1..64
#define QPSet64_remove(me_, n_)
 remove element n_ from the set me_, n_= 1..64
#define QPSet64_findMax(me_, n_)
 find the maximum element in the set, and assign it to n_

Detailed Description

platform-independent priority sets of 8 or 64 elements.

This header file must be included in those QF ports that use the cooperative "vanilla" kernel or the QK preemptive kernel.

Definition in file qpset.h.


Define Documentation

#define QPSet64_findMax ( me_,
n_   ) 
Value:
if (QPSet64_notEmpty(me_)) { \
        (n_) = (uint8_t)(Q_ROM_BYTE(QF_log2Lkup[(me_)->super.bits]) - 1); \
        (n_) = (uint8_t)(Q_ROM_BYTE(QF_log2Lkup[(me_)->subset[n_].bits]) \
                         + ((n_) << 3)); \
    } else ((n_) = (uint8_t)0)

find the maximum element in the set, and assign it to n_

Note:
if the set me_ is empty, n_ is set to zero.

Definition at line 160 of file qpset.h.

Referenced by QF_run().

#define QPSet8_findMax ( me_,
n_   )     ((n_) = Q_ROM_BYTE(QF_log2Lkup[(me_)->bits]))

find the maximum element in the set, and assign it to n_,

Note:
if the set me_ is empty, n_ is set to zero.

Definition at line 81 of file qpset.h.

Referenced by QF_run().

Generated on Tue Mar 16 19:38:11 2010 for QP/C by  doxygen 1.6.3