Changeset 9318cfb0 in rtems for cpukit


Ignore:
Timestamp:
Oct 14, 2018, 10:43:13 AM (12 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
701057e0
Parents:
e97806a
git-author:
Sebastian Huber <sebastian.huber@…> (10/14/18 10:43:13)
git-committer:
Sebastian Huber <sebastian.huber@…> (10/29/18 09:33:37)
Message:

posix: Provide named semaphores by default

Update #2514.

Location:
cpukit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/Makefile.am

    re97806a r9318cfb0  
    552552librtemscpu_a_SOURCES += posix/src/pspinlock.c
    553553librtemscpu_a_SOURCES += posix/src/pspinunlock.c
     554librtemscpu_a_SOURCES += posix/src/psxnametoid.c
    554555librtemscpu_a_SOURCES += posix/src/psxpriorityisvalid.c
     556librtemscpu_a_SOURCES += posix/src/psxsemaphore.c
    555557librtemscpu_a_SOURCES += posix/src/psxsemaphoreconfig.c
    556558librtemscpu_a_SOURCES += posix/src/psxtimerconfig.c
     
    606608librtemscpu_a_SOURCES += posix/src/sched_setscheduler.c
    607609librtemscpu_a_SOURCES += posix/src/sched_yield.c
     610librtemscpu_a_SOURCES += posix/src/semaphoredeletesupp.c
     611librtemscpu_a_SOURCES += posix/src/semclose.c
    608612librtemscpu_a_SOURCES += posix/src/semdestroy.c
    609613librtemscpu_a_SOURCES += posix/src/semgetvalue.c
    610614librtemscpu_a_SOURCES += posix/src/seminit.c
     615librtemscpu_a_SOURCES += posix/src/semopen.c
    611616librtemscpu_a_SOURCES += posix/src/sempost.c
    612617librtemscpu_a_SOURCES += posix/src/semtimedwait.c
    613618librtemscpu_a_SOURCES += posix/src/semtrywait.c
     619librtemscpu_a_SOURCES += posix/src/semunlink.c
    614620librtemscpu_a_SOURCES += posix/src/semwait.c
    615621librtemscpu_a_SOURCES += posix/src/setcancelstate.c
     
    10561062librtemscpu_a_SOURCES += posix/src/psignalsetprocesssignals.c
    10571063librtemscpu_a_SOURCES += posix/src/psignalunblockthread.c
    1058 librtemscpu_a_SOURCES += posix/src/psxnametoid.c
    10591064librtemscpu_a_SOURCES += posix/src/psxpriorityisvalid.c
    1060 librtemscpu_a_SOURCES += posix/src/psxsemaphore.c
    10611065librtemscpu_a_SOURCES += posix/src/psxtimercreate.c
    10621066librtemscpu_a_SOURCES += posix/src/psxtimerdelete.c
     
    10701074librtemscpu_a_SOURCES += posix/src/pthreadsigmask.c
    10711075librtemscpu_a_SOURCES += posix/src/ptimer.c
    1072 librtemscpu_a_SOURCES += posix/src/semaphoredeletesupp.c
    1073 librtemscpu_a_SOURCES += posix/src/semclose.c
    1074 librtemscpu_a_SOURCES += posix/src/semopen.c
    1075 librtemscpu_a_SOURCES += posix/src/semunlink.c
    10761076librtemscpu_a_SOURCES += posix/src/setitimer.c
    10771077librtemscpu_a_SOURCES += posix/src/shm.c
  • cpukit/include/rtems/confdefs.h

    re97806a r9318cfb0  
    3333#include <rtems/score/userextimpl.h>
    3434#include <rtems/score/wkspace.h>
     35#include <rtems/posix/key.h>
     36#include <rtems/posix/semaphore.h>
     37
     38#include <limits.h>
    3539
    3640#ifdef CONFIGURE_DISABLE_BSP_SETTINGS
     
    19331937      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
    19341938  #endif
     1939  #if !defined(CONFIGURE_MAXIMUM_POSIX_SEMAPHORES)
     1940    #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES \
     1941      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
     1942  #endif
    19351943
    19361944  #ifdef RTEMS_POSIX_API
     
    19511959    #if !defined(CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES)
    19521960      #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES \
    1953         rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
    1954     #endif
    1955     #if !defined(CONFIGURE_MAXIMUM_POSIX_SEMAPHORES)
    1956       #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES \
    19571961        rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
    19581962    #endif
     
    22572261/**@{*/
    22582262
    2259 #include <rtems/posix/key.h>
    2260 
    22612263/**
    22622264 * This configuration parameter specifies the maximum number of
     
    22982300
    22992301/*
     2302 * Account for the object control structures plus the name
     2303 * of the object to be duplicated.
     2304 */
     2305#define _Configure_POSIX_Named_Object_RAM(_number, _size) \
     2306  (_Configure_Object_RAM(_number, _size) \
     2307    + _Configure_Max_Objects(_number) \
     2308      * _Configure_From_workspace(_POSIX_PATH_MAX + 1))
     2309
     2310/**
     2311 * This configuration parameter specifies the maximum number of
     2312 * POSIX API semaphores.
     2313 */
     2314#ifndef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES
     2315  #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 0
     2316#endif
     2317
     2318/*
     2319 * This macro is calculated to specify the memory required for
     2320 * POSIX API semaphores.
     2321 */
     2322#define _CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) \
     2323  _Configure_POSIX_Named_Object_RAM( \
     2324     _semaphores, sizeof(POSIX_Semaphore_Control) )
     2325
     2326/*
    23002327 *  The rest of the POSIX threads API features are only available when
    23012328 *  POSIX is enabled.
     
    23042331  #include <sys/types.h>
    23052332  #include <signal.h>
    2306   #include <limits.h>
    23072333  #include <mqueue.h>
    23082334  #include <rtems/posix/mqueue.h>
    23092335  #include <rtems/posix/psignal.h>
    23102336  #include <rtems/posix/pthread.h>
    2311   #include <rtems/posix/semaphore.h>
    23122337  #include <rtems/posix/shm.h>
    23132338  #include <rtems/posix/threadsup.h>
    23142339  #include <rtems/posix/timer.h>
    23152340
    2316   /*
    2317    * Account for the object control structures plus the name
    2318    * of the object to be duplicated.
    2319    */
    2320   #define _Configure_POSIX_Named_Object_RAM(_number, _size) \
    2321     (_Configure_Object_RAM(_number, _size) \
    2322       + _Configure_Max_Objects(_number) \
    2323         * _Configure_From_workspace(_POSIX_PATH_MAX + 1))
    2324 
    23252341  /**
    23262342   * This configuration parameter specifies the maximum number of
     
    23772393    _Configure_POSIX_Named_Object_RAM( \
    23782394       _message_queues, sizeof(POSIX_Message_queue_Control) )
    2379 
    2380   /**
    2381    * This configuration parameter specifies the maximum number of
    2382    * POSIX API semaphores.
    2383    */
    2384   #ifndef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES
    2385     #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 0
    2386   #endif
    2387 
    2388   /*
    2389    * This macro is calculated to specify the memory required for
    2390    * POSIX API semaphores.
    2391    */
    2392   #define _CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) \
    2393     _Configure_POSIX_Named_Object_RAM( \
    2394        _semaphores, sizeof(POSIX_Semaphore_Control) )
    23952395
    23962396  /**
     
    25602560      _CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( \
    25612561        CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES) + \
    2562       _CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( \
    2563         CONFIGURE_MAXIMUM_POSIX_SEMAPHORES) + \
    25642562      _CONFIGURE_MEMORY_FOR_POSIX_SHMS( \
    25652563        CONFIGURE_MAXIMUM_POSIX_SHMS) + \
     
    27222720      _CONFIGURE_POSIX_KEYS, \
    27232721      CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS ) + \
     2722   _CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( \
     2723     CONFIGURE_MAXIMUM_POSIX_SEMAPHORES) + \
    27242724   _CONFIGURE_MEMORY_FOR_POSIX + \
    27252725   _CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS + \
     
    32203220    uint32_t POSIX_KEYS;
    32213221
     3222    /* POSIX API Pieces */
    32223223#ifdef RTEMS_POSIX_API
    3223     /* POSIX API Pieces */
    32243224    uint32_t POSIX_TIMERS;
    32253225    uint32_t POSIX_QUEUED_SIGNALS;
    32263226    uint32_t POSIX_MESSAGE_QUEUES;
     3227#endif
    32273228    uint32_t POSIX_SEMAPHORES;
     3229#ifdef RTEMS_POSIX_API
    32283230    uint32_t POSIX_SHMS;
    32293231#endif
     
    32733275    _CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(
    32743276      CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ),
     3277#endif
    32753278    _CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ),
     3279#ifdef RTEMS_POSIX_API
    32763280    _CONFIGURE_MEMORY_FOR_POSIX_SHMS( CONFIGURE_MAXIMUM_POSIX_SHMS ),
    32773281    _CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ),
     
    33413345       (CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS != 0) || \
    33423346       (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES != 0) || \
    3343        (CONFIGURE_MAXIMUM_POSIX_SEMAPHORES != 0) || \
    33443347       (CONFIGURE_MAXIMUM_POSIX_SHMS != 0) || \
    33453348      defined(CONFIGURE_POSIX_INIT_THREAD_TABLE))
  • cpukit/rtems/src/rtemsobjectgetapiclassname.c

    re97806a r9318cfb0  
    4343};
    4444
     45static const rtems_assoc_t rtems_object_api_posix_assoc[] = {
    4546#ifdef RTEMS_POSIX_API
    46 static const rtems_assoc_t rtems_object_api_posix_assoc[] = {
    4747  { "Thread",                  OBJECTS_POSIX_THREADS, 0},
    4848  { "Key",                     OBJECTS_POSIX_KEYS, 0},
    4949  { "Interrupt",               OBJECTS_POSIX_INTERRUPTS, 0},
    5050  { "Message Queue",           OBJECTS_POSIX_MESSAGE_QUEUES, 0},
     51#endif
    5152  { "Semaphore",               OBJECTS_POSIX_SEMAPHORES, 0},
     53#ifdef RTEMS_POSIX_API
    5254  { "Timer",                   OBJECTS_POSIX_TIMERS, 0},
    5355  { "Shared Memory",           OBJECTS_POSIX_SHMS, 0},
     56#endif
    5457  { NULL,                      0, 0}
    5558};
    56 #endif
    5759
    5860const char *rtems_object_get_api_class_name(
     
    6870  else if ( the_api == OBJECTS_CLASSIC_API )
    6971    api_assoc = rtems_object_api_classic_assoc;
    70 #ifdef RTEMS_POSIX_API
    7172  else if ( the_api == OBJECTS_POSIX_API )
    7273    api_assoc = rtems_object_api_posix_assoc;
    73 #endif
    7474  else
    7575    return "BAD API";
Note: See TracChangeset for help on using the changeset viewer.