Changeset 2ff4255 in rtems-docs


Ignore:
Timestamp:
Dec 6, 2016, 11:03:54 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
00ffe1f
Parents:
1727e62
Message:

Update linker set documentation

Update #2408.
Update #2790.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c-user/linker_sets.rst

    r1727e62 r2ff4255  
    3131
    3232- RTEMS_LINKER_SET_SIZE_ - The linker set size in characters
     33
     34- RTEMS_LINKER_SET_ITEM_COUNT_ - The linker set item count
     35
     36- RTEMS_LINKER_SET_IS_EMPTY_ - Is the linker set empty?
     37
     38- RTEMS_LINKER_SET_FOREACH_ - Iterate through the linker set items
    3339
    3440- RTEMS_LINKER_ROSET_DECLARE_ - Declares a read-only linker set
     
    127133    .. code-block:: c
    128134
    129         volatile type *begin = RTEMS_LINKER_SET_BEGIN( set );
     135        type *begin = RTEMS_LINKER_SET_BEGIN( set );
    130136
    131137DESCRIPTION:
     
    139145    expansion is performed.  It uniquely identifies the linker set.
    140146
     147NOTE:
     148    The compiler may try to be smart.  In general it will not work to assign linker
     149    set begin and end addresses to pointer variables and treat them like
     150    ordinary pointers.  The compiler may exploit the fact that actually two
     151    distinct objects are involved and use this to optimize.  To avoid trouble
     152    use :ref:`RTEMS_LINKER_SET_SIZE`, :ref:`RTEMS_LINKER_SET_ITEM_COUNT`,
     153    :ref:`RTEMS_LINKER_SET_IS_EMPTY` and :ref:`RTEMS_LINKER_SET_FOREACH`.
     154
    141155.. raw:: latex
    142156
     
    152166    .. code-block:: c
    153167
    154         volatile type *end = RTEMS_LINKER_SET_END( set );
     168        type *end = RTEMS_LINKER_SET_END( set );
    155169
    156170DESCRIPTION:
     
    181195    which no macro expansion is performed.  It uniquely identifies the linker
    182196    set.
     197
     198.. raw:: latex
     199
     200   \clearpage
     201
     202.. _RTEMS_LINKER_SET_ITEM_COUNT:
     203
     204RTEMS_LINKER_SET_ITEM_COUNT - The linker set item count
     205---------------------------------------------------------
     206.. index:: RTEMS_LINKER_SET_ITEM_COUNT
     207
     208CALLING SEQUENCE:
     209    .. code-block:: c
     210
     211        size_t item_count = RTEMS_LINKER_SET_ITEM_COUNT( set );
     212
     213DESCRIPTION:
     214    This macro returns the item count of the linker set identified by ``set``.
     215    The ``set`` parameter itself must be a valid C designator on which no macro
     216    expansion is performed.  It uniquely identifies the linker set.
     217
     218.. raw:: latex
     219
     220   \clearpage
     221
     222.. _RTEMS_LINKER_SET_IS_EMPTY:
     223
     224RTEMS_LINKER_SET_IS_EMPTY - Is the linker set empty?
     225---------------------------------------------------------
     226.. index:: RTEMS_LINKER_SET_IS_EMPTY
     227
     228CALLING SEQUENCE:
     229    .. code-block:: c
     230
     231        bool is_empty = RTEMS_LINKER_SET_IS_EMPTY( set );
     232
     233DESCRIPTION:
     234    This macro returns true if the linker set identified by ``set`` is empty,
     235    otherwise returns false.  The ``set`` parameter itself must be a valid C
     236    designator on which no macro expansion is performed.  It uniquely
     237    identifies the linker set.
     238
     239.. raw:: latex
     240
     241   \clearpage
     242
     243.. _RTEMS_LINKER_SET_FOREACH:
     244
     245RTEMS_LINKER_SET_FOREACH - Iterate through the linker set items
     246---------------------------------------------------------
     247.. index:: RTEMS_LINKER_SET_FOREACH
     248
     249CALLING SEQUENCE:
     250    .. code-block:: c
     251
     252        RTEMS_LINKER_RWSET( myset, int );
     253
     254        int count( void )
     255        {
     256          int *item;
     257          int n;
     258
     259          n = 0;
     260          RTEMS_LINKER_SET_FOREACH( myset, item ) {
     261            n += *item;
     262          }
     263
     264          return n;
     265        }
     266
     267DESCRIPTION:
     268    This macro generates a for loop statement which iterates through each item
     269    of a linker set identified by ``set``.  The ``set`` parameter itself must
     270    be a valid C designator on which no macro expansion is performed.  It
     271    uniquely identifies the linker set.  The ``item`` parameter must be a
     272    pointer to an item of the linker set.  It iterates through all items of the
     273    linker set from begin to end.
    183274
    184275.. raw:: latex
Note: See TracChangeset for help on using the changeset viewer.