source: rtems/cpukit/posix/include/rtems/posix/mqueue.h @ b98d399f

4.115
Last change on this file since b98d399f was b98d399f, checked in by Sebastian Huber <sebastian.huber@…>, on 12/13/11 at 12:56:53

2011-12-13 Sebastian Huber <sebastian.huber@…>

  • posix/src/mqueuenametoid.c, posix/src/semaphorenametoid.c: Removed files.
  • posix/src/psxnametoid.c: New file.
  • posix/Makefile.am: Reflect changes above.
  • posix/include/rtems/posix/config.h: Fixed integer types.
  • posix/include/rtems/posix/posixapi.h: Declare _POSIX_Name_to_id().
  • posix/include/rtems/posix/mqueue.h, posix/inline/rtems/posix/mqueue.inl: Changed parameter of _POSIX_Message_queue_Create_support(). _POSIX_Message_queue_Name_to_id() is now inline.
  • posix/include/rtems/posix/semaphore.h, posix/inline/rtems/posix/semaphore.inl: Changed parameter of _POSIX_Semaphore_Create_support(). _POSIX_Semaphore_Name_to_id() is now inline.
  • posix/src/mqueuecreatesupp.c, posix/src/semaphorecreatesupp.c: Use _Workspace_String_duplicate().
  • posix/src/mqueuesendsupp.c, posix/src/mqueueopen.c, posix/src/mqueueunlink.c, posix/src/seminit.c, posix/src/semopen.c, posix/src/semunlink.c: Update due to API changes.
  • Property mode set to 100644
File size: 5.3 KB
Line 
1/**
2 * @file rtems/posix/mqueue.h
3 *
4 * This include file contains all the private support information for
5 * POSIX Message Queues.
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_MQUEUE_H
20#define _RTEMS_POSIX_MQUEUE_H
21
22#include <signal.h>
23#include <mqueue.h> /* struct mq_attr */
24#include <rtems/score/coremsg.h>
25#include <rtems/score/object.h>
26#include <rtems/posix/posixapi.h>
27
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32/*
33 *  Data Structure used to manage a POSIX message queue
34 */
35
36typedef struct {
37   Objects_Control             Object;
38   int                         process_shared;
39   bool                        named;
40   bool                        linked;
41   uint32_t                    open_count;
42   CORE_message_queue_Control  Message_queue;
43   struct sigevent             notification;
44}  POSIX_Message_queue_Control;
45
46typedef struct {
47   Objects_Control              Object;
48   POSIX_Message_queue_Control *Queue;
49   int                          oflag;
50} POSIX_Message_queue_Control_fd;
51
52/*
53 *  The following defines the information control block used to manage
54 *  this class of objects.  The second item is used to manage the set
55 *  of "file descriptors" associated with the message queues.
56 */
57
58POSIX_EXTERN Objects_Information  _POSIX_Message_queue_Information;
59POSIX_EXTERN Objects_Information  _POSIX_Message_queue_Information_fds;
60
61/*
62 *  _POSIX_Message_queue_Manager_initialization
63 *
64 *  DESCRIPTION:
65 *
66 *  This routine performs the initialization necessary for this manager.
67 */
68
69void _POSIX_Message_queue_Manager_initialization(void);
70
71/*
72 *
73 *  _POSIX_Message_queue_Create_support
74 *
75 *  DESCRIPTION:
76 *
77 *  This routine performs the creation of a message queue utilizing the
78 *  core message queue.
79 */
80
81int _POSIX_Message_queue_Create_support(
82  const char                    *name,
83  size_t                         name_len,
84  int                            pshared,
85  struct mq_attr                *attr,
86  POSIX_Message_queue_Control  **message_queue
87);
88
89/*
90 *  _POSIX_Message_queue_Delete
91 *
92 *  DESCRIPTION:
93 *
94 *  This routine supports the mq_unlink and mq_close routines by
95 *  doing most of the work involved with removing a message queue.
96 */
97
98void _POSIX_Message_queue_Delete(
99  POSIX_Message_queue_Control *the_mq
100);
101
102/*
103 *  _POSIX_Message_queue_Receive_support
104 *
105 *  DESCRIPTION:
106 *
107 *  This routine supports the various flavors of receiving a message.
108 */
109
110ssize_t _POSIX_Message_queue_Receive_support(
111  mqd_t               mqdes,
112  char               *msg_ptr,
113  size_t              msg_len,
114  unsigned int       *msg_prio,
115  bool                wait,
116  Watchdog_Interval   timeout
117);
118
119/*
120 *  _POSIX_Message_queue_Send_support
121 *
122 *  DESCRIPTION:
123 *
124 *  This routine posts a message to a specified message queue.
125 */
126
127int _POSIX_Message_queue_Send_support(
128  mqd_t               mqdes,
129  const char         *msg_ptr,
130  size_t              msg_len,
131  unsigned int        msg_prio,
132  bool                wait,
133  Watchdog_Interval   timeout
134);
135
136/*
137 *  _POSIX_Message_queue_Allocate
138 *
139 *  DESCRIPTION:
140 *
141 *  This function allocates a message queue control block from
142 *  the inactive chain of free message queue control blocks.
143 */
144
145RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void );
146
147/*
148 *  _POSIX_Message_queue_Free
149 *
150 *  DESCRIPTION:
151 *
152 *  This routine frees a message queue control block to the
153 *  inactive chain of free message queue control blocks.
154 */
155
156RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
157  POSIX_Message_queue_Control *the_mq
158);
159
160/*
161 *  _POSIX_Message_queue_Get
162 *
163 *  DESCRIPTION:
164 *
165 *  This function maps message queue IDs to message queue control blocks.
166 *  If ID corresponds to a local message queue, then it returns
167 *  the_mq control pointer which maps to ID and location
168 *  is set to OBJECTS_LOCAL.  if the message queue ID is global and
169 *  resides on a remote node, then location is set to OBJECTS_REMOTE,
170 *  and the_message queue is undefined.  Otherwise, location is set
171 *  to OBJECTS_ERROR and the_mq is undefined.
172 */
173
174RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
175  Objects_Id         id,
176  Objects_Locations *location
177);
178
179/*
180 *  _POSIX_Message_queue_Is_null
181 *
182 *  DESCRIPTION:
183 *
184 *  This function returns TRUE if the_message_queue is NULL and FALSE otherwise.
185 */
186
187RTEMS_INLINE_ROUTINE bool    _POSIX_Message_queue_Is_null (
188  POSIX_Message_queue_Control *the_mq
189);
190
191/*
192 *  _POSIX_Message_queue_Priority_to_core
193 *
194 *  DESCRIPTION:
195 *
196 *  XXX
197 */
198
199RTEMS_INLINE_ROUTINE CORE_message_queue_Submit_types _POSIX_Message_queue_Priority_to_core(
200  unsigned int priority
201);
202
203/*
204 *  _POSIX_Message_queue_Priority_from_core
205 *
206 *  DESCRIPTION:
207 *
208 *  XXX
209 */
210
211RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core(
212  CORE_message_queue_Submit_types priority
213);
214
215/*
216 *  _POSIX_Message_queue_Translate_core_message_queue_return_code
217 *
218 *  DESCRIPTION:
219 *
220 *  XXX
221 */
222
223int _POSIX_Message_queue_Translate_core_message_queue_return_code(
224  uint32_t   the_message_queue_status
225);
226
227
228#include <rtems/posix/mqueue.inl>
229
230#ifdef __cplusplus
231}
232#endif
233
234#endif
235/*  end of include file */
Note: See TracBrowser for help on using the repository browser.