source: rtems/cpukit/include/rtems/sysinit.h @ 5ec5503

Last change on this file since 5ec5503 was 5ec5503, checked in by Sebastian Huber <sebastian.huber@…>, on May 22, 2018 at 7:10:06 AM

Reassign system initilization order numbers

Assign each system initialization step a number divisible by 256 to
allow more easily future additions. Keep the order as is.

  • Property mode set to 100644
File size: 4.4 KB
Line 
1/*
2 * Copyright (c) 2015 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
21extern "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_BSP_WORK_AREAS             000100
30#define RTEMS_SYSINIT_BSP_START                  000200
31#define RTEMS_SYSINIT_INITIAL_EXTENSIONS         000400
32#define RTEMS_SYSINIT_MP_EARLY                   000500
33#define RTEMS_SYSINIT_DATA_STRUCTURES            000600
34#define RTEMS_SYSINIT_MP                         000700
35#define RTEMS_SYSINIT_USER_EXTENSIONS            000900
36#define RTEMS_SYSINIT_CLASSIC_TASKS              000a00
37#define RTEMS_SYSINIT_CLASSIC_TIMER              000b00
38#define RTEMS_SYSINIT_CLASSIC_SIGNAL             000c00
39#define RTEMS_SYSINIT_CLASSIC_EVENT              000d00
40#define RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE      000e00
41#define RTEMS_SYSINIT_CLASSIC_SEMAPHORE          000f00
42#define RTEMS_SYSINIT_CLASSIC_PARTITION          001000
43#define RTEMS_SYSINIT_CLASSIC_REGION             001100
44#define RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY 001200
45#define RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC     001300
46#define RTEMS_SYSINIT_CLASSIC_BARRIER            001400
47#define RTEMS_SYSINIT_POSIX_SIGNALS              001500
48#define RTEMS_SYSINIT_POSIX_THREADS              001600
49#define RTEMS_SYSINIT_POSIX_MESSAGE_QUEUE        001700
50#define RTEMS_SYSINIT_POSIX_SEMAPHORE            001800
51#define RTEMS_SYSINIT_POSIX_TIMER                001900
52#define RTEMS_SYSINIT_POSIX_SHM                  001a00
53#define RTEMS_SYSINIT_POSIX_KEYS                 001b00
54#define RTEMS_SYSINIT_POSIX_CLEANUP              001c00
55#define RTEMS_SYSINIT_IDLE_THREADS               001d00
56#define RTEMS_SYSINIT_LIBIO                      001e00
57#define RTEMS_SYSINIT_ROOT_FILESYSTEM            001f00
58#define RTEMS_SYSINIT_DRVMGR                     002000
59#define RTEMS_SYSINIT_MP_SERVER                  002100
60#define RTEMS_SYSINIT_BSP_PRE_DRIVERS            002200
61#define RTEMS_SYSINIT_DRVMGR_LEVEL_1             002300
62#define RTEMS_SYSINIT_DEVICE_DRIVERS             002400
63#define RTEMS_SYSINIT_DRVMGR_LEVEL_2             002500
64#define RTEMS_SYSINIT_DRVMGR_LEVEL_3             002600
65#define RTEMS_SYSINIT_DRVMGR_LEVEL_4             002700
66#define RTEMS_SYSINIT_MP_FINALIZE                002800
67#define RTEMS_SYSINIT_CLASSIC_USER_TASKS         002900
68#define RTEMS_SYSINIT_POSIX_USER_THREADS         002a00
69#define RTEMS_SYSINIT_STD_FILE_DESCRIPTORS       002b00
70#define RTEMS_SYSINIT_LAST                       ffffff
71
72/*
73 * The value of each order define must consist of exactly two hexadecimal
74 * digits without a 0x-prefix.  A 0x-prefix is concatenated with the module and
75 * order values to form a proper integer literal.
76 */
77#define RTEMS_SYSINIT_ORDER_FIRST   00
78#define RTEMS_SYSINIT_ORDER_SECOND  01
79#define RTEMS_SYSINIT_ORDER_THIRD   02
80#define RTEMS_SYSINIT_ORDER_FOURTH  03
81#define RTEMS_SYSINIT_ORDER_FIFTH   04
82#define RTEMS_SYSINIT_ORDER_SIXTH   05
83#define RTEMS_SYSINIT_ORDER_SEVENTH 06
84#define RTEMS_SYSINIT_ORDER_EIGHTH  07
85#define RTEMS_SYSINIT_ORDER_NINETH  08
86#define RTEMS_SYSINIT_ORDER_TENTH   09
87#define RTEMS_SYSINIT_ORDER_MIDDLE  80
88#define RTEMS_SYSINIT_ORDER_LAST    ff
89
90typedef void ( *rtems_sysinit_handler )( void );
91
92typedef struct {
93  rtems_sysinit_handler handler;
94} rtems_sysinit_item;
95
96/* The enum helps to detect typos in the module and order parameters */
97#define _RTEMS_SYSINIT_INDEX_ITEM( handler, index ) \
98  enum { _Sysinit_##handler = index }; \
99  RTEMS_LINKER_ROSET_ITEM_ORDERED( \
100    _Sysinit, \
101    rtems_sysinit_item, \
102    handler, \
103    index \
104  ) = { handler }
105
106/* Create index from module and order */
107#define _RTEMS_SYSINIT_ITEM( handler, module, order ) \
108  _RTEMS_SYSINIT_INDEX_ITEM( handler, 0x##module##order )
109
110/* Perform parameter expansion */
111#define RTEMS_SYSINIT_ITEM( handler, module, order ) \
112  _RTEMS_SYSINIT_ITEM( handler, module, order )
113
114#ifdef __cplusplus
115}
116#endif /* __cplusplus */
117
118#endif /* _RTEMS_SYSINIT_H */
Note: See TracBrowser for help on using the repository browser.