From 78dabb697cef81e6b77826c940d559fa49026a6d Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 26 Oct 2007 19:44:10 +0000 Subject: 2007-10-26 Joel Sherrill * score/Makefile.am, score/include/rtems/score/thread.h, score/inline/rtems/score/thread.inl: No longer inline _Thread_Get. It resulted in unnessary code explosion, many uncovered paths when looking at binary executable coverage, and only optimized getting self. Id translations were still getting pushed to a subroutine call to _Objects_Get. Later the non-inlined version can be further optimized to get Ids in range for the current API, then self, then look at other APIs. * score/src/threadget.c: New file. --- cpukit/score/inline/rtems/score/thread.inl | 60 ------------------------------ 1 file changed, 60 deletions(-) (limited to 'cpukit/score/inline') diff --git a/cpukit/score/inline/rtems/score/thread.inl b/cpukit/score/inline/rtems/score/thread.inl index dbd95c6ca3..dad95990d4 100644 --- a/cpukit/score/inline/rtems/score/thread.inl +++ b/cpukit/score/inline/rtems/score/thread.inl @@ -254,66 +254,6 @@ RTEMS_INLINE_ROUTINE boolean _Thread_Is_null ( return ( the_thread == NULL ); } -/** - * This function maps thread IDs to thread control - * blocks. If ID corresponds to a local thread, then it - * returns the_thread control pointer which maps to ID - * and location is set to OBJECTS_LOCAL. If the thread ID is - * global and resides on a remote node, then location is set - * to OBJECTS_REMOTE, and the_thread is undefined. - * Otherwise, location is set to OBJECTS_ERROR and - * the_thread is undefined. - * - * @note The performance of many RTEMS services depends upon - * the quick execution of the "good object" path in this - * routine. If there is a possibility of saving a few - * cycles off the execution time, this routine is worth - * further optimization attention. - */ - -RTEMS_INLINE_ROUTINE Thread_Control *_Thread_Get ( - Objects_Id id, - Objects_Locations *location -) -{ - uint32_t the_api; - uint32_t the_class; - Objects_Information *information; - Thread_Control *tp = (Thread_Control *) 0; - - if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) { - _Thread_Disable_dispatch(); - *location = OBJECTS_LOCAL; - tp = _Thread_Executing; - goto done; - } - - the_api = _Objects_Get_API( id ); - if ( the_api && the_api > OBJECTS_APIS_LAST ) { - *location = OBJECTS_ERROR; - goto done; - } - - the_class = _Objects_Get_class( id ); - if ( the_class != 1 ) { /* threads are always first class :) */ - *location = OBJECTS_ERROR; - goto done; - } - - information = _Objects_Information_table[ the_api ][ the_class ]; - - if ( !information ) { - *location = OBJECTS_ERROR; - goto done; - } - - tp = (Thread_Control *) _Objects_Get( information, id, location ); - -done: - return tp; -} - - /** @brief _Thread_Is_proxy_blocking * * status which indicates that a proxy is blocking, and FALSE otherwise. -- cgit v1.2.3