source: rtems/cpukit/posix/include/rtems/posix/semaphore.h @ 97e2729d

4.104.114.84.95
Last change on this file since 97e2729d was 97e2729d, checked in by Joel Sherrill <joel.sherrill@…>, on Nov 23, 1998 at 5:38:09 PM

Added --disable-multiprocessing flag and modified a lot of files to make
it work.

  • Property mode set to 100644
File size: 3.0 KB
Line 
1/*  rtems/posix/semaphore.h
2 *
3 *  This include file contains all the private support information for
4 *  POSIX Semaphores.
5 *
6 *  COPYRIGHT (c) 1989-1998.
7 *  On-Line Applications Research Corporation (OAR).
8 *  Copyright assigned to U.S. Government, 1994.
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.OARcorp.com/rtems/license.html.
13 *
14 *  $Id$
15 */
16 
17#ifndef __RTEMS_POSIX_SEMAPHORE_h
18#define __RTEMS_POSIX_SEMAPHORE_h
19 
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24#include <rtems/score/coresem.h>
25
26/*
27 *  Data Structure used to manage a POSIX semaphore
28 */
29 
30typedef struct {
31   Objects_Control         Object;
32   int                     process_shared;
33   boolean                 named;
34   boolean                 linked;
35   unsigned32              open_count;
36   CORE_semaphore_Control  Semaphore;
37}  POSIX_Semaphore_Control;
38
39/*
40 *  The following defines the information control block used to manage
41 *  this class of objects.
42 */
43 
44POSIX_EXTERN Objects_Information  _POSIX_Semaphore_Information;
45 
46/*
47 *  _POSIX_Semaphore_Manager_initialization
48 *
49 *  DESCRIPTION:
50 *
51 *  This routine performs the initialization necessary for this manager.
52 */
53 
54void _POSIX_Semaphore_Manager_initialization(
55  unsigned32 maximum_semaphorees
56);
57 
58/*
59 *  _POSIX_Semaphore_Allocate
60 *
61 *  DESCRIPTION:
62 *
63 *  This function allocates a semaphore control block from
64 *  the inactive chain of free semaphore control blocks.
65 */
66 
67RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void );
68 
69/*
70 *  _POSIX_Semaphore_Free
71 *
72 *  DESCRIPTION:
73 *
74 *  This routine frees a semaphore control block to the
75 *  inactive chain of free semaphore control blocks.
76 */
77 
78RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free (
79  POSIX_Semaphore_Control *the_semaphore
80);
81 
82/*
83 *  _POSIX_Semaphore_Get
84 *
85 *  DESCRIPTION:
86 *
87 *  This function maps semaphore IDs to semaphore control blocks.
88 *  If ID corresponds to a local semaphore, then it returns
89 *  the_semaphore control pointer which maps to ID and location
90 *  is set to OBJECTS_LOCAL.  if the semaphore ID is global and
91 *  resides on a remote node, then location is set to OBJECTS_REMOTE,
92 *  and the_semaphore is undefined.  Otherwise, location is set
93 *  to OBJECTS_ERROR and the_semaphore is undefined.
94 */
95 
96RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get (
97  Objects_Id        *id,
98  Objects_Locations *location
99);
100 
101/*
102 *  _POSIX_Semaphore_Is_null
103 *
104 *  DESCRIPTION:
105 *
106 *  This function returns TRUE if the_semaphore is NULL and FALSE otherwise.
107 */
108 
109RTEMS_INLINE_ROUTINE boolean _POSIX_Semaphore_Is_null (
110  POSIX_Semaphore_Control *the_semaphore
111);
112
113/*
114 *  _POSIX_Semaphore_Name_to_id
115 *
116 *  DESCRIPTION:
117 *
118 *  XXX
119 */
120
121int _POSIX_Semaphore_Name_to_id(
122  const char          *name,
123  Objects_Id          *id
124);
125
126#include <rtems/posix/semaphore.inl>
127#if defined(RTEMS_MULTIPROCESSING)
128#include <rtems/posix/semaphoremp.h>
129#endif
130
131#ifdef __cplusplus
132}
133#endif
134 
135#endif
136/*  end of include file */
137
Note: See TracBrowser for help on using the repository browser.