Changeset 0df8293e in rtems for cpukit/score


Ignore:
Timestamp:
May 15, 2002, 3:14:58 PM (18 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
c0d4abe6
Parents:
fe36c017
Message:

2002-05-15 Chris Johns <ccj@…>

  • include/rtems/score/thread.h, inline/rtems/score/thread.inl, src/threaddispatch.c, src/threadinitialize.c: Move the C library re-enterrant support directly into the thread dispatch code. RTEMS needs libc and so requiring libc to use a user extension with its overhead is not the best solution. This patch lowers the overhead to 2 pointer moves.
Location:
cpukit/score
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/ChangeLog

    rfe36c017 r0df8293e  
     12002-05-15      Chris Johns <ccj@acm.org>
     2
     3        * include/rtems/score/thread.h, inline/rtems/score/thread.inl,
     4        src/threaddispatch.c, src/threadinitialize.c:
     5        Move the C library re-enterrant support directly into
     6        the thread dispatch code. RTEMS needs libc and so requiring
     7        libc to use a user extension with its overhead is not the best
     8        solution. This patch lowers the overhead to 2 pointer moves.
     9
    1102002-05-03      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    211
  • cpukit/score/include/rtems/score/thread.h

    rfe36c017 r0df8293e  
    221221  void                                 *fp_context;
    222222#endif
     223  void                                 *libc_reent;
    223224  void                                 *API_Extensions[ THREAD_API_LAST + 1 ];
    224225  void                                **extensions;
     
    316317SCORE_EXTERN Thread_Control *_Thread_Allocated_fp;
    317318#endif
     319
     320/*
     321 * The C library re-enter-rant global pointer. Some C library implementations
     322 * such as newlib have a single global pointer that changed during a context
     323 * switch. The pointer points to that global pointer. The Thread control block
     324 * holds a pointer to the task specific data.
     325 */
     326
     327SCORE_EXTERN void **_Thread_libc_reent;
    318328
    319329/*
  • cpukit/score/inline/rtems/score/thread.inl

    rfe36c017 r0df8293e  
    388388}
    389389
     390/*PAGE
     391 *
     392 *  _Thread_Get_libc_reent
     393 *
     394 *  DESCRIPTION:
     395 *
     396 *  This routine returns the C library re-enterant pointer.
     397 */
     398 
     399RTEMS_INLINE_ROUTINE void **_Thread_Get_libc_reent( void )
     400{
     401  return _Thread_libc_reent;
     402}
     403
     404/*PAGE
     405 *
     406 *  _Thread_Set_libc_reent
     407 *
     408 *  DESCRIPTION:
     409 *
     410 *  This routine set the C library re-enterant pointer.
     411 */
     412 
     413RTEMS_INLINE_ROUTINE void _Thread_Set_libc_reent (
     414  void **libc_reent
     415)
     416{
     417  _Thread_libc_reent = libc_reent;
     418}
     419
    390420#endif
    391421/* end of include file */
  • cpukit/score/src/threaddispatch.c

    rfe36c017 r0df8293e  
    7575    heir->ticks_executed++;
    7676
     77    /*
     78     * Switch libc's task specific data.
     79     */
     80    if ( _Thread_libc_reent ) {
     81      executing->libc_reent = *_Thread_libc_reent;
     82      *_Thread_libc_reent = heir->libc_reent;
     83    }
     84
    7785    _User_extensions_Thread_switch( executing, heir );
    7886
  • cpukit/score/src/threadinitialize.c

    rfe36c017 r0df8293e  
    116116
    117117  /*
     118   * Clear the libc reent hook.
     119   */
     120 
     121  the_thread->libc_reent = NULL;
     122 
     123  /*
    118124   *  Allocate the extensions area for this thread
    119125   */
Note: See TracChangeset for help on using the changeset viewer.