diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 181d2c523c..c6ef061ac0 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -24,6 +24,11 @@ Changed type of boolean variables to bool. Use unsigned integer type for radix and width parameters. +2009-11-30 Sebastian Huber + + * score/include/rtems/score/chain.h, sapi/include/rtems/chain.h: Added + defines for initialization of empty chains. + 2009-11-30 Sebastian Huber * rtems/include/rtems/rtems/timer.h: Added timer server control block diff --git a/cpukit/sapi/include/rtems/chain.h b/cpukit/sapi/include/rtems/chain.h index 6050da3dfa..72481f7daa 100644 --- a/cpukit/sapi/include/rtems/chain.h +++ b/cpukit/sapi/include/rtems/chain.h @@ -43,6 +43,17 @@ typedef Chain_Node rtems_chain_node; */ typedef Chain_Control rtems_chain_control; +/** + * @brief Chain initializer for an empty chain with designator @a name. + */ +#define RTEMS_CHAIN_INITIALIZER_EMPTY(name) \ + CHAIN_INITIALIZER_EMPTY(name) + +/** + * @brief Chain definition for an empty chain with designator @a name. + */ +#define RTEMS_CHAIN_DEFINE_EMPTY(name) \ + CHAIN_DEFINE_EMPTY(name) #include diff --git a/cpukit/score/include/rtems/score/chain.h b/cpukit/score/include/rtems/score/chain.h index 8dbef1e543..3d18adf64f 100644 --- a/cpukit/score/include/rtems/score/chain.h +++ b/cpukit/score/include/rtems/score/chain.h @@ -93,6 +93,22 @@ typedef struct { Chain_Node *last; } Chain_Control; +/** + * @brief Chain initializer for an empty chain with designator @a name. + */ +#define CHAIN_INITIALIZER_EMPTY(name) \ + { \ + (Chain_Node *) &(name).permanent_null, \ + NULL, \ + (Chain_Node *) &(name) \ + } + +/** + * @brief Chain definition for an empty chain with designator @a name. + */ +#define CHAIN_DEFINE_EMPTY(name) \ + Chain_Control name = CHAIN_INITIALIZER_EMPTY(name) + /** * @brief Initialize a Chain Header *