source: rtems/cpukit/sapi/include/rtems/init.h @ 599d71f

5
Last change on this file since 599d71f was d0c39838, checked in by Sebastian Huber <sebastian.huber@…>, on 09/22/15 at 14:21:12

Use linker set for system initialization

Make rtems_initialize_data_structures(),
rtems_initialize_before_drivers() and rtems_initialize_device_drivers()
static. Rename rtems_initialize_start_multitasking() to
rtems_initialize_executive() and call the registered system
initialization handlers in this function. Add system initialization API
available via #include <rtems/sysinit.h>. Update the documentation
accordingly.

This is no functional change, only the method to call the existing
initialization routines changes. Instead of direct function calls a
table of function pointers contained in the new RTEMS system
initialization linker set is used. This table looks like this (the
actual addresses depend on the target).

nm *.exe | grep _Linker | sort
0201a2d0 D _Linker_setSysinit_begin
0201a2d0 D _Linker_set
Sysinit_bsp_work_area_initialize
0201a2d4 D _Linker_setSysinit_bsp_start
0201a2d8 D _Linker_set
Sysinit_rtems_initialize_data_structures
0201a2dc D _Linker_setSysinit_bsp_libc_init
0201a2e0 D _Linker_set
Sysinit_rtems_initialize_before_drivers
0201a2e4 D _Linker_setSysinit_bsp_predriver_hook
0201a2e8 D _Linker_set
Sysinit_rtems_initialize_device_drivers
0201a2ec D _Linker_setSysinit_bsp_postdriver_hook
0201a2f0 D _Linker_set
Sysinit_end

Add test sptests/spsysinit01.

Update #2408.

  • Property mode set to 100644
File size: 2.1 KB
Line 
1/**
2 * @file
3 *
4 * @brief Constants and Structures Associated
5 * with the Initialization Manager
6 *
7 * This include file contains all the constants and structures associated
8 * with the Initialization Manager.  This manager is responsible for
9 * initializing RTEMS, creating and starting all configured initialization
10 * tasks, invoking the initialization routine for each user-supplied device
11 * driver, and initializing the optional multiprocessor layer.
12 *
13 * This manager provides directives to:
14 *
15 *    + initialize the RTEMS executive
16 *    + shutdown the RTEMS executive
17 */
18
19/*
20 *  COPYRIGHT (c) 1989-2008.
21 *  On-Line Applications Research Corporation (OAR).
22 *
23 *  The license and distribution terms for this file may be
24 *  found in the file LICENSE in this distribution or at
25 *  http://www.rtems.org/license/LICENSE.
26 */
27
28#ifndef _RTEMS_INIT_H
29#define _RTEMS_INIT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include <rtems/rtems/types.h>
36#include <rtems/config.h>
37#include <rtems/rtems/intr.h>
38
39#if defined(RTEMS_MULTIPROCESSING)
40/**
41 * The following defines the default Multiprocessing Configuration
42 * Table.  This table is used in a single processor system.
43 */
44extern const rtems_multiprocessing_table
45  _Initialization_Default_multiprocessing_table;
46#endif
47
48/**
49 * @brief Initializes the system and starts multitasking.
50 *
51 * Iterates through the system initialization linker set and invokes the
52 * registered handlers.  The final step is to start multitasking.
53 *
54 * This directive should be called by boot_card() only.
55 *
56 * This directive does not return.
57 */
58void rtems_initialize_executive(void)
59  RTEMS_NO_RETURN;
60
61/**
62 * @brief Shutdown the RTEMS environment.
63 *
64 * This routine implements the rtems_shutdown_executive directive.  The
65 * invocation of this directive results in the RTEMS environment being
66 * shutdown and multitasking halted.  The system is terminated with a fatal
67 * source of RTEMS_FATAL_SOURCE_EXIT and the specified result code.
68 */
69void rtems_shutdown_executive(
70  uint32_t   result
71) RTEMS_NO_RETURN;
72
73#ifdef __cplusplus
74}
75#endif
76
77#endif
78/* end of include file */
Note: See TracBrowser for help on using the repository browser.