Changeset 78dabb69 in rtems


Ignore:
Timestamp:
Oct 26, 2007, 7:44:10 PM (13 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, 5, master
Children:
0e87deaa
Parents:
327b0020
Message:

2007-10-26 Joel Sherrill <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.
Location:
cpukit
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r327b0020 r78dabb69  
     12007-10-26      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * score/Makefile.am, score/include/rtems/score/thread.h,
     4        score/inline/rtems/score/thread.inl: No longer inline _Thread_Get. It
     5        resulted in unnessary code explosion, many uncovered paths when
     6        looking at binary executable coverage, and only optimized getting
     7        self. Id translations were still getting pushed to a subroutine call
     8        to _Objects_Get. Later the non-inlined version can be further
     9        optimized to get Ids in range for the current API, then self, then
     10        look at other APIs.
     11        * score/src/threadget.c: New file.
     12
    1132007-10-26      Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
    214
  • cpukit/score/Makefile.am

    r327b0020 r78dabb69  
    127127    src/threadclearstate.c src/threadclose.c src/threadcreateidle.c \
    128128    src/threaddelayended.c src/threaddispatch.c src/threadevaluatemode.c \
    129     src/threadhandler.c src/threadidlebody.c \
     129    src/threadget.c src/threadhandler.c src/threadidlebody.c \
    130130    src/threadinitialize.c src/threadloadenv.c src/threadready.c \
    131131    src/threadresettimeslice.c src/threadreset.c src/threadrestart.c \
  • cpukit/score/include/rtems/score/thread.h

    r327b0020 r78dabb69  
    757757);
    758758
     759/**
     760 *  This function maps thread IDs to thread control
     761 *  blocks.  If ID corresponds to a local thread, then it
     762 *  returns the_thread control pointer which maps to ID
     763 *  and location is set to OBJECTS_LOCAL.  If the thread ID is
     764 *  global and resides on a remote node, then location is set
     765 *  to OBJECTS_REMOTE, and the_thread is undefined.
     766 *  Otherwise, location is set to OBJECTS_ERROR and
     767 *  the_thread is undefined.
     768 *
     769 *  @note  The performance of many RTEMS services depends upon
     770 *         the quick execution of the "good object" path in this
     771 *         routine.  If there is a possibility of saving a few
     772 *         cycles off the execution time, this routine is worth
     773 *         further optimization attention.
     774 */
     775Thread_Control *_Thread_Get (
     776  Objects_Id         id,
     777  Objects_Locations *location
     778);
     779
    759780#ifndef __RTEMS_APPLICATION__
    760781#include <rtems/score/thread.inl>
  • cpukit/score/inline/rtems/score/thread.inl

    r327b0020 r78dabb69  
    255255}
    256256
    257 /**
    258  *  This function maps thread IDs to thread control
    259  *  blocks.  If ID corresponds to a local thread, then it
    260  *  returns the_thread control pointer which maps to ID
    261  *  and location is set to OBJECTS_LOCAL.  If the thread ID is
    262  *  global and resides on a remote node, then location is set
    263  *  to OBJECTS_REMOTE, and the_thread is undefined.
    264  *  Otherwise, location is set to OBJECTS_ERROR and
    265  *  the_thread is undefined.
    266  *
    267  *  @note  The performance of many RTEMS services depends upon
    268  *         the quick execution of the "good object" path in this
    269  *         routine.  If there is a possibility of saving a few
    270  *         cycles off the execution time, this routine is worth
    271  *         further optimization attention.
    272  */
    273 
    274 RTEMS_INLINE_ROUTINE Thread_Control *_Thread_Get (
    275   Objects_Id         id,
    276   Objects_Locations *location
    277 )
    278 {
    279   uint32_t             the_api;
    280   uint32_t             the_class;
    281   Objects_Information *information;
    282   Thread_Control      *tp = (Thread_Control *) 0;
    283  
    284   if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) {
    285     _Thread_Disable_dispatch();
    286     *location = OBJECTS_LOCAL;
    287     tp = _Thread_Executing;
    288     goto done;
    289   }
    290  
    291   the_api = _Objects_Get_API( id );
    292   if ( the_api && the_api > OBJECTS_APIS_LAST ) {
    293     *location = OBJECTS_ERROR;
    294     goto done;
    295   }
    296  
    297   the_class = _Objects_Get_class( id );
    298   if ( the_class != 1 ) {       /* threads are always first class :) */
    299     *location = OBJECTS_ERROR;
    300     goto done;
    301   }
    302  
    303   information = _Objects_Information_table[ the_api ][ the_class ];
    304  
    305   if ( !information ) {
    306     *location = OBJECTS_ERROR;
    307     goto done;
    308   }
    309  
    310   tp = (Thread_Control *) _Objects_Get( information, id, location );
    311  
    312 done:
    313   return tp;
    314 }
    315 
    316 
    317257/** @brief _Thread_Is_proxy_blocking
    318258 *
Note: See TracChangeset for help on using the changeset viewer.