File indexing completed on 2025-05-11 08:24:12
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 #ifndef _RTEMS_CONFDEFS_INITTASK_H
0041 #define _RTEMS_CONFDEFS_INITTASK_H
0042
0043 #ifndef __CONFIGURATION_TEMPLATE_h
0044 #error "Do not include this file directly, use <rtems/confdefs.h> instead"
0045 #endif
0046
0047 #ifdef CONFIGURE_INIT
0048
0049 #define _CONFIGURE_ASSERT_NOT_NULL( _type, _value ) \
0050 ( ( _value ) != NULL ? ( _value ) : \
0051 ( _type ) sizeof( int[ ( _value ) != NULL ? 1 : -1 ] ) )
0052
0053 #ifdef CONFIGURE_RTEMS_INIT_TASKS_TABLE
0054
0055 #include <rtems/confdefs/percpu.h>
0056 #include <rtems/confdefs/threads.h>
0057 #include <rtems/rtems/object.h>
0058 #include <rtems/rtems/tasksdata.h>
0059 #include <rtems/sysinit.h>
0060
0061 #ifndef CONFIGURE_INIT_TASK_ATTRIBUTES
0062 #define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES
0063 #endif
0064
0065 #ifndef CONFIGURE_INIT_TASK_INITIAL_MODES
0066 #ifdef RTEMS_SMP
0067 #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES
0068 #else
0069 #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT
0070 #endif
0071 #endif
0072
0073 #ifndef CONFIGURE_INIT_TASK_NAME
0074 #define CONFIGURE_INIT_TASK_NAME rtems_build_name( 'U', 'I', '1', ' ' )
0075 #endif
0076
0077 #ifndef CONFIGURE_INIT_TASK_PRIORITY
0078 #define CONFIGURE_INIT_TASK_PRIORITY 1
0079 #endif
0080
0081 #ifdef __cplusplus
0082 extern "C" {
0083 #endif
0084
0085 #ifndef CONFIGURE_INIT_TASK_ENTRY_POINT
0086 rtems_task Init( rtems_task_argument );
0087 #define CONFIGURE_INIT_TASK_ENTRY_POINT Init
0088
0089 #ifndef CONFIGURE_INIT_TASK_ARGUMENTS
0090 extern const char *bsp_boot_cmdline;
0091 #define CONFIGURE_INIT_TASK_ARGUMENTS \
0092 ( (rtems_task_argument) &bsp_boot_cmdline )
0093 #endif
0094 #endif
0095
0096 #ifndef CONFIGURE_INIT_TASK_ARGUMENTS
0097 #define CONFIGURE_INIT_TASK_ARGUMENTS 0
0098 #endif
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109 #pragma GCC diagnostic push
0110 #pragma GCC diagnostic ignored "-Waddress"
0111 #pragma GCC diagnostic ignored "-Wpragmas"
0112 #pragma GCC diagnostic ignored "-Wtautological-pointer-compare"
0113
0114 #ifdef CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE
0115
0116 #ifdef CONFIGURE_INIT_TASK_STACK_SIZE
0117 #error "CONFIGURE_INIT_TASK_STACK_SIZE and CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE are mutually exclusive"
0118 #endif
0119
0120 RTEMS_STATIC_ASSERT(
0121 CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE >= CONFIGURE_MINIMUM_TASK_STACK_SIZE,
0122 CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE_IS_TOO_SMALL
0123 );
0124
0125 static RTEMS_SECTION( ".rtemsstack.userinit" )
0126 RTEMS_ALIGNED( RTEMS_TASK_STORAGE_ALIGNMENT )
0127 char _RTEMS_tasks_User_task_storage[ CONFIGURE_INIT_TASK_CONSTRUCT_STORAGE_SIZE ];
0128
0129 const RTEMS_tasks_User_task_config _RTEMS_tasks_User_task_config = {
0130 {
0131 CONFIGURE_INIT_TASK_NAME,
0132 CONFIGURE_INIT_TASK_PRIORITY,
0133 _RTEMS_tasks_User_task_storage,
0134 sizeof( _RTEMS_tasks_User_task_storage ),
0135 CONFIGURE_MAXIMUM_THREAD_LOCAL_STORAGE_SIZE,
0136 NULL,
0137 CONFIGURE_INIT_TASK_INITIAL_MODES,
0138 CONFIGURE_INIT_TASK_ATTRIBUTES,
0139 },
0140 _CONFIGURE_ASSERT_NOT_NULL(
0141 rtems_task_entry,
0142 CONFIGURE_INIT_TASK_ENTRY_POINT
0143 ),
0144 CONFIGURE_INIT_TASK_ARGUMENTS
0145 };
0146
0147 RTEMS_SYSINIT_ITEM(
0148 _RTEMS_tasks_Construct_user_task,
0149 RTEMS_SYSINIT_CLASSIC_USER_TASKS,
0150 RTEMS_SYSINIT_ORDER_MIDDLE
0151 );
0152
0153 #else
0154
0155 #ifndef CONFIGURE_INIT_TASK_STACK_SIZE
0156 #define CONFIGURE_INIT_TASK_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE
0157 #elif CONFIGURE_INIT_TASK_STACK_SIZE < CONFIGURE_MINIMUM_TASK_STACK_SIZE
0158 #error "CONFIGURE_INIT_TASK_STACK_SIZE must be greater than or equal to CONFIGURE_MINIMUM_TASK_STACK_SIZE"
0159 #endif
0160
0161 #if CONFIGURE_INIT_TASK_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE
0162 #define _CONFIGURE_INIT_TASK_STACK_EXTRA \
0163 ( CONFIGURE_INIT_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE )
0164 #endif
0165
0166 const rtems_initialization_tasks_table _RTEMS_tasks_User_task_table = {
0167 CONFIGURE_INIT_TASK_NAME,
0168 CONFIGURE_INIT_TASK_STACK_SIZE,
0169 CONFIGURE_INIT_TASK_PRIORITY,
0170 CONFIGURE_INIT_TASK_ATTRIBUTES,
0171 _CONFIGURE_ASSERT_NOT_NULL(
0172 rtems_task_entry,
0173 CONFIGURE_INIT_TASK_ENTRY_POINT
0174 ),
0175 CONFIGURE_INIT_TASK_INITIAL_MODES,
0176 CONFIGURE_INIT_TASK_ARGUMENTS
0177 };
0178
0179 RTEMS_SYSINIT_ITEM(
0180 _RTEMS_tasks_Initialize_user_task,
0181 RTEMS_SYSINIT_CLASSIC_USER_TASKS,
0182 RTEMS_SYSINIT_ORDER_MIDDLE
0183 );
0184
0185 #endif
0186
0187 #pragma GCC diagnostic pop
0188
0189 #ifdef __cplusplus
0190 }
0191 #endif
0192
0193 #endif
0194
0195 #ifndef _CONFIGURE_INIT_TASK_STACK_EXTRA
0196 #define _CONFIGURE_INIT_TASK_STACK_EXTRA 0
0197 #endif
0198
0199 #endif
0200
0201 #endif