RTEMS  5.1
sysinit.h
1 /*
2  * Copyright (c) 2015, 2020 embedded brains GmbH. All rights reserved.
3  *
4  * embedded brains GmbH
5  * Dornierstr. 4
6  * 82178 Puchheim
7  * Germany
8  * <rtems@embedded-brains.de>
9  *
10  * The license and distribution terms for this file may be
11  * found in the file LICENSE in this distribution or at
12  * http://www.rtems.org/license/LICENSE.
13  */
14 
15 #ifndef _RTEMS_SYSINIT_H
16 #define _RTEMS_SYSINIT_H
17 
18 #include <rtems/linkersets.h>
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif /* __cplusplus */
23 
24 /*
25  * The value of each module define must consist of exactly six hexadecimal
26  * digits without a 0x-prefix. A 0x-prefix is concatenated with the module and
27  * order values to form a proper integer literal.
28  */
29 #define RTEMS_SYSINIT_RECORD 000100
30 #define RTEMS_SYSINIT_BSP_EARLY 000140
31 #define RTEMS_SYSINIT_MEMORY 000180
32 #define RTEMS_SYSINIT_DIRTY_MEMORY 0001c0
33 #define RTEMS_SYSINIT_ZERO_MEMORY 0001e0
34 #define RTEMS_SYSINIT_ISR_STACK 000200
35 #define RTEMS_SYSINIT_PER_CPU_DATA 000220
36 #define RTEMS_SYSINIT_SBRK 000240
37 #define RTEMS_SYSINIT_WORKSPACE 000260
38 #define RTEMS_SYSINIT_MALLOC 000280
39 #define RTEMS_SYSINIT_BSP_START 000300
40 #define RTEMS_SYSINIT_CPU_COUNTER 000400
41 #define RTEMS_SYSINIT_INITIAL_EXTENSIONS 000500
42 #define RTEMS_SYSINIT_MP_EARLY 000600
43 #define RTEMS_SYSINIT_DATA_STRUCTURES 000700
44 #define RTEMS_SYSINIT_MP 000800
45 #define RTEMS_SYSINIT_USER_EXTENSIONS 000900
46 #define RTEMS_SYSINIT_CLASSIC_TASKS 000a00
47 #define RTEMS_SYSINIT_CLASSIC_TASKS_MP 000a80
48 #define RTEMS_SYSINIT_CLASSIC_TIMER 000b00
49 #define RTEMS_SYSINIT_CLASSIC_SIGNAL_MP 000c00
50 #define RTEMS_SYSINIT_CLASSIC_EVENT_MP 000d00
51 #define RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE 000e00
52 #define RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE_MP 000e80
53 #define RTEMS_SYSINIT_CLASSIC_SEMAPHORE 000f00
54 #define RTEMS_SYSINIT_CLASSIC_SEMAPHORE_MP 000f80
55 #define RTEMS_SYSINIT_CLASSIC_PARTITION 001000
56 #define RTEMS_SYSINIT_CLASSIC_PARTITION_MP 001080
57 #define RTEMS_SYSINIT_CLASSIC_REGION 001100
58 #define RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY 001200
59 #define RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC 001300
60 #define RTEMS_SYSINIT_CLASSIC_BARRIER 001400
61 #define RTEMS_SYSINIT_POSIX_SIGNALS 001500
62 #define RTEMS_SYSINIT_POSIX_THREADS 001600
63 #define RTEMS_SYSINIT_POSIX_MESSAGE_QUEUE 001700
64 #define RTEMS_SYSINIT_POSIX_SEMAPHORE 001800
65 #define RTEMS_SYSINIT_POSIX_TIMER 001900
66 #define RTEMS_SYSINIT_POSIX_SHM 001a00
67 #define RTEMS_SYSINIT_POSIX_KEYS 001b00
68 #define RTEMS_SYSINIT_POSIX_CLEANUP 001c00
69 #define RTEMS_SYSINIT_IDLE_THREADS 001d00
70 #define RTEMS_SYSINIT_LIBIO 001e00
71 #define RTEMS_SYSINIT_USER_ENVIRONMENT 001e80
72 #define RTEMS_SYSINIT_ROOT_FILESYSTEM 001f00
73 #define RTEMS_SYSINIT_DRVMGR 002000
74 #define RTEMS_SYSINIT_MP_SERVER 002100
75 #define RTEMS_SYSINIT_BSP_PRE_DRIVERS 002200
76 #define RTEMS_SYSINIT_DRVMGR_LEVEL_1 002300
77 #define RTEMS_SYSINIT_DEVICE_DRIVERS 002400
78 #define RTEMS_SYSINIT_DRVMGR_LEVEL_2 002500
79 #define RTEMS_SYSINIT_DRVMGR_LEVEL_3 002600
80 #define RTEMS_SYSINIT_DRVMGR_LEVEL_4 002700
81 #define RTEMS_SYSINIT_MP_FINALIZE 002800
82 #define RTEMS_SYSINIT_CLASSIC_USER_TASKS 002900
83 #define RTEMS_SYSINIT_POSIX_USER_THREADS 002a00
84 #define RTEMS_SYSINIT_STD_FILE_DESCRIPTORS 002b00
85 #define RTEMS_SYSINIT_LAST ffffff
86 
87 /*
88  * The value of each order define must consist of exactly two hexadecimal
89  * digits without a 0x-prefix. A 0x-prefix is concatenated with the module and
90  * order values to form a proper integer literal.
91  */
92 #define RTEMS_SYSINIT_ORDER_FIRST 00
93 #define RTEMS_SYSINIT_ORDER_SECOND 01
94 #define RTEMS_SYSINIT_ORDER_THIRD 02
95 #define RTEMS_SYSINIT_ORDER_FOURTH 03
96 #define RTEMS_SYSINIT_ORDER_FIFTH 04
97 #define RTEMS_SYSINIT_ORDER_SIXTH 05
98 #define RTEMS_SYSINIT_ORDER_SEVENTH 06
99 #define RTEMS_SYSINIT_ORDER_EIGHTH 07
100 #define RTEMS_SYSINIT_ORDER_NINETH 08
101 #define RTEMS_SYSINIT_ORDER_TENTH 09
102 #define RTEMS_SYSINIT_ORDER_MIDDLE 80
103 #define RTEMS_SYSINIT_ORDER_LAST_BUT_9 f6
104 #define RTEMS_SYSINIT_ORDER_LAST_BUT_8 f7
105 #define RTEMS_SYSINIT_ORDER_LAST_BUT_7 f8
106 #define RTEMS_SYSINIT_ORDER_LAST_BUT_6 f9
107 #define RTEMS_SYSINIT_ORDER_LAST_BUT_5 fa
108 #define RTEMS_SYSINIT_ORDER_LAST_BUT_4 fb
109 #define RTEMS_SYSINIT_ORDER_LAST_BUT_3 fc
110 #define RTEMS_SYSINIT_ORDER_LAST_BUT_2 fd
111 #define RTEMS_SYSINIT_ORDER_LAST_BUT_1 fe
112 #define RTEMS_SYSINIT_ORDER_LAST ff
113 
114 typedef void ( *rtems_sysinit_handler )( void );
115 
116 typedef struct {
117  rtems_sysinit_handler handler;
119 
120 /* The enum helps to detect typos in the module and order parameters */
121 #define _RTEMS_SYSINIT_INDEX_ITEM( handler, index ) \
122  enum { _Sysinit_##handler = index }; \
123  RTEMS_LINKER_ROSET_ITEM_ORDERED( \
124  _Sysinit, \
125  rtems_sysinit_item, \
126  handler, \
127  index \
128  ) = { handler }
129 
130 /* Create index from module and order */
131 #define _RTEMS_SYSINIT_ITEM( handler, module, order ) \
132  _RTEMS_SYSINIT_INDEX_ITEM( handler, 0x##module##order )
133 
134 /* Perform parameter expansion */
135 #define RTEMS_SYSINIT_ITEM( handler, module, order ) \
136  _RTEMS_SYSINIT_ITEM( handler, module, order )
137 
142 void _Sysinit_Verbose( void );
143 
144 #ifdef __cplusplus
145 }
146 #endif /* __cplusplus */
147 
148 #endif /* _RTEMS_SYSINIT_H */
Definition: sysinit.h:116