Changeset 3b4795b4 in rtems


Ignore:
Timestamp:
02/14/20 10:20:42 (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
b8648bd
Parents:
9bdb6aa3
git-author:
Sebastian Huber <sebastian.huber@…> (02/14/20 10:20:42)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/25/20 06:15:18)
Message:

config: Remove CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE

The CONFIGURE_HAS_OWN_INIT_TASK_TABLE and
CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE are the last *_HAS_OWN_*
configuration options. These two options are probably unused, see also:

Removing them simplifies the configuration. If there is a real user need
which shows up after the removal, we can resurrect them on demand.

Using CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE would have required the
use of the undocumented CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME and
CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE configuration options.

Update #3874.

Files:
1 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • cpukit/headers.am

    r9bdb6aa3 r3b4795b4  
    190190include_rtems_posix_HEADERS += include/rtems/posix/barrierimpl.h
    191191include_rtems_posix_HEADERS += include/rtems/posix/condimpl.h
    192 include_rtems_posix_HEADERS += include/rtems/posix/config.h
    193192include_rtems_posix_HEADERS += include/rtems/posix/key.h
    194193include_rtems_posix_HEADERS += include/rtems/posix/keyimpl.h
  • cpukit/include/rtems/confdefs.h

    r9bdb6aa3 r3b4795b4  
    21562156
    21572157#ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE
    2158   #ifndef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
    2159     #ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT
    2160       #define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT   POSIX_Init
    2161     #endif
    2162 
    2163     #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
    2164       #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \
    2165         CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE
    2166     #endif
    2167 
    2168     #ifdef CONFIGURE_INIT
    2169       posix_initialization_threads_table POSIX_Initialization_threads[] = {
    2170         { CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT,
    2171           CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE }
    2172       };
    2173     #endif
    2174 
    2175     #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME \
    2176       POSIX_Initialization_threads
    2177 
    2178     #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \
    2179       RTEMS_ARRAY_SIZE(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME)
    2180   #endif /* !CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */
    2181 #else /* !CONFIGURE_POSIX_INIT_THREAD_TABLE */
    2182   #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME NULL
    2183   #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE 0
     2158  #ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT
     2159    #define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT   POSIX_Init
     2160  #endif
     2161
     2162  #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
     2163    #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \
     2164      CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE
     2165  #endif
    21842166#endif /* CONFIGURE_POSIX_INIT_THREAD_TABLE */
    21852167
     
    27562738 */
    27572739#ifdef CONFIGURE_INIT
    2758   #if defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) || \
    2759       defined(CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE)
    2760     posix_initialization_threads_table * const
    2761       _Configuration_POSIX_Initialization_threads =
    2762         CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME;
    2763 
    2764     const size_t _Configuration_POSIX_Initialization_thread_count =
    2765       CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE;
     2740  #if defined(CONFIGURE_POSIX_INIT_THREAD_TABLE)
     2741    const posix_initialization_threads_table _POSIX_Threads_User_thread_table = {
     2742      CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT,
     2743      CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
     2744    };
    27662745
    27672746    RTEMS_SYSINIT_ITEM(
    2768       _POSIX_Threads_Initialize_user_threads_body,
     2747      _POSIX_Threads_Initialize_user_thread,
    27692748      RTEMS_SYSINIT_POSIX_USER_THREADS,
    27702749      RTEMS_SYSINIT_ORDER_MIDDLE
     
    29912970#endif
    29922971
     2972#ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
     2973  #warning "The CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE configuration option is obsolete since RTEMS 5.1"
     2974#endif
     2975
    29932976#ifdef CONFIGURE_TERMIOS_DISABLED
    29942977  #warning "The CONFIGURE_TERMIOS_DISABLED configuration option is obsolete since RTEMS 5.1"
  • cpukit/include/rtems/config.h

    r9bdb6aa3 r3b4795b4  
    3535#include <rtems/score/watchdogticks.h>
    3636#include <rtems/rtems/config.h>
    37 #include <rtems/posix/config.h>
    3837#include <rtems/extension.h>
    3938#if defined(RTEMS_MULTIPROCESSING)
  • cpukit/include/rtems/posix/pthread.h

    r9bdb6aa3 r3b4795b4  
    3737/**@{**/
    3838
     39/**
     40 *  For now, we are only allowing the user to specify the entry point
     41 *  and stack size for POSIX initialization threads.
     42 */
     43typedef struct {
     44  /** This is the entry point for a POSIX initialization thread. */
     45  void       *(*thread_entry)(void *);
     46  /** This is the stack size for a POSIX initialization thread. */
     47  int       stack_size;
     48} posix_initialization_threads_table;
     49
    3950extern const size_t _POSIX_Threads_Minimum_stack_size;
    4051
    4152/**
    42  * @brief POSIX threads initialize user threads body.
     53 * @brief Initialization table for the first user POSIX thread.
    4354 *
    44  * This routine creates and starts all configured user
    45  * initialization threads.
     55 * This table is used by _POSIX_Threads_Initialize_user_thread() and
     56 * initialized via <rtems/confdefs.h>.
    4657 */
    47 extern void _POSIX_Threads_Initialize_user_threads_body(void);
     58extern const posix_initialization_threads_table
     59  _POSIX_Threads_User_thread_table;
     60
     61/**
     62 * @brief System initialization handler to create the first user POSIX thread.
     63 */
     64extern void _POSIX_Threads_Initialize_user_thread( void );
    4865
    4966/**
  • cpukit/include/rtems/posix/pthreadimpl.h

    r9bdb6aa3 r3b4795b4  
    2121
    2222#include <rtems/posix/pthread.h>
    23 #include <rtems/posix/config.h>
    2423#include <rtems/posix/threadsup.h>
    2524#include <rtems/score/assert.h>
  • cpukit/posix/src/pthreadinitthreads.c

    r9bdb6aa3 r3b4795b4  
    1919#endif
    2020
    21 #include <errno.h>
     21#include <rtems/posix/pthread.h>
     22
    2223#include <pthread.h>
    23 #include <limits.h>
    2424
    25 #include <rtems/config.h>
    26 #include <rtems/score/stack.h>
    27 #include <rtems/score/thread.h>
    28 #include <rtems/score/wkspace.h>
    29 #include <rtems/posix/posixapi.h>
    30 #include <rtems/posix/pthreadimpl.h>
    31 #include <rtems/posix/priorityimpl.h>
    32 #include <rtems/posix/config.h>
     25#include <rtems/score/assert.h>
     26#include <rtems/score/threadimpl.h>
     27#include <rtems/score/interr.h>
    3328
    34 void _POSIX_Threads_Initialize_user_threads_body(void)
     29void _POSIX_Threads_Initialize_user_thread( void )
    3530{
    36   int                                 eno;
    37   uint32_t                            index;
    38   uint32_t                            maximum;
    39   posix_initialization_threads_table *user_threads;
    40   pthread_t                           thread_id;
    41   pthread_attr_t                      attr;
     31  int                                       eno;
     32  const posix_initialization_threads_table *user_thread;
     33  pthread_t                                 thread_id;
     34  pthread_attr_t                            attr;
    4235
    43   user_threads = _Configuration_POSIX_Initialization_threads;
    44   maximum      = _Configuration_POSIX_Initialization_thread_count;
    45 
    46   if ( !user_threads )
    47     return;
     36  user_thread = &_POSIX_Threads_User_thread_table;
    4837
    4938  /*
     
    5443   */
    5544
    56   for ( index=0 ; index < maximum ; index++ ) {
    57     /*
    58      * There is no way for these calls to fail in this situation.
    59      */
    60     eno = pthread_attr_init( &attr );
    61     _Assert( eno == 0 );
    62     eno = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
    63     _Assert( eno == 0 );
    64     eno = pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size);
    65     _Assert( eno == 0 );
     45  /*
     46   * There is no way for these calls to fail in this situation.
     47   */
     48  eno = pthread_attr_init( &attr );
     49  _Assert( eno == 0 );
     50  eno = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED );
     51  _Assert( eno == 0 );
     52  eno = pthread_attr_setstacksize( &attr, user_thread->stack_size );
     53  _Assert( eno == 0 );
    6654
    67     eno = pthread_create(
    68       &thread_id,
    69       &attr,
    70       user_threads[ index ].thread_entry,
    71       NULL
    72     );
    73     if ( eno != 0 ) {
    74       _Internal_error( INTERNAL_ERROR_POSIX_INIT_THREAD_CREATE_FAILED );
    75     }
     55  eno = pthread_create(
     56    &thread_id,
     57    &attr,
     58    user_thread->thread_entry,
     59    NULL
     60  );
     61  if ( eno != 0 ) {
     62    _Internal_error( INTERNAL_ERROR_POSIX_INIT_THREAD_CREATE_FAILED );
     63  }
    7664
    77     if ( _Thread_Global_constructor == 0 ) {
    78       _Thread_Global_constructor = thread_id;
    79     }
     65  if ( _Thread_Global_constructor == 0 ) {
     66    _Thread_Global_constructor = thread_id;
    8067  }
    8168}
  • testsuites/psxtests/psxfatal01/init.c

    r9bdb6aa3 r3b4795b4  
    99 */
    1010
    11 #include <errno.h>
    12 
    13 #include <rtems/posix/posixapi.h>
    14 
    15 /*
    16  *  Way too much stack space.  Should generate a fatal error
    17  *  on the init task create.
    18  */
    19 #define CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
    20 #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE 0
    21 posix_initialization_threads_table POSIX_Initialization_threads[] = {
    22   { NULL,   /* bad thread entry */
    23     0
    24   }
    25 };
    26 
    27 #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME POSIX_Initialization_threads
    28 
    29 #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \
    30   sizeof(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME) / \
    31       sizeof(posix_initialization_threads_table)
     11#define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT NULL
    3212
    3313#define FATAL_ERROR_TEST_NAME            "1"
  • testsuites/psxtests/psxfatal02/init.c

    r9bdb6aa3 r3b4795b4  
    99 */
    1010
    11 #include <errno.h>
    12 #include <limits.h>
    13 
    14 #include <rtems/posix/posixapi.h>
    15 
    16 /*
    17  *  Way too much stack space.  Should generate a fatal error
    18  *  on the init task create.
    19  */
    20 #define CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
    21 #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE 0
    22 posix_initialization_threads_table POSIX_Initialization_threads[] = {
    23   { POSIX_Init,
    24 #if INT_MAX < (12 * 1024 * 1024)
    25     INT_MAX
    26 #else
    27     12 * 1024 * 1024 /* too much stack */
    28 #endif
    29   }
    30 };
    31 
    32 #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME POSIX_Initialization_threads
    33 
    34 #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \
    35   sizeof(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME) / \
    36       sizeof(posix_initialization_threads_table)
    37 
    3811#define FATAL_ERROR_TEST_NAME            "2"
    3912#define FATAL_ERROR_DESCRIPTION \
     
    4114#define FATAL_ERROR_EXPECTED_SOURCE      INTERNAL_ERROR_CORE
    4215#define FATAL_ERROR_EXPECTED_ERROR       INTERNAL_ERROR_POSIX_INIT_THREAD_CREATE_FAILED
     16
     17static void *stack_allocator(size_t unused)
     18{
     19  return NULL;
     20}
     21
     22static void stack_deallocator(void *unused)
     23{
     24}
     25
     26#define CONFIGURE_TASK_STACK_ALLOCATOR stack_allocator
     27
     28#define CONFIGURE_TASK_STACK_DEALLOCATOR stack_deallocator
    4329
    4430static void force_error(void)
Note: See TracChangeset for help on using the changeset viewer.