2009-06-01 Joel Sherrill <joel.sherrill@OARcorp.com>

* score/include/rtems/score/thread.h, score/src/threadhandler.c: Merge
	conditional code from main and init/fini C++ constructors so the body
	of this method reads better. Mark thread prototypes which are not
	currently exercised by any APIs with
	FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API conditional.
This commit is contained in:
Joel Sherrill
2009-06-01 14:50:31 +00:00
parent 57be444e59
commit 46a67b1981
3 changed files with 66 additions and 58 deletions

View File

@@ -1,3 +1,11 @@
2009-06-01 Joel Sherrill <joel.sherrill@OARcorp.com>
* score/include/rtems/score/thread.h, score/src/threadhandler.c: Merge
conditional code from main and init/fini C++ constructors so the body
of this method reads better. Mark thread prototypes which are not
currently exercised by any APIs with
FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API conditional.
2009-05-28 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1415/cpukit

View File

@@ -99,8 +99,10 @@ typedef uintptr_t Thread_Entry_numeric_type;
typedef enum {
THREAD_START_NUMERIC,
THREAD_START_POINTER,
#if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API)
THREAD_START_BOTH_POINTER_FIRST,
THREAD_START_BOTH_NUMERIC_FIRST
#endif
} Thread_Start_types;
/** This type corresponds to a very simple style thread entry point. */

View File

@@ -2,7 +2,7 @@
* Thread Handler
*
*
* COPYRIGHT (c) 1989-2008.
* COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -42,9 +42,13 @@
#endif
extern void INIT_NAME(void);
#define EXECUTE_GLOBAL_CONSTRUCTORS
#endif
#if defined(__USE__MAIN__)
extern void _main(void);
#define INIT_NAME __main
#define EXECUTE_GLOBAL_CONSTRUCTORS
#endif
/*PAGE
@@ -79,7 +83,7 @@ void _Thread_Handler( void )
{
ISR_Level level;
Thread_Control *executing;
#if defined(__USE_INIT_FINI__) || defined(__USE__MAIN__)
#if defined(EXECUTE_GLOBAL_CONSTRUCTORS)
static char doneConstructors;
char doneCons;
#endif
@@ -101,14 +105,15 @@ void _Thread_Handler( void )
level = executing->Start.isr_level;
_ISR_Set_level(level);
#if defined(__USE_INIT_FINI__) || defined(__USE__MAIN__)
#if defined(EXECUTE_GLOBAL_CONSTRUCTORS)
doneCons = doneConstructors;
doneConstructors = 1;
#endif
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
#if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE )
if ( (executing->fp_context != NULL) && !_Thread_Is_allocated_fp( executing ) ) {
if ( (executing->fp_context != NULL) &&
!_Thread_Is_allocated_fp( executing ) ) {
if ( _Thread_Allocated_fp != NULL )
_Context_Save_fp( &_Thread_Allocated_fp->fp_context );
_Thread_Allocated_fp = executing;
@@ -121,58 +126,51 @@ void _Thread_Handler( void )
* 'switch' extensions can run. This means must keep dispatch
* disabled until all 'begin' extensions complete.
*/
_User_extensions_Thread_begin( executing );
/*
* At this point, the dispatch disable level BETTER be 1.
*/
_Thread_Enable_dispatch();
#if defined(__USE_INIT_FINI__)
#if defined(EXECUTE_GLOBAL_CONSTRUCTORS)
/*
* _init could be a weak symbol and we SHOULD test it but it isn't
* in any configuration I know of and it generates a warning on every
* RTEMS target configuration. --joel (12 May 2007)
*/
if (!doneCons) /* && (volatile void *)_init) */
{
if (!doneCons) /* && (volatile void *)_init) */ {
INIT_NAME ();
}
#endif
#if defined(__USE__MAIN__)
if (!doneCons && _main)
__main ();
#endif
switch ( executing->Start.prototype ) {
case THREAD_START_NUMERIC:
if ( executing->Start.prototype == THREAD_START_NUMERIC ) {
executing->Wait.return_argument =
(*(Thread_Entry_numeric) executing->Start.entry_point)(
executing->Start.numeric_argument
);
break;
case THREAD_START_POINTER:
} else if ( executing->Start.prototype == THREAD_START_POINTER ) {
executing->Wait.return_argument =
(*(Thread_Entry_pointer) executing->Start.entry_point)(
executing->Start.pointer_argument
);
break;
case THREAD_START_BOTH_POINTER_FIRST:
}
#if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API)
else if ( executing->Start.prototype == THREAD_START_BOTH_POINTER_FIRST ) {
executing->Wait.return_argument =
(*(Thread_Entry_both_pointer_first) executing->Start.entry_point)(
executing->Start.pointer_argument,
executing->Start.numeric_argument
);
break;
case THREAD_START_BOTH_NUMERIC_FIRST:
}
else if ( executing->Start.prototype == THREAD_START_BOTH_NUMERIC_FIRST ) {
executing->Wait.return_argument =
(*(Thread_Entry_both_numeric_first) executing->Start.entry_point)(
executing->Start.numeric_argument,
executing->Start.pointer_argument
);
break;
}
#endif
/*
* In the switch above, the return code from the user thread body