source: rtems/cpukit/include/rtems/rtems/msgmp.h

Last change on this file was a660e9dc, checked in by Sebastian Huber <sebastian.huber@…>, on 09/08/22 at 08:37:05

Do not use RTEMS_INLINE_ROUTINE

Directly use "static inline" which is available in C99 and later. This brings
the RTEMS implementation closer to standard C.

Close #3935.

  • Property mode set to 100644
File size: 6.0 KB
Line 
1/* SPDX-License-Identifier: BSD-2-Clause */
2
3/**
4 * @file
5 *
6 * @ingroup RTEMSImplClassicMessageMP
7 *
8 * @brief This header file provides the implementation interfaces of the
9 *   @ref RTEMSImplClassicMessageMP.
10 */
11
12/* COPYRIGHT (c) 1989-2013.
13 * On-Line Applications Research Corporation (OAR).
14 *
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
17 * are met:
18 * 1. Redistributions of source code must retain the above copyright
19 *    notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 *    notice, this list of conditions and the following disclaimer in the
22 *    documentation and/or other materials provided with the distribution.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
37#ifndef _RTEMS_RTEMS_MSGMP_H
38#define _RTEMS_RTEMS_MSGMP_H
39
40#ifndef _RTEMS_RTEMS_MESSAGEIMPL_H
41# error "Never use <rtems/rtems/msgmp.h> directly; include <rtems/rtems/messageimpl.h> instead."
42#endif
43
44#include <rtems/score/mpciimpl.h>
45
46#ifdef __cplusplus
47extern "C" {
48#endif
49
50/**
51 * @defgroup RTEMSImplClassicMessageMP \
52 *   Message Manager Multiprocessing (MP) Support
53 *
54 * @ingroup RTEMSImplClassicMessage
55 *
56 * @brief This group contains the implementation to support the Message Manager
57 *   in multiprocessing (MP) configurations.
58 *
59 * @{
60 */
61
62/**
63 *  The following enumerated type defines the list of
64 *  remote message queue operations.
65 */
66typedef enum {
67  MESSAGE_QUEUE_MP_ANNOUNCE_CREATE             =  0,
68  MESSAGE_QUEUE_MP_ANNOUNCE_DELETE             =  1,
69  MESSAGE_QUEUE_MP_EXTRACT_PROXY               =  2,
70  MESSAGE_QUEUE_MP_RECEIVE_REQUEST             =  3,
71  MESSAGE_QUEUE_MP_RECEIVE_RESPONSE            =  4,
72  MESSAGE_QUEUE_MP_SEND_REQUEST                =  5,
73  MESSAGE_QUEUE_MP_SEND_RESPONSE               =  6,
74  MESSAGE_QUEUE_MP_URGENT_REQUEST              =  7,
75  MESSAGE_QUEUE_MP_URGENT_RESPONSE             =  8,
76  MESSAGE_QUEUE_MP_BROADCAST_REQUEST           =  9,
77  MESSAGE_QUEUE_MP_BROADCAST_RESPONSE          = 10,
78  MESSAGE_QUEUE_MP_FLUSH_REQUEST               = 11,
79  MESSAGE_QUEUE_MP_FLUSH_RESPONSE              = 12,
80  MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST  = 13,
81  MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE = 14
82}   Message_queue_MP_Remote_operations;
83
84/**
85 *  The following data structure defines the packet used to perform
86 *  remote message queue operations.
87 */
88typedef struct {
89  rtems_packet_prefix                Prefix;
90  Message_queue_MP_Remote_operations operation;
91  rtems_name                         name;
92  rtems_option                       option_set;
93  Objects_Id                         proxy_id;
94  uint32_t                           count;
95  uint32_t                           size;
96  uint32_t                           buffer[ RTEMS_ZERO_LENGTH_ARRAY ];
97}   Message_queue_MP_Packet;
98
99#define MESSAGE_QUEUE_MP_PACKET_SIZE \
100  offsetof(Message_queue_MP_Packet, buffer)
101
102static inline bool _Message_queue_MP_Is_remote( Objects_Id id )
103{
104  return _Objects_MP_Is_remote( id, &_Message_queue_Information );
105}
106
107/**
108 *  @brief Message_queue_Core_message_queue_mp_support
109 *
110 *  Input parameters:
111 *    the_thread - the remote thread the message was submitted to
112 *    id         - id of the message queue
113 *
114 *  Output parameters: NONE
115 */
116void  _Message_queue_Core_message_queue_mp_support (
117  Thread_Control *the_thread,
118  rtems_id        id
119);
120
121/**
122 *  @brief _Message_queue_MP_Send_process_packet
123 *
124 *  This routine performs a remote procedure call so that a
125 *  process operation can be performed on another node.
126 */
127void _Message_queue_MP_Send_process_packet (
128  Message_queue_MP_Remote_operations operation,
129  Objects_Id                         message_queue_id,
130  rtems_name                         name,
131  Objects_Id                         proxy_id
132);
133
134/**
135 * @brief Issues a remote rtems_message_queue_broadcast() request.
136 */
137rtems_status_code _Message_queue_MP_Broadcast(
138  rtems_id    id,
139  const void *buffer,
140  size_t      size,
141  uint32_t   *count
142);
143
144/**
145 * @brief Issues a remote rtems_message_queue_flush() request.
146 */
147rtems_status_code _Message_queue_MP_Flush(
148  rtems_id  id,
149  uint32_t *count
150);
151
152/**
153 * @brief Issues a remote rtems_message_queue_get_number_pending() request.
154 */
155rtems_status_code _Message_queue_MP_Get_number_pending(
156  rtems_id  id,
157  uint32_t *count
158);
159
160/**
161 * @brief Issues a remote rtems_message_queue_receive() request.
162 */
163rtems_status_code _Message_queue_MP_Receive(
164  rtems_id        id,
165  void           *buffer,
166  size_t         *size,
167  rtems_option    option_set,
168  rtems_interval  timeout
169);
170
171/**
172 * @brief Issues a remote rtems_message_queue_send() request.
173 */
174rtems_status_code _Message_queue_MP_Send(
175  rtems_id    id,
176  const void *buffer,
177  size_t      size
178);
179
180/**
181 * @brief Issues a remote rtems_message_queue_urgent() request.
182 */
183rtems_status_code _Message_queue_MP_Urgent(
184  rtems_id    id,
185  const void *buffer,
186  size_t      size
187);
188
189/**
190 *  @brief _Message_queue_MP_Send_object_was_deleted
191 *
192 *  This routine is invoked indirectly by the thread queue
193 *  when a proxy has been removed from the thread queue and
194 *  the remote node must be informed of this.
195 */
196void _Message_queue_MP_Send_object_was_deleted (
197  Thread_Control *the_proxy,
198  Objects_Id      mp_id
199);
200
201/**@}*/
202
203#ifdef __cplusplus
204}
205#endif
206
207#endif
208/* end of file */
Note: See TracBrowser for help on using the repository browser.