source: rtems/cpukit/posix/include/rtems/posix/semaphore.h @ 21242c2

4.115
Last change on this file since 21242c2 was 21242c2, checked in by Joel Sherrill <joel.sherrill@…>, on 06/24/11 at 17:52:58

2011-06-24 Joel Sherrill <joel.sherrill@…>

  • include/rtems/bspIo.h, include/rtems/concat.h, include/rtems/endian.h, include/rtems/fs.h, include/rtems/irq.h, include/rtems/pci.h, include/rtems/userenv.h, libblock/include/rtems/flashdisk.h, libblock/include/rtems/nvdisk-sram.h, libblock/include/rtems/nvdisk.h, libcsupport/include/clockdrv.h, libcsupport/include/console.h, libcsupport/include/iosupp.h, libcsupport/include/spurious.h, libcsupport/include/motorola/mc68230.h, libcsupport/include/rtems/assoc.h, libcsupport/include/rtems/error.h, libcsupport/include/rtems/framebuffer.h, libcsupport/include/rtems/gxx_wrappers.h, libcsupport/include/rtems/libcsupport.h, libcsupport/include/rtems/libio_.h, libcsupport/include/rtems/malloc.h, libcsupport/include/rtems/termiostypes.h, libcsupport/include/sys/statvfs.h, libcsupport/include/sys/termios.h, libcsupport/include/sys/utsname.h, libcsupport/include/zilog/z8036.h, libcsupport/include/zilog/z8530.h, libcsupport/include/zilog/z8536.h, libfs/src/imfs/imfs.h, libfs/src/pipe/pipe.h, libmisc/capture/capture-cli.h, libmisc/capture/capture.h, libmisc/cpuuse/cpuuse.h, libmisc/devnull/devnull.h, libmisc/devnull/devzero.h, libmisc/dumpbuf/dumpbuf.h, libmisc/fb/fb.h, libmisc/fb/mw_uid.h, libmisc/mouse/mouse_parser.h, libmisc/shell/shellconfig.h, libmisc/stringto/stringto.h, libmisc/untar/untar.h, libnetworking/memory.h, posix/include/aio.h, posix/include/mqueue.h, posix/include/semaphore.h, posix/include/rtems/posix/aio_misc.h, posix/include/rtems/posix/barrier.h, posix/include/rtems/posix/cond.h, posix/include/rtems/posix/config.h, posix/include/rtems/posix/key.h, posix/include/rtems/posix/mqueue.h, posix/include/rtems/posix/mutex.h, posix/include/rtems/posix/posixapi.h, posix/include/rtems/posix/priority.h, posix/include/rtems/posix/psignal.h, posix/include/rtems/posix/pthread.h, posix/include/rtems/posix/ptimer.h, posix/include/rtems/posix/rwlock.h, posix/include/rtems/posix/semaphore.h, posix/include/rtems/posix/sigset.h, posix/include/rtems/posix/spinlock.h, posix/include/rtems/posix/threadsup.h, posix/include/rtems/posix/time.h, posix/include/rtems/posix/timer.h, posix/inline/rtems/posix/barrier.inl, posix/inline/rtems/posix/cond.inl, posix/inline/rtems/posix/mqueue.inl, posix/inline/rtems/posix/mutex.inl, posix/inline/rtems/posix/priority.inl, posix/inline/rtems/posix/pthread.inl, posix/inline/rtems/posix/rwlock.inl, posix/inline/rtems/posix/semaphore.inl, posix/inline/rtems/posix/spinlock.inl, posix/inline/rtems/posix/timer.inl, rtems/mainpage.h, rtems/include/rtems/rtems/barrier.h, rtems/include/rtems/rtems/object.h, rtems/include/rtems/rtems/timer.h, rtems/inline/rtems/rtems/barrier.inl, rtems/inline/rtems/rtems/timer.inl, rtems/src/semtranslatereturncode.c, sapi/include/rtems/config.h, sapi/include/rtems/fatal.h, sapi/include/rtems/mptables.h, score/include/rtems/score/object.h, score/include/rtems/score/priority.h, score/inline/rtems/score/object.inl, score/inline/rtems/score/priority.inl: Add @file Doxygen directives and descriptions to files which originated with RTEMS. This improves the file list page generated by Doxygen.
  • Property mode set to 100644
File size: 4.2 KB
Line 
1/**
2 * @file rtems/posix/semaphore.h
3 *
4 * This include file contains all the private support information for
5 * POSIX Semaphores.
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2011.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.com/license/LICENSE.
15 *
16 *  $Id$
17 */
18
19#ifndef _RTEMS_POSIX_SEMAPHORE_H
20#define _RTEMS_POSIX_SEMAPHORE_H
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26#include <semaphore.h>
27#include <rtems/score/coresem.h>
28
29/*
30 *  Data Structure used to manage a POSIX semaphore
31 */
32
33typedef struct {
34   Objects_Control         Object;
35   int                     process_shared;
36   bool                    named;
37   bool                    linked;
38   uint32_t                open_count;
39   CORE_semaphore_Control  Semaphore;
40   /*
41    *  sem_t is 32-bit.  If Object_Id is 16-bit, then they are not
42    *  interchangeable.  We have to be able to return a pointer to
43    *  a 32-bit form of the 16-bit Id.
44    */
45   #if defined(RTEMS_USE_16_BIT_OBJECT)
46     sem_t                 Semaphore_id;
47   #endif
48}  POSIX_Semaphore_Control;
49
50/*
51 *  The following defines the information control block used to manage
52 *  this class of objects.
53 */
54
55POSIX_EXTERN Objects_Information  _POSIX_Semaphore_Information;
56
57/*
58 *  _POSIX_Semaphore_Manager_initialization
59 *
60 *  DESCRIPTION:
61 *
62 *  This routine performs the initialization necessary for this manager.
63 */
64
65void _POSIX_Semaphore_Manager_initialization(void);
66
67/*
68 *  _POSIX_Semaphore_Allocate
69 *
70 *  DESCRIPTION:
71 *
72 *  This function allocates a semaphore control block from
73 *  the inactive chain of free semaphore control blocks.
74 */
75
76RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void );
77
78/*
79 *  _POSIX_Semaphore_Free
80 *
81 *  DESCRIPTION:
82 *
83 *  This routine frees a semaphore control block to the
84 *  inactive chain of free semaphore control blocks.
85 */
86
87RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
88  POSIX_Semaphore_Control *the_semaphore
89);
90
91/*
92 *  _POSIX_Semaphore_Get
93 *
94 *  DESCRIPTION:
95 *
96 *  This function maps semaphore IDs to semaphore control blocks.
97 *  If ID corresponds to a local semaphore, then it returns
98 *  the_semaphore control pointer which maps to ID and location
99 *  is set to OBJECTS_LOCAL.  if the semaphore ID is global and
100 *  resides on a remote node, then location is set to OBJECTS_REMOTE,
101 *  and the_semaphore is undefined.  Otherwise, location is set
102 *  to OBJECTS_ERROR and the_semaphore is undefined.
103 */
104
105RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
106  sem_t        *id,
107  Objects_Locations *location
108);
109
110/*
111 *  _POSIX_Semaphore_Is_null
112 *
113 *  DESCRIPTION:
114 *
115 *  This function returns TRUE if the_semaphore is NULL and FALSE otherwise.
116 */
117
118RTEMS_INLINE_ROUTINE bool _POSIX_Semaphore_Is_null (
119  POSIX_Semaphore_Control *the_semaphore
120);
121
122/*
123 *  _POSIX_Semaphore_Create_support
124 *
125 *  DESCRIPTION:
126 *
127 *  This routine supports the sem_init and sem_open routines.
128 */
129
130int _POSIX_Semaphore_Create_support(
131  const char                *name,
132  int                        pshared,
133  unsigned int               value,
134  POSIX_Semaphore_Control  **the_sem
135);
136
137/*
138 *  _POSIX_Semaphore_Delete
139 *
140 *  DESCRIPTION:
141 *
142 *  This routine supports the sem_close and sem_unlink routines.
143 */
144
145void _POSIX_Semaphore_Delete(
146  POSIX_Semaphore_Control *the_semaphore
147);
148
149/*
150 *  _POSIX_Semaphore_Wait_support
151 *
152 *  DESCRIPTION:
153 *
154 *  This routine supports the sem_wait, sem_trywait, and sem_timedwait
155 *  services.
156 */
157
158int _POSIX_Semaphore_Wait_support(
159  sem_t               *sem,
160  bool                 blocking,
161  Watchdog_Interval    timeout
162);
163
164/*
165 *  _POSIX_Semaphore_Name_to_id
166 *
167 *  DESCRIPTION:
168 *
169 *  This routine performs name to id translation.
170 */
171
172int _POSIX_Semaphore_Name_to_id(
173  const char          *name,
174  sem_t          *id
175);
176
177/*
178 *  _POSIX_Semaphore_Translate_core_semaphore_return_code
179 *
180 *  DESCRIPTION:
181 *
182 *  A support routine which converts core semaphore status codes into the
183 *  appropriate POSIX status values.
184 */
185
186int _POSIX_Semaphore_Translate_core_semaphore_return_code(
187  CORE_semaphore_Status  the_semaphore_status
188);
189
190#include <rtems/posix/semaphore.inl>
191
192#ifdef __cplusplus
193}
194#endif
195
196#endif
197/*  end of include file */
Note: See TracBrowser for help on using the repository browser.