Changeset 4210114 in rtems


Ignore:
Timestamp:
Jan 26, 2016, 10:13:45 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
3bc12a8f
Parents:
1ff8eca
git-author:
Sebastian Huber <sebastian.huber@…> (01/26/16 10:13:45)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/03/16 09:00:58)
Message:

Use linker set for POSIX User Threads init

Update #2408.

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/include/rtems/posix/pthreadimpl.h

    r1ff8eca r4210114  
    5151 */
    5252extern pthread_attr_t _POSIX_Threads_Default_attributes;
    53 
    54 /**
    55  * When the user configures a set of POSIX API initialization threads,
    56  * This variable will point to the method used to initialize them.
    57  *
    58  * NOTE: It is instantiated and initialized by confdefs.h based upon
    59  *       application requirements.
    60  */
    61 extern void (*_POSIX_Threads_Initialize_user_threads_p)(void);
    6253
    6354/**
  • cpukit/posix/src/pthread.c

    r1ff8eca r4210114  
    286286}
    287287
    288 /*
    289  *  _POSIX_Threads_Initialize_user_threads
    290  *
    291  *  This routine creates and starts all configured user
    292  *  initialization threads.
    293  */
    294 static void _POSIX_Threads_Initialize_user_threads( void )
    295 {
    296   if ( _POSIX_Threads_Initialize_user_threads_p )
    297     (*_POSIX_Threads_Initialize_user_threads_p)();
    298 }
    299 
    300 /*
    301  *  API Extension control structures
    302  */
    303 API_extensions_Control _POSIX_Threads_API_extensions = {
    304   #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API)
    305     .predriver_hook = NULL,
    306   #endif
    307   .postdriver_hook = _POSIX_Threads_Initialize_user_threads
    308 };
    309 
    310288User_extensions_Control _POSIX_Threads_User_extensions = {
    311289  { NULL, NULL },
     
    364342  _User_extensions_Add_API_set( &_POSIX_Threads_User_extensions );
    365343
    366   _API_extensions_Add( &_POSIX_Threads_API_extensions );
    367 
    368344  /*
    369345   *  If we supported MP, then here we would ...
  • cpukit/sapi/include/confdefs.h

    r1ff8eca r4210114  
    34623462    #if defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) || \
    34633463        defined(CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE)
    3464       void (*_POSIX_Threads_Initialize_user_threads_p)(void) =
    3465                 _POSIX_Threads_Initialize_user_threads_body;
    3466     #else
    3467       void (*_POSIX_Threads_Initialize_user_threads_p)(void) = NULL;
     3464      RTEMS_SYSINIT_ITEM(
     3465        _POSIX_Threads_Initialize_user_threads_body,
     3466        RTEMS_SYSINIT_POSIX_USER_THREADS,
     3467        RTEMS_SYSINIT_ORDER_MIDDLE
     3468      );
    34683469    #endif
    34693470  #endif
  • cpukit/score/include/rtems/sysinit.h

    r1ff8eca r4210114  
    7171#define RTEMS_SYSINIT_MP_FINALIZE                000705
    7272#define RTEMS_SYSINIT_CLASSIC_USER_TASKS         000706
     73#define RTEMS_SYSINIT_POSIX_USER_THREADS         000707
    7374#define RTEMS_SYSINIT_STD_FILE_DESCRIPTORS       000800
    7475
  • testsuites/sptests/spsysinit01/init.c

    r1ff8eca r4210114  
    135135  CLASSIC_USER_TASKS_PRE,
    136136  CLASSIC_USER_TASKS_POST,
     137#ifdef RTEMS_POSIX_API
     138  POSIX_USER_THREADS_PRE,
     139  POSIX_USER_THREADS_POST,
     140#endif /* RTEMS_POSIX_API */
    137141  STD_FILE_DESCRIPTORS_PRE,
    138142  STD_FILE_DESCRIPTORS_POST,
     
    619623}
    620624
     625#ifdef RTEMS_POSIX_API
     626
     627FIRST(RTEMS_SYSINIT_POSIX_USER_THREADS)
     628{
     629  assert(_Objects_Active_count(&_POSIX_Threads_Information.Objects) == 0);
     630  next_step(POSIX_USER_THREADS_PRE);
     631}
     632
     633LAST(RTEMS_SYSINIT_POSIX_USER_THREADS)
     634{
     635  assert(_Objects_Active_count(&_POSIX_Threads_Information.Objects) == 1);
     636  next_step(POSIX_USER_THREADS_POST);
     637}
     638
     639#endif /* RTEMS_POSIX_API */
     640
    621641FIRST(RTEMS_SYSINIT_STD_FILE_DESCRIPTORS)
    622642{
     
    650670}
    651671
     672#ifdef RTEMS_POSIX_API
     673
     674static void *POSIX_Init(void *arg)
     675{
     676  return NULL;
     677}
     678
     679#endif /* RTEMS_POSIX_API */
     680
    652681#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
    653682#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
     
    693722#define CONFIGURE_MAXIMUM_POSIX_THREADS 1
    694723
     724#define CONFIGURE_POSIX_INIT_THREAD_TABLE
     725
    695726#endif /* RTEMS_POSIX_API */
    696727
Note: See TracChangeset for help on using the changeset viewer.