[d0c39838] | 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 |
---|
| 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_BSP_WORK_AREAS 000100 |
---|
| 30 | #define RTEMS_SYSINIT_BSP_START 000200 |
---|
[a853c851] | 31 | #define RTEMS_SYSINIT_INITIAL_EXTENSIONS 000300 |
---|
| 32 | #define RTEMS_SYSINIT_DATA_STRUCTURES 000301 |
---|
[190169fe] | 33 | #define RTEMS_SYSINIT_CPU_SET 00030d |
---|
[92bb345] | 34 | #define RTEMS_SYSINIT_USER_EXTENSIONS 000320 |
---|
[565672a] | 35 | #define RTEMS_SYSINIT_CLASSIC_TASKS 000340 |
---|
[26335844] | 36 | #define RTEMS_SYSINIT_CLASSIC_TIMER 000341 |
---|
[a7f36829] | 37 | #define RTEMS_SYSINIT_CLASSIC_SIGNAL 000342 |
---|
[ae85b066] | 38 | #define RTEMS_SYSINIT_CLASSIC_EVENT 000343 |
---|
[ed8b00e6] | 39 | #define RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE 000344 |
---|
[cbaac1f7] | 40 | #define RTEMS_SYSINIT_CLASSIC_SEMAPHORE 000345 |
---|
[fd3cc36f] | 41 | #define RTEMS_SYSINIT_CLASSIC_PARTITION 000346 |
---|
[365456cc] | 42 | #define RTEMS_SYSINIT_CLASSIC_REGION 000347 |
---|
[af12278] | 43 | #define RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY 000348 |
---|
[b377e3f] | 44 | #define RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC 000349 |
---|
[97d94ff] | 45 | #define RTEMS_SYSINIT_CLASSIC_BARRIER 00034a |
---|
[04436ae7] | 46 | #define RTEMS_SYSINIT_POSIX_SIGNALS 000360 |
---|
[ef1a985f] | 47 | #define RTEMS_SYSINIT_POSIX_THREADS 000361 |
---|
[f4fee477] | 48 | #define RTEMS_SYSINIT_POSIX_CONDITION_VARIABLE 000362 |
---|
[9871f5dc] | 49 | #define RTEMS_SYSINIT_POSIX_MUTEX 000363 |
---|
[3015ed64] | 50 | #define RTEMS_SYSINIT_POSIX_MESSAGE_QUEUE 000364 |
---|
[2189b3e] | 51 | #define RTEMS_SYSINIT_POSIX_SEMAPHORE 000365 |
---|
[6c678557] | 52 | #define RTEMS_SYSINIT_POSIX_TIMER 000366 |
---|
[e4e7f14] | 53 | #define RTEMS_SYSINIT_POSIX_BARRIER 000367 |
---|
[76a8328] | 54 | #define RTEMS_SYSINIT_POSIX_RWLOCK 000368 |
---|
[4eee8781] | 55 | #define RTEMS_SYSINIT_POSIX_SPINLOCK 000369 |
---|
[cef5675] | 56 | #define RTEMS_SYSINIT_POSIX_CLEANUP 00036a |
---|
[2605a489] | 57 | #define RTEMS_SYSINIT_POSIX_KEYS 00036b |
---|
[36b86d7] | 58 | #define RTEMS_SYSINIT_IDLE_THREADS 000380 |
---|
[ca4602e] | 59 | #define RTEMS_SYSINIT_LIBIO 000400 |
---|
[3d36164f] | 60 | #define RTEMS_SYSINIT_ROOT_FILESYSTEM 000401 |
---|
[6bf44a5] | 61 | #define RTEMS_SYSINIT_DRVMGR 000500 |
---|
| 62 | #define RTEMS_SYSINIT_BEFORE_DRIVERS 000501 |
---|
[d0c39838] | 63 | #define RTEMS_SYSINIT_BSP_PRE_DRIVERS 000600 |
---|
[6bf44a5] | 64 | #define RTEMS_SYSINIT_DRVMGR_LEVEL_1 000700 |
---|
| 65 | #define RTEMS_SYSINIT_DEVICE_DRIVERS 000701 |
---|
| 66 | #define RTEMS_SYSINIT_DRVMGR_LEVEL_2 000702 |
---|
| 67 | #define RTEMS_SYSINIT_DRVMGR_LEVEL_3 000703 |
---|
| 68 | #define RTEMS_SYSINIT_DRVMGR_LEVEL_4 000704 |
---|
[ca4602e] | 69 | #define RTEMS_SYSINIT_STD_FILE_DESCRIPTORS 000800 |
---|
[d0c39838] | 70 | |
---|
| 71 | /* |
---|
| 72 | * The value of each order define must consist of exactly two hexadecimal |
---|
| 73 | * digits without a 0x-prefix. A 0x-prefix is concatenated with the module and |
---|
| 74 | * order values to form a proper integer literal. |
---|
| 75 | */ |
---|
| 76 | #define RTEMS_SYSINIT_ORDER_FIRST 00 |
---|
| 77 | #define RTEMS_SYSINIT_ORDER_MIDDLE 08 |
---|
| 78 | #define RTEMS_SYSINIT_ORDER_LAST 0f |
---|
| 79 | |
---|
| 80 | typedef void ( *rtems_sysinit_handler )( void ); |
---|
| 81 | |
---|
| 82 | typedef struct { |
---|
| 83 | rtems_sysinit_handler handler; |
---|
| 84 | } rtems_sysinit_item; |
---|
| 85 | |
---|
| 86 | /* The enum helps to detect typos in the module and order parameters */ |
---|
| 87 | #define _RTEMS_SYSINIT_INDEX_ITEM( handler, index ) \ |
---|
| 88 | enum { _Sysinit_##handler = index }; \ |
---|
| 89 | RTEMS_LINKER_ROSET_ITEM_ORDERED( \ |
---|
| 90 | _Sysinit, \ |
---|
| 91 | rtems_sysinit_item, \ |
---|
| 92 | handler, \ |
---|
| 93 | index \ |
---|
| 94 | ) = { handler } |
---|
| 95 | |
---|
| 96 | /* Create index from module and order */ |
---|
| 97 | #define _RTEMS_SYSINIT_ITEM( handler, module, order ) \ |
---|
| 98 | _RTEMS_SYSINIT_INDEX_ITEM( handler, 0x##module##order ) |
---|
| 99 | |
---|
| 100 | /* Perform parameter expansion */ |
---|
| 101 | #define RTEMS_SYSINIT_ITEM( handler, module, order ) \ |
---|
| 102 | _RTEMS_SYSINIT_ITEM( handler, module, order ) |
---|
| 103 | |
---|
| 104 | #ifdef __cplusplus |
---|
| 105 | } |
---|
| 106 | #endif /* __cplusplus */ |
---|
| 107 | |
---|
| 108 | #endif /* _RTEMS_SYSINIT_H */ |
---|