Changeset 6fa32c0 in rtems-docs


Ignore:
Timestamp:
Dec 9, 2016, 12:01:57 PM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
c4825f4
Parents:
00ffe1f
git-author:
Sebastian Huber <sebastian.huber@…> (12/09/16 12:01:57)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/12/16 07:07:35)
Message:

Update Initialization Manager chapter

Update #2408.

Location:
c-user
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c-user/fatal_error.rst

    r00ffe1f r6fa32c0  
    44.. COMMENT: On-Line Applications Research Corporation (OAR).
    55.. COMMENT: All rights reserved.
     6
     7.. _fatal_error_manager:
    68
    79Fatal Error Manager
     
    1921
    2022- rtems_fatal_ - Invoke the fatal error handler
     23
     24- rtems_shutdown_executive_ - Shutdown RTEMS
    2125
    2226- rtems_exception_frame_print_ - Print the CPU exception frame
     
    469473   \clearpage
    470474
     475.. _rtems_shutdown_executive:
     476
     477SHUTDOWN_EXECUTIVE - Shutdown RTEMS
     478-----------------------------------
     479.. index:: shutdown RTEMS
     480
     481.. index:: rtems_shutdown_executive
     482CALLING SEQUENCE:
     483    .. code-block:: c
     484
     485        void rtems_shutdown_executive(
     486            uint32_t result
     487        );
     488
     489DIRECTIVE STATUS CODES:
     490    NONE - This function will not return to the caller.
     491
     492DESCRIPTION:
     493    This directive is called when the application wishes to shutdown RTEMS.
     494    The system is terminated with a fatal source of ``RTEMS_FATAL_SOURCE_EXIT``
     495    and the specified ``result`` code.
     496
     497NOTES:
     498    This directive *must* be the last RTEMS directive invoked by an application
     499    and it *does not return* to the caller.
     500
     501    This directive may be called any time.
     502
     503.. raw:: latex
     504
     505   \clearpage
     506
    471507.. _rtems_exception_frame_print:
    472508
  • c-user/initialization.rst

    r00ffe1f r6fa32c0  
    1111============
    1212
    13 The Initialization Manager is responsible for initiating and shutting down
    14 RTEMS.  Initiating RTEMS involves creating and starting all configured
    15 initialization tasks, and for invoking the initialization routine for each
    16 user-supplied device driver.  In a multiprocessor configuration, this manager
    17 also initializes the interprocessor communications layer.  The directives
    18 provided by the Initialization Manager are:
     13The Initialization Manager is responsible for initializing the Board Support
     14Package, RTEMS, device drivers, the root filesystem and the application.  The
     15:ref:`Fatal Error Manager <fatal_error_manager>` is responsible for the system
     16shutdown.
     17
     18The Initialization Manager provides only one directive:
    1919
    2020- rtems_initialize_executive_ - Initialize RTEMS
    21 
    22 - rtems_shutdown_executive_ - Shutdown RTEMS
    2321
    2422Background
     
    4846RTEMS does not automatically delete the initialization tasks.
    4947
    50 System Initialization
    51 ---------------------
    52 
    53 System Initialization begins with board reset and continues through RTEMS
    54 initialization, initialization of all device drivers, and eventually a context
    55 switch to the first user task.  Remember, that interrupts are disabled during
    56 initialization and the *initialization context* is not a task in any sense and
    57 the user should be very careful during initialization.
    58 
    59 The BSP must ensure that the there is enough stack space reserved for the
    60 initialization context to successfully execute the initialization routines for
    61 all device drivers and, in multiprocessor configurations, the Multiprocessor
    62 Communications Interface Layer initialization routine.
    63 
    6448The Idle Task
    6549-------------
    6650
    6751The Idle Task is the lowest priority task in a system and executes only when no
    68 other task is ready to execute.  This default implementation of this task
     52other task is ready to execute.  The default implementation of this task
    6953consists of an infinite loop. RTEMS allows the Idle Task body to be replaced by
    7054a CPU specific implementation, a BSP specific implementation or an application
     
    8670------------------
    8771
    88 The Initialization Manager ``rtems_initialize_executive`` directives is called
    89 by the ``boot_card`` routine.  The ``boot_card`` routine is invoked by the
    90 Board Support Package once a basic C run-time environment is set up.  This
    91 consists of
     72The Initialization Manager :c:func:`rtems_initialize_executive()` directives is
     73called by the :c:ref:`boot_card()` routine which is invoked by the Board
     74Support Package once a basic C run-time environment is set up.  This consists
     75of
    9276
    9377- a valid and accessible text section, read-only data, read-write data and
     
    10185- disabled interrupts.
    10286
    103 The ``rtems_initialize_executive`` directive uses a system initialization
    104 linker set to initialize only those parts of the overall RTEMS feature set that
    105 is necessary for a particular application.  See :ref:`Linker Sets`.  Each RTEMS
    106 feature used the application may optionally register an initialization handler.
    107 The system initialization API is available via``#included <rtems/sysinit.h>``.
     87The :c:func:`rtems_initialize_executive()` directive uses a system
     88initialization :ref:`linker set <linker_sets>` to initialize only those parts
     89of the overall RTEMS feature set that is necessary for a particular
     90application.  Each RTEMS feature used the application may optionally register
     91an initialization handler.  The system initialization API is available via
     92:samp:`#included <rtems/sysinit.h>`.
    10893
    10994A list of all initialization steps follows.  Some steps are optional depending
     
    11196execute in the order presented here.
    11297
    113 ``RTEMS_SYSINIT_BSP_WORK_AREAS``
     98RTEMS_SYSINIT_BSP_WORK_AREAS
    11499    The work areas consisting of C Program Heap and the RTEMS Workspace are
    115100    initialized by the Board Support Package.  This step is mandatory.
    116101
    117 ``RTEMS_SYSINIT_BSP_START``
     102RTEMS_SYSINIT_BSP_START
    118103    Basic initialization step provided by the Board Support Package.  This step
    119104    is mandatory.
    120105
    121 ``RTEMS_SYSINIT_DATA_STRUCTURES``
     106RTEMS_SYSINIT_INITIAL_EXTENSIONS
     107    Registers the initial extensions.  This step is optional and depends on the
     108    application configuration.
     109
     110RTEMS_SYSINIT_MP_EARLY
     111    Early MPCI initialization.  This step is mandatory on MPCI configurations.
     112
     113RTEMS_SYSINIT_DATA_STRUCTURES
    122114    This directive is called when the Board Support Package has completed its
    123115    basic initialization and allows RTEMS to initialize the application
     
    127119    Interface (MPCI) Table.
    128120
    129 ``RTEMS_SYSINIT_BSP_LIBC``
    130     Depending on the application configuration the IO library and root
    131     filesystem is initialized.  This step is mandatory.
    132 
    133 ``RTEMS_SYSINIT_BEFORE_DRIVERS``
    134     This directive performs initialization that must occur between basis RTEMS
    135     data structure initialization and device driver initialization.  In
    136     particular, in a multiprocessor configuration, this directive will create
    137     the MPCI Server Task.
    138 
    139 ``RTEMS_SYSINIT_BSP_PRE_DRIVERS``
    140     Initialization step performed right before device drivers are initialized
    141     provided by the Board Support Package.  This step is mandatory.
    142 
    143 ``RTEMS_SYSINIT_DEVICE_DRIVERS``
     121RTEMS_SYSINIT_CPU_SET
     122    Initialization of system CPU set.  This step is optional and depends on the
     123    application configuration.
     124
     125RTEMS_SYSINIT_MP
     126    MPCI initialization.  This step is mandatory on MPCI configurations.
     127
     128RTEMS_SYSINIT_USER_EXTENSIONS
     129    Initialization of the User Extensions object class.  This step is optional
     130    and depends on the application configuration.
     131
     132RTEMS_SYSINIT_CLASSIC_TASKS
     133    Initialization of the Classic Tasks object class.  This step is optional
     134    and depends on the application configuration.
     135
     136RTEMS_SYSINIT_CLASSIC_TIMER
     137    Initialization of the Classic Timer object class.  This step is optional
     138    and depends on the application configuration.
     139
     140RTEMS_SYSINIT_CLASSIC_SIGNAL
     141    Initialization of the Classic Signal support.  This step is optional and
     142    depends on the application configuration.
     143
     144RTEMS_SYSINIT_CLASSIC_EVENT
     145    Initialization of the Classic Event support.  This step is optional and
     146    depends on the application configuration.  This step is only used on MPCI
     147    configurations.
     148
     149RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE
     150    Initialization of the Classic Message Queue object class.  This step is
     151    optional and depends on the application configuration.
     152
     153RTEMS_SYSINIT_CLASSIC_SEMAPHORE
     154    Initialization of the Classic Semaphore object class.  This step is
     155    optional and depends on the application configuration.
     156
     157RTEMS_SYSINIT_CLASSIC_PARTITION
     158    Initialization of the Classic Partition object class.  This step is
     159    optional and depends on the application configuration.
     160
     161RTEMS_SYSINIT_CLASSIC_REGION
     162    Initialization of the Classic Region object class.  This step is optional
     163    and depends on the application configuration.
     164
     165RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY
     166    Initialization of the Classic Dual-Ported Memory object class.  This step
     167    is optional and depends on the application configuration.
     168
     169RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC
     170    Initialization of the Classic Rate-Monotonic object class.  This step is
     171    optional and depends on the application configuration.
     172
     173RTEMS_SYSINIT_CLASSIC_BARRIER
     174    Initialization of the Classic Barrier object class.  This step is optional
     175    and depends on the application configuration.
     176
     177RTEMS_SYSINIT_POSIX_SIGNALS
     178    Initialization of the POSIX Signals support.  This step is optional and
     179    depends on the application configuration.
     180
     181RTEMS_SYSINIT_POSIX_THREADS
     182    Initialization of the POSIX Threads object class.  This step is optional
     183    and depends on the application configuration.
     184
     185RTEMS_SYSINIT_POSIX_CONDITION_VARIABLE
     186    Initialization of the POSIX Condition Variable object class.  This step is
     187    optional and depends on the application configuration.
     188
     189RTEMS_SYSINIT_POSIX_MUTEX
     190    Initialization of the POSIX Mutex object class.  This step is optional and
     191    depends on the application configuration.
     192
     193RTEMS_SYSINIT_POSIX_MESSAGE_QUEUE
     194    Initialization of the POSIX Message Queue object class.  This step is
     195    optional and depends on the application configuration.
     196
     197RTEMS_SYSINIT_POSIX_SEMAPHORE
     198    Initialization of the POSIX Semaphore object class.  This step is optional
     199    and depends on the application configuration.
     200
     201RTEMS_SYSINIT_POSIX_TIMER
     202    Initialization of the POSIX Timer object class.  This step is optional and
     203    depends on the application configuration.
     204
     205RTEMS_SYSINIT_POSIX_BARRIER
     206    Initialization of the POSIX Barrier object class.  This step is optional
     207    and depends on the application configuration.
     208
     209RTEMS_SYSINIT_POSIX_RWLOCK
     210    Initialization of the POSIX Read-Write Locks object class.  This step is
     211    optional and depends on the application configuration.
     212
     213RTEMS_SYSINIT_POSIX_CLEANUP
     214    Initialization of the POSIX Cleanup support.  This step is optional and
     215    depends on the application configuration.
     216
     217RTEMS_SYSINIT_POSIX_KEYS
     218    Initialization of the POSIX Keys object class.  This step is optional
     219    and depends on the application configuration.
     220
     221RTEMS_SYSINIT_IDLE_THREADS
     222    Initialization of idle threads.  This step is mandatory.
     223
     224RTEMS_SYSINIT_LIBIO
     225    Initialization of IO library.  This step is optional and depends on the
     226    application configuration.
     227
     228RTEMS_SYSINIT_ROOT_FILESYSTEM
     229    Initialization of the root filesystem.  This step is optional and depends
     230    on the application configuration.
     231
     232RTEMS_SYSINIT_DRVMGR
     233    Driver manager initialization.  This step is optional and depends on the
     234    application configuration.  Only available if the driver manager is
     235    enabled.
     236
     237RTEMS_SYSINIT_MP_SERVER
     238    MPCI server initialization.  This step is mandatory on MPCI configurations.
     239
     240RTEMS_SYSINIT_BSP_PRE_DRIVERS
     241    Initialization step performed right before device drivers are initialized.
     242    This step is mandatory.
     243
     244RTEMS_SYSINIT_DRVMGR_LEVEL_1
     245    Driver manager level 1 initialization.  This step is optional and depends
     246    on the application configuration.  Only available if the driver manager is
     247    enabled.
     248
     249RTEMS_SYSINIT_DEVICE_DRIVERS
    144250    This step initializes all statically configured device drivers and performs
    145251    all RTEMS initialization which requires device drivers to be initialized.
     
    148254    synchronize with the other nodes in the system.
    149255
    150 ``RTEMS_SYSINIT_BSP_POST_DRIVERS``
    151     Initialization step performed right after device drivers are initialized
    152     provided by the Board Support Package.  This step is mandatory.
    153 
    154 The final action of the ``rtems_initialize_executive`` directive is to start
    155 multitasking.  RTEMS does not return to the initialization context and the
    156 initialization stack may be re-used for interrupt processing.
     256RTEMS_SYSINIT_DRVMGR_LEVEL_2
     257    Driver manager level 2 initialization.  This step is optional and depends
     258    on the application configuration.  Only available if the driver manager is
     259    enabled.
     260
     261RTEMS_SYSINIT_DRVMGR_LEVEL_3
     262    Driver manager level 3 initialization.  This step is optional and depends
     263    on the application configuration.  Only available if the driver manager is
     264    enabled.
     265
     266RTEMS_SYSINIT_DRVMGR_LEVEL_4
     267    Driver manager level 4 initialization.  This step is optional and depends
     268    on the application configuration.  Only available if the driver manager is
     269    enabled.
     270
     271RTEMS_SYSINIT_MP_FINALIZE
     272    Finalize MPCI initialization.  This step is mandatory on MPCI
     273    configurations.
     274
     275RTEMS_SYSINIT_CLASSIC_USER_TASKS
     276    Creates and starts the Classic initialization tasks.  This step is optional
     277    and depends on the application configuration.
     278
     279RTEMS_SYSINIT_POSIX_USER_THREADS
     280    Creates POSIX initialization threads.  This step is optional and depends on
     281    the application configuration.
     282
     283RTEMS_SYSINIT_STD_FILE_DESCRIPTORS
     284    Open the standard input, output and error file descriptors.  This step is
     285    optional and depends on the application configuration.
     286
     287The final action of the :c:func:`rtems_initialize_executive()` directive is to
     288start multitasking and switch to the highest priority ready thread.  RTEMS does
     289not return to the initialization context and the initialization stack may be
     290re-used for interrupt processing.
    157291
    158292Many of RTEMS actions during initialization are based upon the contents of the
    159293Configuration Table.  For more information regarding the format and contents of
    160294this table, please refer to the chapter :ref:`Configuring a System`.
    161 
    162 The final action in the initialization sequence is the initiation of
    163 multitasking.  When the scheduler and dispatcher are enabled, the highest
    164 priority, ready task will be dispatched to run.  Control will not be returned
    165 to the Board Support Package after multitasking is enabled.  The initialization
    166 stack may be re-used for interrupt processing.
    167 
    168 Shutting Down RTEMS
    169 -------------------
    170 
    171 The ``rtems_shutdown_executive`` directive is invoked by the application to end
    172 multitasking and terminate the system.
    173295
    174296Directives
     
    197319
    198320DIRECTIVE STATUS CODES:
    199     NONE
     321    NONE - This function will not return to the caller.
    200322
    201323DESCRIPTION:
     
    204326
    205327NOTES:
    206     This directive should be called by ``boot_card`` only.
     328    This directive should be called by :c:func:`boot_card()` only.
    207329
    208330    This directive *does not return* to the caller.  Errors in the
    209331    initialization sequence are usually fatal and lead to a system termination.
    210 
    211 .. raw:: latex
    212 
    213    \clearpage
    214 
    215 .. _rtems_shutdown_executive:
    216 
    217 SHUTDOWN_EXECUTIVE - Shutdown RTEMS
    218 -----------------------------------
    219 .. index:: shutdown RTEMS
    220 
    221 .. index:: rtems_shutdown_executive
    222 CALLING SEQUENCE:
    223     .. code-block:: c
    224 
    225         void rtems_shutdown_executive(
    226             uint32_t result
    227         );
    228 
    229 DIRECTIVE STATUS CODES:
    230     NONE
    231 
    232 DESCRIPTION:
    233     This directive is called when the application wishes to shutdown RTEMS.
    234     The system is terminated with a fatal source of ``RTEMS_FATAL_SOURCE_EXIT``
    235     and the specified ``result`` code.
    236 
    237 NOTES:
    238     This directive *must* be the last RTEMS directive invoked by an application
    239     and it *does not return* to the caller.
    240 
    241     This directive may be called any time.
  • c-user/linker_sets.rst

    r00ffe1f r6fa32c0  
    55.. COMMENT: All rights reserved.
    66
    7 .. _Linker Sets:
     7.. _linker_sets:
    88
    99Linker Sets
Note: See TracChangeset for help on using the changeset viewer.