source: rtems/cpukit/include/rtems/posix/semaphore.h @ 21275b58

Last change on this file since 21275b58 was 21275b58, checked in by Sebastian Huber <sebastian.huber@…>, on Nov 22, 2018 at 6:14:51 PM

score: Static Objects_Information initialization

Statically allocate the objects information together with the initial
set of objects either via <rtems/confdefs.h>. Provide default object
informations with zero objects via librtemscpu.a. This greatly
simplifies the workspace size estimate. RTEMS applications which do not
use the unlimited objects option are easier to debug since all objects
reside now in statically allocated objects of the right types.

Close #3621.

  • Property mode set to 100644
File size: 1.7 KB
Line 
1/**
2 * @file
3 *
4 * @brief Private Support Information for POSIX Semaphores
5 *
6 * This include file contains all the private support information for
7 * POSIX Semaphores.
8 */
9
10/*
11 *  COPYRIGHT (c) 1989-2011.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.org/license/LICENSE.
17 */
18
19#ifndef _RTEMS_POSIX_SEMAPHORE_H
20#define _RTEMS_POSIX_SEMAPHORE_H
21
22#include <rtems/score/objectdata.h>
23
24#include <limits.h>
25#include <semaphore.h>
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31/**
32 * @defgroup POSIXSemaphorePrivate POSIX Semaphore Private Support
33 *
34 * @ingroup POSIXAPI
35 *
36 * This defines the internal implementation support for POSIX semaphores.
37 */
38/**@{*/
39
40/*
41 *  Data Structure used to manage a POSIX semaphore
42 */
43
44typedef struct {
45   Objects_Control Object;
46   sem_t           Semaphore;
47   bool            linked;
48   uint32_t        open_count;
49}  POSIX_Semaphore_Control;
50
51/**
52 * @brief The POSIX Semaphore objects information.
53 */
54extern Objects_Information _POSIX_Semaphore_Information;
55
56/**
57 * @brief Macro to define the objects information for the POSIX Semaphore
58 * objects.
59 *
60 * This macro should only be used by <rtems/confdefs.h>.
61 *
62 * @param max The configured object maximum (the OBJECTS_UNLIMITED_OBJECTS flag
63 * may be set).
64 */
65#define POSIX_SEMAPHORE_INFORMATION_DEFINE( max ) \
66  OBJECTS_INFORMATION_DEFINE( \
67    _POSIX_Semaphore, \
68    OBJECTS_POSIX_API, \
69    OBJECTS_POSIX_SEMAPHORES, \
70    POSIX_Semaphore_Control, \
71    max, \
72    _POSIX_PATH_MAX, \
73    NULL \
74  )
75
76/** @} */
77
78#ifdef __cplusplus
79}
80#endif
81
82#endif
83/*  end of include file */
Note: See TracBrowser for help on using the repository browser.