Changeset 3b4795b4 in rtems
- Timestamp:
- 02/14/20 10:20:42 (4 years ago)
- Branches:
- 5, master
- Children:
- b8648bd
- Parents:
- 9bdb6aa3
- git-author:
- Sebastian Huber <sebastian.huber@…> (02/14/20 10:20:42)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (02/25/20 06:15:18)
- Files:
-
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/headers.am
r9bdb6aa3 r3b4795b4 190 190 include_rtems_posix_HEADERS += include/rtems/posix/barrierimpl.h 191 191 include_rtems_posix_HEADERS += include/rtems/posix/condimpl.h 192 include_rtems_posix_HEADERS += include/rtems/posix/config.h193 192 include_rtems_posix_HEADERS += include/rtems/posix/key.h 194 193 include_rtems_posix_HEADERS += include/rtems/posix/keyimpl.h -
cpukit/include/rtems/confdefs.h
r9bdb6aa3 r3b4795b4 2156 2156 2157 2157 #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE 2158 #ifndef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE 2159 #ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT 2160 #define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT POSIX_Init 2161 #endif 2162 2163 #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE 2164 #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \ 2165 CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE 2166 #endif 2167 2168 #ifdef CONFIGURE_INIT 2169 posix_initialization_threads_table POSIX_Initialization_threads[] = { 2170 { CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT, 2171 CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE } 2172 }; 2173 #endif 2174 2175 #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME \ 2176 POSIX_Initialization_threads 2177 2178 #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \ 2179 RTEMS_ARRAY_SIZE(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME) 2180 #endif /* !CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */ 2181 #else /* !CONFIGURE_POSIX_INIT_THREAD_TABLE */ 2182 #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME NULL 2183 #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE 0 2158 #ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT 2159 #define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT POSIX_Init 2160 #endif 2161 2162 #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE 2163 #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \ 2164 CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE 2165 #endif 2184 2166 #endif /* CONFIGURE_POSIX_INIT_THREAD_TABLE */ 2185 2167 … … 2756 2738 */ 2757 2739 #ifdef CONFIGURE_INIT 2758 #if defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) || \ 2759 defined(CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE) 2760 posix_initialization_threads_table * const 2761 _Configuration_POSIX_Initialization_threads = 2762 CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME; 2763 2764 const size_t _Configuration_POSIX_Initialization_thread_count = 2765 CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE; 2740 #if defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) 2741 const posix_initialization_threads_table _POSIX_Threads_User_thread_table = { 2742 CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT, 2743 CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE 2744 }; 2766 2745 2767 2746 RTEMS_SYSINIT_ITEM( 2768 _POSIX_Threads_Initialize_user_thread s_body,2747 _POSIX_Threads_Initialize_user_thread, 2769 2748 RTEMS_SYSINIT_POSIX_USER_THREADS, 2770 2749 RTEMS_SYSINIT_ORDER_MIDDLE … … 2991 2970 #endif 2992 2971 2972 #ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE 2973 #warning "The CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE configuration option is obsolete since RTEMS 5.1" 2974 #endif 2975 2993 2976 #ifdef CONFIGURE_TERMIOS_DISABLED 2994 2977 #warning "The CONFIGURE_TERMIOS_DISABLED configuration option is obsolete since RTEMS 5.1" -
cpukit/include/rtems/config.h
r9bdb6aa3 r3b4795b4 35 35 #include <rtems/score/watchdogticks.h> 36 36 #include <rtems/rtems/config.h> 37 #include <rtems/posix/config.h>38 37 #include <rtems/extension.h> 39 38 #if defined(RTEMS_MULTIPROCESSING) -
cpukit/include/rtems/posix/pthread.h
r9bdb6aa3 r3b4795b4 37 37 /**@{**/ 38 38 39 /** 40 * For now, we are only allowing the user to specify the entry point 41 * and stack size for POSIX initialization threads. 42 */ 43 typedef struct { 44 /** This is the entry point for a POSIX initialization thread. */ 45 void *(*thread_entry)(void *); 46 /** This is the stack size for a POSIX initialization thread. */ 47 int stack_size; 48 } posix_initialization_threads_table; 49 39 50 extern const size_t _POSIX_Threads_Minimum_stack_size; 40 51 41 52 /** 42 * @brief POSIX threads initialize user threads body.53 * @brief Initialization table for the first user POSIX thread. 43 54 * 44 * This routine creates and starts all configured user45 * initializ ation threads.55 * This table is used by _POSIX_Threads_Initialize_user_thread() and 56 * initialized via <rtems/confdefs.h>. 46 57 */ 47 extern void _POSIX_Threads_Initialize_user_threads_body(void); 58 extern const posix_initialization_threads_table 59 _POSIX_Threads_User_thread_table; 60 61 /** 62 * @brief System initialization handler to create the first user POSIX thread. 63 */ 64 extern void _POSIX_Threads_Initialize_user_thread( void ); 48 65 49 66 /** -
cpukit/include/rtems/posix/pthreadimpl.h
r9bdb6aa3 r3b4795b4 21 21 22 22 #include <rtems/posix/pthread.h> 23 #include <rtems/posix/config.h>24 23 #include <rtems/posix/threadsup.h> 25 24 #include <rtems/score/assert.h> -
cpukit/posix/src/pthreadinitthreads.c
r9bdb6aa3 r3b4795b4 19 19 #endif 20 20 21 #include <errno.h> 21 #include <rtems/posix/pthread.h> 22 22 23 #include <pthread.h> 23 #include <limits.h>24 24 25 #include <rtems/config.h> 26 #include <rtems/score/stack.h> 27 #include <rtems/score/thread.h> 28 #include <rtems/score/wkspace.h> 29 #include <rtems/posix/posixapi.h> 30 #include <rtems/posix/pthreadimpl.h> 31 #include <rtems/posix/priorityimpl.h> 32 #include <rtems/posix/config.h> 25 #include <rtems/score/assert.h> 26 #include <rtems/score/threadimpl.h> 27 #include <rtems/score/interr.h> 33 28 34 void _POSIX_Threads_Initialize_user_thread s_body(void)29 void _POSIX_Threads_Initialize_user_thread( void ) 35 30 { 36 int eno; 37 uint32_t index; 38 uint32_t maximum; 39 posix_initialization_threads_table *user_threads; 40 pthread_t thread_id; 41 pthread_attr_t attr; 31 int eno; 32 const posix_initialization_threads_table *user_thread; 33 pthread_t thread_id; 34 pthread_attr_t attr; 42 35 43 user_threads = _Configuration_POSIX_Initialization_threads; 44 maximum = _Configuration_POSIX_Initialization_thread_count; 45 46 if ( !user_threads ) 47 return; 36 user_thread = &_POSIX_Threads_User_thread_table; 48 37 49 38 /* … … 54 43 */ 55 44 56 for ( index=0 ; index < maximum ; index++ ) { 57 /* 58 * There is no way for these calls to fail in this situation. 59 */ 60 eno = pthread_attr_init( &attr ); 61 _Assert( eno == 0 ); 62 eno = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 63 _Assert( eno == 0 ); 64 eno = pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 65 _Assert( eno == 0 ); 45 /* 46 * There is no way for these calls to fail in this situation. 47 */ 48 eno = pthread_attr_init( &attr ); 49 _Assert( eno == 0 ); 50 eno = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 51 _Assert( eno == 0 ); 52 eno = pthread_attr_setstacksize( &attr, user_thread->stack_size ); 53 _Assert( eno == 0 ); 66 54 67 68 69 70 user_threads[ index ].thread_entry,71 72 73 74 75 55 eno = pthread_create( 56 &thread_id, 57 &attr, 58 user_thread->thread_entry, 59 NULL 60 ); 61 if ( eno != 0 ) { 62 _Internal_error( INTERNAL_ERROR_POSIX_INIT_THREAD_CREATE_FAILED ); 63 } 76 64 77 if ( _Thread_Global_constructor == 0 ) { 78 _Thread_Global_constructor = thread_id; 79 } 65 if ( _Thread_Global_constructor == 0 ) { 66 _Thread_Global_constructor = thread_id; 80 67 } 81 68 } -
testsuites/psxtests/psxfatal01/init.c
r9bdb6aa3 r3b4795b4 9 9 */ 10 10 11 #include <errno.h> 12 13 #include <rtems/posix/posixapi.h> 14 15 /* 16 * Way too much stack space. Should generate a fatal error 17 * on the init task create. 18 */ 19 #define CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE 20 #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE 0 21 posix_initialization_threads_table POSIX_Initialization_threads[] = { 22 { NULL, /* bad thread entry */ 23 0 24 } 25 }; 26 27 #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME POSIX_Initialization_threads 28 29 #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \ 30 sizeof(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME) / \ 31 sizeof(posix_initialization_threads_table) 11 #define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT NULL 32 12 33 13 #define FATAL_ERROR_TEST_NAME "1" -
testsuites/psxtests/psxfatal02/init.c
r9bdb6aa3 r3b4795b4 9 9 */ 10 10 11 #include <errno.h>12 #include <limits.h>13 14 #include <rtems/posix/posixapi.h>15 16 /*17 * Way too much stack space. Should generate a fatal error18 * on the init task create.19 */20 #define CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE21 #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE 022 posix_initialization_threads_table POSIX_Initialization_threads[] = {23 { POSIX_Init,24 #if INT_MAX < (12 * 1024 * 1024)25 INT_MAX26 #else27 12 * 1024 * 1024 /* too much stack */28 #endif29 }30 };31 32 #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME POSIX_Initialization_threads33 34 #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \35 sizeof(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME) / \36 sizeof(posix_initialization_threads_table)37 38 11 #define FATAL_ERROR_TEST_NAME "2" 39 12 #define FATAL_ERROR_DESCRIPTION \ … … 41 14 #define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE 42 15 #define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_POSIX_INIT_THREAD_CREATE_FAILED 16 17 static void *stack_allocator(size_t unused) 18 { 19 return NULL; 20 } 21 22 static void stack_deallocator(void *unused) 23 { 24 } 25 26 #define CONFIGURE_TASK_STACK_ALLOCATOR stack_allocator 27 28 #define CONFIGURE_TASK_STACK_DEALLOCATOR stack_deallocator 43 29 44 30 static void force_error(void)
Note: See TracChangeset
for help on using the changeset viewer.