1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup RTEMSImplClassicMessageMP |
---|
5 | * |
---|
6 | * @brief Message Manager MP Support |
---|
7 | * |
---|
8 | * This include file contains all the constants and structures associated |
---|
9 | * with the Multiprocessing Support in the Message Manager. |
---|
10 | */ |
---|
11 | |
---|
12 | /* COPYRIGHT (c) 1989-2013. |
---|
13 | * On-Line Applications Research Corporation (OAR). |
---|
14 | * |
---|
15 | * The license and distribution terms for this file may be |
---|
16 | * found in the file LICENSE in this distribution or at |
---|
17 | * http://www.rtems.org/license/LICENSE. |
---|
18 | */ |
---|
19 | |
---|
20 | #ifndef _RTEMS_RTEMS_MSGMP_H |
---|
21 | #define _RTEMS_RTEMS_MSGMP_H |
---|
22 | |
---|
23 | #ifndef _RTEMS_RTEMS_MESSAGEIMPL_H |
---|
24 | # error "Never use <rtems/rtems/msgmp.h> directly; include <rtems/rtems/messageimpl.h> instead." |
---|
25 | #endif |
---|
26 | |
---|
27 | #include <rtems/score/mpciimpl.h> |
---|
28 | |
---|
29 | #ifdef __cplusplus |
---|
30 | extern "C" { |
---|
31 | #endif |
---|
32 | |
---|
33 | /** |
---|
34 | * @defgroup RTEMSImplClassicMessageMP \ |
---|
35 | * Message Manager Multiprocessing (MP) Support |
---|
36 | * |
---|
37 | * @ingroup RTEMSImplClassicMessage |
---|
38 | * |
---|
39 | * @brief This group contains the implementation to support the Message Manager |
---|
40 | * in multiprocessing (MP) configurations. |
---|
41 | * |
---|
42 | * @{ |
---|
43 | */ |
---|
44 | |
---|
45 | /** |
---|
46 | * The following enumerated type defines the list of |
---|
47 | * remote message queue operations. |
---|
48 | */ |
---|
49 | typedef enum { |
---|
50 | MESSAGE_QUEUE_MP_ANNOUNCE_CREATE = 0, |
---|
51 | MESSAGE_QUEUE_MP_ANNOUNCE_DELETE = 1, |
---|
52 | MESSAGE_QUEUE_MP_EXTRACT_PROXY = 2, |
---|
53 | MESSAGE_QUEUE_MP_RECEIVE_REQUEST = 3, |
---|
54 | MESSAGE_QUEUE_MP_RECEIVE_RESPONSE = 4, |
---|
55 | MESSAGE_QUEUE_MP_SEND_REQUEST = 5, |
---|
56 | MESSAGE_QUEUE_MP_SEND_RESPONSE = 6, |
---|
57 | MESSAGE_QUEUE_MP_URGENT_REQUEST = 7, |
---|
58 | MESSAGE_QUEUE_MP_URGENT_RESPONSE = 8, |
---|
59 | MESSAGE_QUEUE_MP_BROADCAST_REQUEST = 9, |
---|
60 | MESSAGE_QUEUE_MP_BROADCAST_RESPONSE = 10, |
---|
61 | MESSAGE_QUEUE_MP_FLUSH_REQUEST = 11, |
---|
62 | MESSAGE_QUEUE_MP_FLUSH_RESPONSE = 12, |
---|
63 | MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST = 13, |
---|
64 | MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE = 14 |
---|
65 | } Message_queue_MP_Remote_operations; |
---|
66 | |
---|
67 | /** |
---|
68 | * The following data structure defines the packet used to perform |
---|
69 | * remote message queue operations. |
---|
70 | */ |
---|
71 | typedef struct { |
---|
72 | rtems_packet_prefix Prefix; |
---|
73 | Message_queue_MP_Remote_operations operation; |
---|
74 | rtems_name name; |
---|
75 | rtems_option option_set; |
---|
76 | Objects_Id proxy_id; |
---|
77 | uint32_t count; |
---|
78 | uint32_t size; |
---|
79 | uint32_t buffer[ RTEMS_ZERO_LENGTH_ARRAY ]; |
---|
80 | } Message_queue_MP_Packet; |
---|
81 | |
---|
82 | #define MESSAGE_QUEUE_MP_PACKET_SIZE \ |
---|
83 | offsetof(Message_queue_MP_Packet, buffer) |
---|
84 | |
---|
85 | RTEMS_INLINE_ROUTINE bool _Message_queue_MP_Is_remote( Objects_Id id ) |
---|
86 | { |
---|
87 | return _Objects_MP_Is_remote( id, &_Message_queue_Information ); |
---|
88 | } |
---|
89 | |
---|
90 | /** |
---|
91 | * @brief Message_queue_Core_message_queue_mp_support |
---|
92 | * |
---|
93 | * Input parameters: |
---|
94 | * the_thread - the remote thread the message was submitted to |
---|
95 | * id - id of the message queue |
---|
96 | * |
---|
97 | * Output parameters: NONE |
---|
98 | */ |
---|
99 | void _Message_queue_Core_message_queue_mp_support ( |
---|
100 | Thread_Control *the_thread, |
---|
101 | rtems_id id |
---|
102 | ); |
---|
103 | |
---|
104 | /** |
---|
105 | * @brief _Message_queue_MP_Send_process_packet |
---|
106 | * |
---|
107 | * This routine performs a remote procedure call so that a |
---|
108 | * process operation can be performed on another node. |
---|
109 | */ |
---|
110 | void _Message_queue_MP_Send_process_packet ( |
---|
111 | Message_queue_MP_Remote_operations operation, |
---|
112 | Objects_Id message_queue_id, |
---|
113 | rtems_name name, |
---|
114 | Objects_Id proxy_id |
---|
115 | ); |
---|
116 | |
---|
117 | /** |
---|
118 | * @brief Issues a remote rtems_message_queue_broadcast() request. |
---|
119 | */ |
---|
120 | rtems_status_code _Message_queue_MP_Broadcast( |
---|
121 | rtems_id id, |
---|
122 | const void *buffer, |
---|
123 | size_t size, |
---|
124 | uint32_t *count |
---|
125 | ); |
---|
126 | |
---|
127 | /** |
---|
128 | * @brief Issues a remote rtems_message_queue_flush() request. |
---|
129 | */ |
---|
130 | rtems_status_code _Message_queue_MP_Flush( |
---|
131 | rtems_id id, |
---|
132 | uint32_t *count |
---|
133 | ); |
---|
134 | |
---|
135 | /** |
---|
136 | * @brief Issues a remote rtems_message_queue_get_number_pending() request. |
---|
137 | */ |
---|
138 | rtems_status_code _Message_queue_MP_Get_number_pending( |
---|
139 | rtems_id id, |
---|
140 | uint32_t *count |
---|
141 | ); |
---|
142 | |
---|
143 | /** |
---|
144 | * @brief Issues a remote rtems_message_queue_receive() request. |
---|
145 | */ |
---|
146 | rtems_status_code _Message_queue_MP_Receive( |
---|
147 | rtems_id id, |
---|
148 | void *buffer, |
---|
149 | size_t *size, |
---|
150 | rtems_option option_set, |
---|
151 | rtems_interval timeout |
---|
152 | ); |
---|
153 | |
---|
154 | /** |
---|
155 | * @brief Issues a remote rtems_message_queue_send() request. |
---|
156 | */ |
---|
157 | rtems_status_code _Message_queue_MP_Send( |
---|
158 | rtems_id id, |
---|
159 | const void *buffer, |
---|
160 | size_t size |
---|
161 | ); |
---|
162 | |
---|
163 | /** |
---|
164 | * @brief Issues a remote rtems_message_queue_urgent() request. |
---|
165 | */ |
---|
166 | rtems_status_code _Message_queue_MP_Urgent( |
---|
167 | rtems_id id, |
---|
168 | const void *buffer, |
---|
169 | size_t size |
---|
170 | ); |
---|
171 | |
---|
172 | /** |
---|
173 | * @brief _Message_queue_MP_Send_object_was_deleted |
---|
174 | * |
---|
175 | * This routine is invoked indirectly by the thread queue |
---|
176 | * when a proxy has been removed from the thread queue and |
---|
177 | * the remote node must be informed of this. |
---|
178 | */ |
---|
179 | void _Message_queue_MP_Send_object_was_deleted ( |
---|
180 | Thread_Control *the_proxy, |
---|
181 | Objects_Id mp_id |
---|
182 | ); |
---|
183 | |
---|
184 | /**@}*/ |
---|
185 | |
---|
186 | #ifdef __cplusplus |
---|
187 | } |
---|
188 | #endif |
---|
189 | |
---|
190 | #endif |
---|
191 | /* end of file */ |
---|