OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [posix/] [include/] [rtems/] [posix/] [mqueue.h] - Blame information for rev 173

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  rtems/posix/mqueue.h
2
 *
3
 *  This include file contains all the private support information for
4
 *  POSIX Message Queues.
5
 *
6
 *  COPYRIGHT (c) 1989-1999.
7
 *  On-Line Applications Research Corporation (OAR).
8
 *
9
 *  The license and distribution terms for this file may be
10
 *  found in the file LICENSE in this distribution or at
11
 *  http://www.OARcorp.com/rtems/license.html.
12
 *
13
 *  $Id: mqueue.h,v 1.2 2001-09-27 11:59:14 chris Exp $
14
 */
15
 
16
#ifndef __RTEMS_POSIX_MESSAGE_QUEUE_h
17
#define __RTEMS_POSIX_MESSAGE_QUEUE_h
18
 
19
#ifdef __cplusplus
20
extern "C" {
21
#endif
22
 
23
#include <sys/siginfo.h>
24
 
25
#include <rtems/score/coremsg.h>
26
#include <rtems/score/object.h>
27
 
28
/*
29
 *  Data Structure used to manage a POSIX message queue
30
 */
31
 
32
typedef struct {
33
   Objects_Control             Object;
34
   int                         process_shared;
35
   boolean                     named;
36
   boolean                     linked;
37
   int                         oflag;
38
   unsigned32                  open_count;
39
   CORE_message_queue_Control  Message_queue;
40
   struct sigevent             notification;
41
}  POSIX_Message_queue_Control;
42
 
43
/*
44
 *  The following defines the information control block used to manage
45
 *  this class of objects.
46
 */
47
 
48
POSIX_EXTERN Objects_Information  _POSIX_Message_queue_Information;
49
 
50
/*
51
 *  _POSIX_Message_queue_Manager_initialization
52
 *
53
 *  DESCRIPTION:
54
 *
55
 *  This routine performs the initialization necessary for this manager.
56
 */
57
 
58
void _POSIX_Message_queue_Manager_initialization(
59
  unsigned32 maximum_message_queues
60
);
61
 
62
/*
63
 *
64
 *  _POSIX_Message_queue_Create_support
65
 *
66
 *  DESCRIPTION:
67
 *
68
 *  This routine performs the creation of a message queue utilizing the
69
 *  core message queue.
70
 */
71
 
72
int _POSIX_Message_queue_Create_support(
73
  const char                    *name,
74
  int                            pshared,
75
  unsigned int                   oflag,
76
  struct mq_attr                *attr,
77
  POSIX_Message_queue_Control  **message_queue
78
);
79
 
80
/*
81
 *  _POSIX_Message_queue_Delete
82
 *
83
 *  DESCRIPTION:
84
 *
85
 *  This routine supports the mq_unlink and mq_close routines by
86
 *  doing most of the work involved with removing a message queue.
87
 */
88
 
89
void _POSIX_Message_queue_Delete(
90
  POSIX_Message_queue_Control *the_mq
91
);
92
 
93
/*
94
 *  _POSIX_Message_queue_Receive_support
95
 *
96
 *  DESCRIPTION:
97
 *
98
 *  This routine supports the various flavors of receiving a message.
99
 */
100
 
101
ssize_t _POSIX_Message_queue_Receive_support(
102
  mqd_t               mqdes,
103
  char               *msg_ptr,
104
  size_t              msg_len,
105
  unsigned int       *msg_prio,
106
  Watchdog_Interval   timeout
107
);
108
 
109
/*
110
 *  _POSIX_Message_queue_Send_support
111
 *
112
 *  DESCRIPTION:
113
 *
114
 *  This routine posts a message to a specified message queue.
115
 */
116
 
117
int _POSIX_Message_queue_Send_support(
118
  mqd_t               mqdes,
119
  const char         *msg_ptr,
120
  unsigned32          msg_len,
121
  unsigned32          msg_prio,
122
  Watchdog_Interval   timeout
123
);
124
 
125
/*
126
 *  _POSIX_Message_queue_Allocate
127
 *
128
 *  DESCRIPTION:
129
 *
130
 *  This function allocates a message queue control block from
131
 *  the inactive chain of free message queue control blocks.
132
 */
133
 
134
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void );
135
 
136
/*
137
 *  _POSIX_Message_queue_Free
138
 *
139
 *  DESCRIPTION:
140
 *
141
 *  This routine frees a message queue control block to the
142
 *  inactive chain of free message queue control blocks.
143
 */
144
 
145
RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free (
146
  POSIX_Message_queue_Control *the_mq
147
);
148
 
149
/*
150
 *  _POSIX_Message_queue_Get
151
 *
152
 *  DESCRIPTION:
153
 *
154
 *  This function maps message queue IDs to message queue control blocks.
155
 *  If ID corresponds to a local message queue, then it returns
156
 *  the_mq control pointer which maps to ID and location
157
 *  is set to OBJECTS_LOCAL.  if the message queue ID is global and
158
 *  resides on a remote node, then location is set to OBJECTS_REMOTE,
159
 *  and the_message queue is undefined.  Otherwise, location is set
160
 *  to OBJECTS_ERROR and the_mq is undefined.
161
 */
162
 
163
RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get (
164
  Objects_Id         id,
165
  Objects_Locations *location
166
);
167
 
168
/*
169
 *  _POSIX_Message_queue_Is_null
170
 *
171
 *  DESCRIPTION:
172
 *
173
 *  This function returns TRUE if the_message_queue is NULL and FALSE otherwise.
174
 */
175
 
176
RTEMS_INLINE_ROUTINE boolean _POSIX_Message_queue_Is_null (
177
  POSIX_Message_queue_Control *the_mq
178
);
179
 
180
/*
181
 *  _POSIX_Message_queue_Name_to_id
182
 *
183
 *  DESCRIPTION:
184
 *
185
 *  XXX
186
 */
187
 
188
int _POSIX_Message_queue_Name_to_id(
189
  const char          *name,
190
  Objects_Id          *id
191
);
192
 
193
/*
194
 *  _POSIX_Message_queue_Priority_to_core
195
 *
196
 *  DESCRIPTION:
197
 *
198
 *  XXX
199
 */
200
 
201
RTEMS_INLINE_ROUTINE CORE_message_queue_Submit_types _POSIX_Message_queue_Priority_to_core(
202
  unsigned int priority
203
);
204
 
205
/*
206
 *  _POSIX_Message_queue_Priority_from_core
207
 *
208
 *  DESCRIPTION:
209
 *
210
 *  XXX
211
 */
212
 
213
RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core(
214
  CORE_message_queue_Submit_types priority
215
);
216
 
217
/*PAGE
218
 *
219
 *  _POSIX_Message_queue_Translate_core_message_queue_return_code
220
 *
221
 *  DESCRIPTION:
222
 *
223
 *  XXX
224
 */
225
 
226
int _POSIX_Message_queue_Translate_core_message_queue_return_code(
227
  unsigned32 the_message_queue_status
228
);
229
 
230
 
231
#include <rtems/posix/mqueue.inl>
232
#if defined(RTEMS_MULTIPROCESSING)
233
#include <rtems/posix/mqueuemp.h>
234
#endif
235
 
236
#ifdef __cplusplus
237
}
238
#endif
239
 
240
#endif
241
/*  end of include file */
242
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.