Changeset a38ced2 in rtems
- Timestamp:
- 10/10/14 07:09:19 (9 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 2faaf4b
- Parents:
- ef4c461
- git-author:
- Sebastian Huber <sebastian.huber@…> (10/10/14 07:09:19)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (10/13/14 12:30:22)
- Files:
-
- 13 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/posix/src/pthreadinitthreads.c
ref4c461 ra38ced2 35 35 #include <rtems/posix/config.h> 36 36 #include <rtems/posix/time.h> 37 #include <rtems/rtems/config.h> 37 38 38 39 void _POSIX_Threads_Initialize_user_threads_body(void) … … 44 45 pthread_t thread_id; 45 46 pthread_attr_t attr; 47 bool register_global_construction; 48 void *(*thread_entry)(void *); 46 49 47 50 user_threads = Configuration_POSIX_API.User_initialization_threads_table; 48 51 maximum = Configuration_POSIX_API.number_of_initialization_threads; 49 52 50 if ( !user_threads || maximum == 0)53 if ( !user_threads ) 51 54 return; 55 56 register_global_construction = 57 Configuration_RTEMS_API.number_of_initialization_tasks == 0; 52 58 53 59 /* … … 69 75 _Assert( eno == 0 ); 70 76 77 thread_entry = user_threads[ index ].thread_entry; 78 79 if ( register_global_construction && thread_entry != NULL ) { 80 register_global_construction = false; 81 thread_entry = (void *(*)(void *)) _Thread_Global_construction; 82 } 83 71 84 eno = pthread_create( 72 85 &thread_id, 73 86 &attr, 74 user_threads[ index ].thread_entry,87 thread_entry, 75 88 NULL 76 89 ); -
cpukit/rtems/src/taskinitusers.c
ref4c461 ra38ced2 49 49 rtems_status_code return_value; 50 50 rtems_initialization_tasks_table *user_tasks; 51 bool register_global_construction; 52 rtems_task_entry entry_point; 51 53 52 54 /* … … 61 63 if ( !user_tasks ) 62 64 return; 65 66 register_global_construction = true; 63 67 64 68 /* … … 77 81 _Terminate( INTERNAL_ERROR_RTEMS_API, true, return_value ); 78 82 83 entry_point = user_tasks[ index ].entry_point; 84 85 if ( register_global_construction && entry_point != NULL ) { 86 register_global_construction = false; 87 entry_point = (rtems_task_entry) _Thread_Global_construction; 88 } 89 79 90 return_value = rtems_task_start( 80 91 id, 81 user_tasks[ index ].entry_point,92 entry_point, 82 93 user_tasks[ index ].argument 83 94 ); -
cpukit/score/Makefile.am
ref4c461 ra38ced2 290 290 src/threadstartmultitasking.c src/iterateoverthreads.c \ 291 291 src/threadblockingoperationcancel.c 292 libscore_a_SOURCES += src/threadglobalconstruction.c 292 293 libscore_a_SOURCES += src/threadyield.c 293 294 -
cpukit/score/include/rtems/score/threadimpl.h
ref4c461 ra38ced2 306 306 307 307 /** 308 * @brief Executes the global constructors and then restarts itself as the 309 * first initialization thread. 310 * 311 * The first initialization thread is the first RTEMS initialization task or 312 * the first POSIX initialization thread in case no RTEMS initialization tasks 313 * are present. 314 */ 315 void *_Thread_Global_construction( void ); 316 317 /** 308 318 * @brief Ended the delay of a thread. 309 319 * -
cpukit/score/src/threadhandler.c
ref4c461 ra38ced2 25 25 #include <rtems/score/userextimpl.h> 26 26 27 /*28 * Conditional magic to determine what style of C++ constructor29 * initialization this target and compiler version uses.30 */31 #if defined(__USE_INIT_FINI__)32 #if defined(__M32R__)33 #define INIT_NAME __init34 #elif defined(__ARM_EABI__)35 #define INIT_NAME __libc_init_array36 #else37 #define INIT_NAME _init38 #endif39 40 extern void INIT_NAME(void);41 #define EXECUTE_GLOBAL_CONSTRUCTORS42 #endif43 44 #if defined(__USE__MAIN__)45 extern void __main(void);46 #define INIT_NAME __main47 #define EXECUTE_GLOBAL_CONSTRUCTORS48 #endif49 50 #if defined(EXECUTE_GLOBAL_CONSTRUCTORS)51 static bool _Thread_Handler_is_constructor_execution_required(52 Thread_Control *executing53 )54 {55 static bool doneConstructors;56 bool doCons = false;57 58 #if defined(RTEMS_SMP)59 static SMP_lock_Control constructor_lock =60 SMP_LOCK_INITIALIZER("constructor");61 62 SMP_lock_Context lock_context;63 64 if ( !doneConstructors ) {65 _SMP_lock_Acquire( &constructor_lock, &lock_context );66 #endif67 68 #if defined(RTEMS_MULTIPROCESSING)69 doCons = !doneConstructors70 && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API;71 if (doCons)72 doneConstructors = true;73 #else74 (void) executing;75 doCons = !doneConstructors;76 doneConstructors = true;77 #endif78 79 #if defined(RTEMS_SMP)80 _SMP_lock_Release( &constructor_lock, &lock_context );81 }82 #endif83 84 return doCons;85 }86 #endif87 88 27 void _Thread_Handler( void ) 89 28 { 90 ISR_Level level; 91 Thread_Control *executing; 92 #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) 93 bool doCons; 94 #endif 29 Thread_Control *executing = _Thread_Executing; 30 ISR_Level level; 95 31 96 executing = _Thread_Executing;97 32 98 33 /* … … 110 45 level = executing->Start.isr_level; 111 46 _ISR_Set_level( level ); 112 #endif113 114 #if defined(EXECUTE_GLOBAL_CONSTRUCTORS)115 doCons = _Thread_Handler_is_constructor_execution_required( executing );116 47 #endif 117 48 … … 172 103 #endif 173 104 174 #if defined(EXECUTE_GLOBAL_CONSTRUCTORS)175 /*176 * _init could be a weak symbol and we SHOULD test it but it isn't177 * in any configuration I know of and it generates a warning on every178 * RTEMS target configuration. --joel (12 May 2007)179 */180 if (doCons) /* && (volatile void *)_init) */ {181 INIT_NAME ();182 }183 #endif184 185 105 /* 186 106 * RTEMS supports multiple APIs and each API can define a different -
testsuites/psxtests/Makefile.am
ref4c461 ra38ced2 16 16 psxintrcritical01 psxstack01 psxstack02 \ 17 17 psxeintr_join psxgetattrnp01 18 if HAS_CPLUSPLUS 19 _SUBDIRS += psxglobalcon01 20 _SUBDIRS += psxglobalcon02 21 endif 18 22 endif 19 23 -
testsuites/psxtests/configure.ac
ref4c461 ra38ced2 12 12 AM_MAINTAINER_MODE 13 13 14 RTEMS_ENABLE_CXX 15 14 16 RTEMS_ENV_RTEMSBSP 15 17 … … 17 19 18 20 RTEMS_PROG_CC_FOR_TARGET 21 RTEMS_PROG_CXX_FOR_TARGET 19 22 20 23 RTEMS_CANONICALIZE_TOOLS 21 24 22 25 RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP) 23 24 AM_CONDITIONAL([HAS_NETWORKING],[test "$HAS_NETWORKING" = "yes"]) 26 RTEMS_CHECK_CXX(RTEMS_BSP) 27 28 AM_CONDITIONAL([HAS_NETWORKING],[test x"$HAS_NETWORKING" = x"yes"]) 29 AM_CONDITIONAL([HAS_CPLUSPLUS],[test x"$HAS_CPLUSPLUS" = x"yes"]) 25 30 26 31 RTEMS_CHECK_CPUOPTS([RTEMS_POSIX_API]) … … 146 151 psxgetattrnp01/Makefile 147 152 psxgetrusage01/Makefile 153 psxglobalcon01/Makefile 154 psxglobalcon02/Makefile 148 155 psxhdrs/Makefile 149 156 psxid01/Makefile -
testsuites/sptests/Makefile.am
ref4c461 ra38ced2 51 51 _SUBDIRS += spcpucounter01 52 52 if HAS_CPLUSPLUS 53 _SUBDIRS += spglobalcon01 53 54 _SUBDIRS += sptls02 54 55 endif -
testsuites/sptests/configure.ac
ref4c461 ra38ced2 41 41 # Explicitly list all Makefiles here 42 42 AC_CONFIG_FILES([Makefile 43 spglobalcon01/Makefile 43 44 spintrcritical22/Makefile 44 45 spsem03/Makefile -
testsuites/sptests/spthreadlife01/init.c
ref4c461 ra38ced2 137 137 138 138 rtems_test_assert(executing == restarted); 139 rtems_test_assert(ctx->worker_task_id == rtems_task_self());140 139 141 140 switch (ctx->current) { 142 141 case RESTART_0: 142 rtems_test_assert(ctx->worker_task_id == rtems_task_self()); 143 143 ctx->current = RESTART_1; 144 144 sc = rtems_task_restart(RTEMS_SELF, 0); … … 146 146 break; 147 147 case RESTART_1: 148 rtems_test_assert(ctx->worker_task_id == rtems_task_self()); 148 149 ctx->current = RESTART_2; 150 break; 151 case INIT: 152 /* Restart via _Thread_Global_construction() */ 149 153 break; 150 154 default:
Note: See TracChangeset
for help on using the changeset viewer.