Changeset e97806a in rtems


Ignore:
Timestamp:
Oct 14, 2018, 5:20:05 PM (5 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
9318cfb0
Parents:
55b69ed
git-author:
Sebastian Huber <sebastian.huber@…> (10/14/18 17:20:05)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/29/18 09:33:37)
Message:

posix: Split posix_api_configuration_table

Use separate configuration variables to avoid false dependencies.

Update #2514.

Location:
cpukit
Files:
6 added
17 edited

Legend:

Unmodified
Added
Removed
  • cpukit/Makefile.am

    r55b69ed re97806a  
    510510librtemscpu_a_SOURCES += posix/src/mlock.c
    511511librtemscpu_a_SOURCES += posix/src/mprotect.c
     512librtemscpu_a_SOURCES += posix/src/mqueueconfig.c
    512513librtemscpu_a_SOURCES += posix/src/msync.c
    513514librtemscpu_a_SOURCES += posix/src/munlockall.c
     
    546547librtemscpu_a_SOURCES += posix/src/prwlockunlock.c
    547548librtemscpu_a_SOURCES += posix/src/prwlockwrlock.c
     549librtemscpu_a_SOURCES += posix/src/psignalconfig.c
    548550librtemscpu_a_SOURCES += posix/src/pspindestroy.c
    549551librtemscpu_a_SOURCES += posix/src/pspininit.c
     
    551553librtemscpu_a_SOURCES += posix/src/pspinunlock.c
    552554librtemscpu_a_SOURCES += posix/src/psxpriorityisvalid.c
     555librtemscpu_a_SOURCES += posix/src/psxsemaphoreconfig.c
     556librtemscpu_a_SOURCES += posix/src/psxtimerconfig.c
    553557librtemscpu_a_SOURCES += posix/src/psxtransschedparam.c
    554558librtemscpu_a_SOURCES += posix/src/pthreadatfork.c
     
    577581librtemscpu_a_SOURCES += posix/src/pthreadattrsetstacksize.c
    578582librtemscpu_a_SOURCES += posix/src/pthreadconcurrency.c
     583librtemscpu_a_SOURCES += posix/src/pthreadconfig.c
    579584librtemscpu_a_SOURCES += posix/src/pthreaddetach.c
    580585librtemscpu_a_SOURCES += posix/src/pthreadequal.c
     
    610615librtemscpu_a_SOURCES += posix/src/setcancelstate.c
    611616librtemscpu_a_SOURCES += posix/src/setcanceltype.c
     617librtemscpu_a_SOURCES += posix/src/shmconfig.c
    612618librtemscpu_a_SOURCES += posix/src/sigaddset.c
    613619librtemscpu_a_SOURCES += posix/src/sigdelset.c
  • cpukit/include/rtems/confdefs.h

    r55b69ed re97806a  
    9595   */
    9696  extern rtems_multiprocessing_table      Multiprocessing_configuration;
    97 #endif
    98 
    99 #ifdef RTEMS_POSIX_API
    100   /**
    101    * This it the POSIX API configuration table.
    102    */
    103   extern posix_api_configuration_table    Configuration_POSIX_API;
    10497#endif
    10598
     
    24272420    _Configure_POSIX_Named_Object_RAM(_shms, sizeof(POSIX_Shm_Control) )
    24282421
    2429 
    24302422  #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE
    2431 
    2432     #ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
    2433 
    2434       /*
    2435        *  The user is defining their own table information and setting the
    2436        *  appropriate variables for the POSIX Initialization Thread Table.
    2437        */
    2438 
    2439     #else
    2440 
     2423    #ifndef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
    24412424      #ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT
    24422425        #define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT   POSIX_Init
     
    24502433      #ifdef CONFIGURE_INIT
    24512434        posix_initialization_threads_table POSIX_Initialization_threads[] = {
    2452           { CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT, \
    2453               CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE }
     2435          { CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT,
     2436            CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE }
    24542437        };
    24552438      #endif
    24562439
    24572440      #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME \
    2458               POSIX_Initialization_threads
     2441        POSIX_Initialization_threads
    24592442
    24602443      #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \
    2461               RTEMS_ARRAY_SIZE(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME)
    2462 
    2463     #endif    /* CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */
    2464 
    2465   #else     /* CONFIGURE_POSIX_INIT_THREAD_TABLE */
    2466 
     2444        RTEMS_ARRAY_SIZE(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME)
     2445    #endif /* !CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */
     2446  #else /* !CONFIGURE_POSIX_INIT_THREAD_TABLE */
    24672447    #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME NULL
    24682448    #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE 0
    2469 
    2470   #endif
    2471 
     2449  #endif /* CONFIGURE_POSIX_INIT_THREAD_TABLE */
    24722450#else
    2473 
    24742451  /**
    24752452   * This configuration parameter specifies the maximum number of
     
    24772454   */
    24782455  #define CONFIGURE_MAXIMUM_POSIX_THREADS         0
    2479 
    2480 #endif    /* RTEMS_POSIX_API */
     2456#endif /* RTEMS_POSIX_API */
    24812457
    24822458/**
     
    30072983  };
    30082984
     2985  #if CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES > 0
     2986    const uint32_t _Configuration_POSIX_Maximum_message_queues =
     2987      CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES;
     2988  #endif
     2989
     2990  #if CONFIGURE_MAXIMUM_POSIX_SEMAPHORES > 0
     2991    const uint32_t _Configuration_POSIX_Maximum_named_semaphores =
     2992      CONFIGURE_MAXIMUM_POSIX_SEMAPHORES;
     2993  #endif
     2994
     2995  #if CONFIGURE_MAXIMUM_POSIX_SHMS > 0
     2996    const uint32_t _Configuration_POSIX_Maximum_shms =
     2997      CONFIGURE_MAXIMUM_POSIX_SHMS;
     2998  #endif
     2999
     3000  #if _CONFIGURE_POSIX_THREADS > 0
     3001    const uint32_t _Configuration_POSIX_Maximum_threads =
     3002      _CONFIGURE_POSIX_THREADS;
     3003  #endif
     3004
    30093005  #ifdef RTEMS_POSIX_API
    3010     /**
    3011      * This is the POSIX API Configuration Table.
    3012      */
    3013     posix_api_configuration_table Configuration_POSIX_API = {
    3014       _CONFIGURE_POSIX_THREADS,
    3015       CONFIGURE_MAXIMUM_POSIX_TIMERS,
    3016       CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS,
    3017       CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES,
    3018       CONFIGURE_MAXIMUM_POSIX_SEMAPHORES,
    3019       CONFIGURE_MAXIMUM_POSIX_SHMS,
    3020       CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE,
    3021       CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME
    3022     };
    3023 
    3024     const size_t _Configuration_POSIX_Minimum_stack_size =
    3025       CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE;
    3026   #endif
     3006    #if CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS > 0
     3007      const uint32_t _Configuration_POSIX_Maximum_queued_signals =
     3008        CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS;
     3009    #endif
     3010
     3011    #if CONFIGURE_MAXIMUM_POSIX_TIMERS > 0
     3012      const uint32_t _Configuration_POSIX_Maximum_timers =
     3013        CONFIGURE_MAXIMUM_POSIX_TIMERS;
     3014    #endif
     3015
     3016    posix_initialization_threads_table * const
     3017      _Configuration_POSIX_Initialization_threads =
     3018        CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME;
     3019
     3020    const size_t _Configuration_POSIX_Initialization_thread_count =
     3021      CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE;
     3022  #endif
     3023
     3024  const size_t _Configuration_POSIX_Minimum_stack_size =
     3025    CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE;
    30273026
    30283027  /**
  • cpukit/include/rtems/posix/config.h

    r55b69ed re97806a  
    4747} posix_initialization_threads_table;
    4848
    49 /**
    50  *  The following records define the POSIX Configuration Table.
    51  *  The information contained in this table is required in all
    52  *  RTEMS systems which include POSIX threads support, whether
    53  *  single or multiprocessor.  This table primarily defines the
    54  *  following:
    55  *
    56  *     + required number of each object type
    57  */
    58 typedef struct {
    59   /**
    60    * This field contains the maximum number of POSIX API
    61    * threads which are configured for this application.
    62    */
    63   uint32_t                            maximum_threads;
     49extern posix_initialization_threads_table * const
     50  _Configuration_POSIX_Initialization_threads;
    6451
    65   /**
    66    * This field contains the maximum number of POSIX API
    67    * timers which are configured for this application.
    68    */
    69   uint32_t                            maximum_timers;
    70 
    71   /**
    72    * This field contains the maximum number of POSIX API
    73    * queued signals which are configured for this application.
    74    */
    75   uint32_t                            maximum_queued_signals;
    76 
    77   /**
    78    * This field contains the maximum number of POSIX API
    79    * message queues which are configured for this application.
    80    */
    81   uint32_t                            maximum_message_queues;
    82 
    83   /**
    84    * This field contains the maximum number of POSIX API
    85    * semaphores which are configured for this application.
    86    */
    87   uint32_t                            maximum_semaphores;
    88 
    89   /**
    90    * Maximum configured number of POSIX Shared memory objects.
    91    */
    92   uint32_t                            maximum_shms;
    93 
    94   /**
    95    * This field contains the number of POSIX API Initialization
    96    * threads listed in @a User_initialization_thread_table.
    97    */
    98   uint32_t                            number_of_initialization_threads;
    99 
    100   /**
    101    * This field contains the list of POSIX API Initialization threads.
    102    */
    103   posix_initialization_threads_table *User_initialization_threads_table;
    104 } posix_api_configuration_table;
    105 
    106 /**
    107  * @brief POSIX API configuration table.
    108  *
    109  * This is the POSIX API Configuration Table expected to be generated
    110  * by confdefs.h.
    111  */
    112 extern posix_api_configuration_table Configuration_POSIX_API;
     52extern const size_t _Configuration_POSIX_Initialization_thread_count;
    11353
    11454/**@}*/
  • cpukit/include/rtems/posix/mqueue.h

    r55b69ed re97806a  
    6262}  POSIX_Message_queue_Control;
    6363
     64extern const uint32_t _Configuration_POSIX_Maximum_message_queues;
     65
    6466/** @} */
    6567
  • cpukit/include/rtems/posix/psignal.h

    r55b69ed re97806a  
    3232}  POSIX_signals_Siginfo_node;
    3333
     34extern const uint32_t _Configuration_POSIX_Maximum_queued_signals;
     35
    3436#endif
    3537/* end of file */
  • cpukit/include/rtems/posix/pthread.h

    r55b69ed re97806a  
    2020#define _RTEMS_POSIX_PTHREAD_H
    2121
    22 #include <rtems/posix/config.h>
    2322#include <rtems/posix/threadsup.h>
    2423#include <rtems/score/thread.h>
     
    4039extern const size_t _Configuration_POSIX_Minimum_stack_size;
    4140
     41extern const uint32_t _Configuration_POSIX_Maximum_threads;
     42
    4243/**
    4344 * @brief POSIX threads initialize user threads body.
  • cpukit/include/rtems/posix/semaphore.h

    r55b69ed re97806a  
    4747}  POSIX_Semaphore_Control;
    4848
     49extern const uint32_t _Configuration_POSIX_Maximum_named_semaphores;
     50
    4951/** @} */
    5052
  • cpukit/include/rtems/posix/shm.h

    r55b69ed re97806a  
    1818#include <rtems/score/object.h>
    1919#include <rtems/score/threadq.h>
     20
     21#include <sys/types.h>
    2022
    2123#ifdef __cplusplus
     
    125127} POSIX_Shm_Control;
    126128
     129extern const uint32_t _Configuration_POSIX_Maximum_shms;
     130
    127131/**
    128132 * @brief object_create operation for shm objects stored in RTEMS Workspace.
  • cpukit/include/rtems/posix/timer.h

    r55b69ed re97806a  
    5151} POSIX_Timer_Control;
    5252
     53extern const uint32_t _Configuration_POSIX_Maximum_timers;
     54
    5355/** @} */
    5456
  • cpukit/posix/src/mqueue.c

    r55b69ed re97806a  
    5252    OBJECTS_POSIX_API,                 /* object API */
    5353    OBJECTS_POSIX_MESSAGE_QUEUES,      /* object class */
    54     Configuration_POSIX_API.maximum_message_queues,
    55                                 /* maximum objects of this class */
     54    _Configuration_POSIX_Maximum_message_queues,
    5655    sizeof( POSIX_Message_queue_Control ),
    5756                                /* size of this object's control block */
  • cpukit/posix/src/psignal.c

    r55b69ed re97806a  
    104104  uint32_t   maximum_queued_signals;
    105105
    106   maximum_queued_signals = Configuration_POSIX_API.maximum_queued_signals;
     106  maximum_queued_signals = _Configuration_POSIX_Maximum_queued_signals;
    107107
    108108  memcpy(
  • cpukit/posix/src/psxsemaphore.c

    r55b69ed re97806a  
    4343    OBJECTS_POSIX_API,          /* object API */
    4444    OBJECTS_POSIX_SEMAPHORES,   /* object class */
    45     Configuration_POSIX_API.maximum_semaphores,
    46                                 /* maximum objects of this class */
     45    _Configuration_POSIX_Maximum_named_semaphores,
    4746    sizeof( POSIX_Semaphore_Control ),
    4847                                /* size of this object's control block */
  • cpukit/posix/src/pthread.c

    r55b69ed re97806a  
    182182    OBJECTS_POSIX_API,           /* object API */
    183183    OBJECTS_POSIX_THREADS,       /* object class */
    184     Configuration_POSIX_API.maximum_threads
    185                                  /* maximum objects of this class */
     184    _Configuration_POSIX_Maximum_threads
    186185  );
    187186
  • cpukit/posix/src/pthreadinitthreads.c

    r55b69ed re97806a  
    4242  pthread_attr_t                      attr;
    4343
    44   user_threads = Configuration_POSIX_API.User_initialization_threads_table;
    45   maximum      = Configuration_POSIX_API.number_of_initialization_threads;
     44  user_threads = _Configuration_POSIX_Initialization_threads;
     45  maximum      = _Configuration_POSIX_Initialization_thread_count;
    4646
    4747  if ( !user_threads )
  • cpukit/posix/src/ptimer.c

    r55b69ed re97806a  
    6363    OBJECTS_POSIX_API,          /* object API */
    6464    OBJECTS_POSIX_TIMERS,       /* object class */
    65     Configuration_POSIX_API.maximum_timers,
    66                                 /* maximum objects of this class */
     65    _Configuration_POSIX_Maximum_timers,
    6766    sizeof( POSIX_Timer_Control ),
    6867                                /* size of this object's control block */
  • cpukit/posix/src/shm.c

    r55b69ed re97806a  
    3333    OBJECTS_POSIX_API,          /* object API */
    3434    OBJECTS_POSIX_SHMS,         /* object class */
    35     Configuration_POSIX_API.maximum_shms,
    36                                 /* maximum objects of this class */
     35    _Configuration_POSIX_Maximum_shms,
    3736    sizeof( POSIX_Shm_Control ),
    3837                                /* size of this object's control block */
  • cpukit/score/src/wkspace.c

    r55b69ed re97806a  
    2626#include <rtems/score/threadimpl.h>
    2727#include <rtems/score/tls.h>
     28#include <rtems/posix/pthread.h>
    2829#include <rtems/config.h>
    2930
     
    5556#if defined(RTEMS_POSIX_API)
    5657  thread_count += rtems_resource_maximum_per_allocation(
    57     Configuration_POSIX_API.maximum_threads
     58    _Configuration_POSIX_Maximum_threads
    5859  );
    5960#endif
Note: See TracChangeset for help on using the changeset viewer.