summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadhandler.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-01-07 09:55:45 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-01-11 08:47:01 +0100
commitccd54344d904b657123e4e4ba795a32212382be2 (patch)
treed490d77b6173f586137036ed07ec5bd27d8ca65a /cpukit/score/src/threadhandler.c
parentsmptests/README: Delete obsolete information (diff)
downloadrtems-ccd54344d904b657123e4e4ba795a32212382be2.tar.bz2
score: Introduce Thread_Entry_information
This avoids potential dead code in _Thread_Handler(). It gets rid of the dangerous function pointer casts. Update #2514.
Diffstat (limited to 'cpukit/score/src/threadhandler.c')
-rw-r--r--cpukit/score/src/threadhandler.c37
1 files changed, 4 insertions, 33 deletions
diff --git a/cpukit/score/src/threadhandler.c b/cpukit/score/src/threadhandler.c
index fd828a2325..2429de57bc 100644
--- a/cpukit/score/src/threadhandler.c
+++ b/cpukit/score/src/threadhandler.c
@@ -90,41 +90,12 @@ void _Thread_Handler( void )
* thread/task prototype. The following code supports invoking the
* user thread entry point using the prototype expected.
*/
- if ( executing->Start.prototype == THREAD_START_NUMERIC ) {
- executing->Wait.return_argument =
- (*(Thread_Entry_numeric) executing->Start.entry_point)(
- executing->Start.numeric_argument
- );
- }
- #if defined(RTEMS_POSIX_API)
- else if ( executing->Start.prototype == THREAD_START_POINTER ) {
- executing->Wait.return_argument =
- (*(Thread_Entry_pointer) executing->Start.entry_point)(
- executing->Start.pointer_argument
- );
- }
- #endif
- #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
- );
- }
- 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
- );
- }
- #endif
+ ( *executing->Start.Entry.adaptor )( executing );
/*
- * In the switch above, the return code from the user thread body
- * was placed in return_argument. This assumed that if it returned
- * anything (which is not supporting in all APIs), then it would be
+ * In the call above, the return code from the user thread body which return
+ * something was placed in return_argument. This assumed that if it
+ * returned anything (which is not supporting in all APIs), then it would be
* able to fit in a (void *).
*/