blob: 6351e12106148af7352747b76456bda5f00b8dd6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
/*
* Copyright (c) 2015 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
* Dornierstr. 4
* 82178 Puchheim
* Germany
* <rtems@embedded-brains.de>
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.org/license/LICENSE.
*/
#ifndef _RTEMS_SYSINIT_H
#define _RTEMS_SYSINIT_H
#include <rtems/linkersets.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*
* The value of each module define must consist of exactly six hexadecimal
* digits without a 0x-prefix. A 0x-prefix is concatenated with the module and
* order values to form a proper integer literal.
*/
#define RTEMS_SYSINIT_BSP_WORK_AREAS 000100
#define RTEMS_SYSINIT_BSP_START 000200
#define RTEMS_SYSINIT_INITIAL_EXTENSIONS 000300
#define RTEMS_SYSINIT_DATA_STRUCTURES 000301
#define RTEMS_SYSINIT_USER_EXTENSIONS 000320
#define RTEMS_SYSINIT_CLASSIC_TASKS 000340
#define RTEMS_SYSINIT_CLASSIC_TIMER 000341
#define RTEMS_SYSINIT_CLASSIC_SIGNAL 000342
#define RTEMS_SYSINIT_IDLE_THREADS 000380
#define RTEMS_SYSINIT_BSP_LIBC 000400
#define RTEMS_SYSINIT_BEFORE_DRIVERS 000500
#define RTEMS_SYSINIT_BSP_PRE_DRIVERS 000600
#define RTEMS_SYSINIT_DEVICE_DRIVERS 000700
#define RTEMS_SYSINIT_BSP_POST_DRIVERS 000800
/*
* The value of each order define must consist of exactly two hexadecimal
* digits without a 0x-prefix. A 0x-prefix is concatenated with the module and
* order values to form a proper integer literal.
*/
#define RTEMS_SYSINIT_ORDER_FIRST 00
#define RTEMS_SYSINIT_ORDER_MIDDLE 08
#define RTEMS_SYSINIT_ORDER_LAST 0f
typedef void ( *rtems_sysinit_handler )( void );
typedef struct {
rtems_sysinit_handler handler;
} rtems_sysinit_item;
/* The enum helps to detect typos in the module and order parameters */
#define _RTEMS_SYSINIT_INDEX_ITEM( handler, index ) \
enum { _Sysinit_##handler = index }; \
RTEMS_LINKER_ROSET_ITEM_ORDERED( \
_Sysinit, \
rtems_sysinit_item, \
handler, \
index \
) = { handler }
/* Create index from module and order */
#define _RTEMS_SYSINIT_ITEM( handler, module, order ) \
_RTEMS_SYSINIT_INDEX_ITEM( handler, 0x##module##order )
/* Perform parameter expansion */
#define RTEMS_SYSINIT_ITEM( handler, module, order ) \
_RTEMS_SYSINIT_ITEM( handler, module, order )
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* _RTEMS_SYSINIT_H */
|