[ac7d5ef0] | 1 | /* |
---|
| 2 | * Multiprocessing Support for the Message Queue Manager |
---|
| 3 | * |
---|
| 4 | * |
---|
[03f2154e] | 5 | * COPYRIGHT (c) 1989-1997. |
---|
[ac7d5ef0] | 6 | * On-Line Applications Research Corporation (OAR). |
---|
[03f2154e] | 7 | * Copyright assigned to U.S. Government, 1994. |
---|
[ac7d5ef0] | 8 | * |
---|
[03f2154e] | 9 | * The license and distribution terms for this file may in |
---|
| 10 | * the file LICENSE in this distribution or at |
---|
| 11 | * http://www.OARcorp.com/rtems/license.html. |
---|
[ac7d5ef0] | 12 | * |
---|
| 13 | * $Id$ |
---|
| 14 | */ |
---|
| 15 | |
---|
| 16 | #include <rtems/system.h> |
---|
[3a4ae6c] | 17 | #include <rtems/rtems/status.h> |
---|
| 18 | #include <rtems/rtems/message.h> |
---|
[5e9b32b] | 19 | #include <rtems/score/mpci.h> |
---|
[3a4ae6c] | 20 | #include <rtems/rtems/msgmp.h> |
---|
[5e9b32b] | 21 | #include <rtems/score/object.h> |
---|
[3a4ae6c] | 22 | #include <rtems/rtems/options.h> |
---|
[5e9b32b] | 23 | #include <rtems/score/thread.h> |
---|
| 24 | #include <rtems/score/watchdog.h> |
---|
[3a4ae6c] | 25 | #include <rtems/rtems/support.h> |
---|
[ac7d5ef0] | 26 | |
---|
| 27 | /*PAGE |
---|
| 28 | * |
---|
| 29 | * _Message_queue_MP_Send_process_packet |
---|
| 30 | * |
---|
| 31 | */ |
---|
| 32 | |
---|
| 33 | void _Message_queue_MP_Send_process_packet ( |
---|
| 34 | Message_queue_MP_Remote_operations operation, |
---|
| 35 | Objects_Id message_queue_id, |
---|
[3235ad9] | 36 | rtems_name name, |
---|
[ac7d5ef0] | 37 | Objects_Id proxy_id |
---|
| 38 | ) |
---|
| 39 | { |
---|
| 40 | Message_queue_MP_Packet *the_packet; |
---|
| 41 | unsigned32 node; |
---|
| 42 | |
---|
| 43 | switch ( operation ) { |
---|
| 44 | |
---|
| 45 | case MESSAGE_QUEUE_MP_ANNOUNCE_CREATE: |
---|
| 46 | case MESSAGE_QUEUE_MP_ANNOUNCE_DELETE: |
---|
| 47 | case MESSAGE_QUEUE_MP_EXTRACT_PROXY: |
---|
| 48 | |
---|
| 49 | the_packet = _Message_queue_MP_Get_packet(); |
---|
[3a4ae6c] | 50 | the_packet->Prefix.the_class = MP_PACKET_MESSAGE_QUEUE; |
---|
[ac7d5ef0] | 51 | the_packet->Prefix.length = sizeof ( Message_queue_MP_Packet ); |
---|
| 52 | the_packet->Prefix.to_convert = sizeof ( Message_queue_MP_Packet ); |
---|
| 53 | the_packet->operation = operation; |
---|
| 54 | the_packet->Prefix.id = message_queue_id; |
---|
| 55 | the_packet->name = name; |
---|
| 56 | the_packet->proxy_id = proxy_id; |
---|
| 57 | |
---|
| 58 | if ( operation == MESSAGE_QUEUE_MP_EXTRACT_PROXY ) |
---|
| 59 | node = rtems_get_node( message_queue_id ); |
---|
| 60 | else |
---|
| 61 | node = MPCI_ALL_NODES; |
---|
| 62 | |
---|
| 63 | _MPCI_Send_process_packet( node, &the_packet->Prefix ); |
---|
| 64 | break; |
---|
| 65 | |
---|
| 66 | case MESSAGE_QUEUE_MP_RECEIVE_REQUEST: |
---|
| 67 | case MESSAGE_QUEUE_MP_RECEIVE_RESPONSE: |
---|
| 68 | case MESSAGE_QUEUE_MP_SEND_REQUEST: |
---|
| 69 | case MESSAGE_QUEUE_MP_SEND_RESPONSE: |
---|
| 70 | case MESSAGE_QUEUE_MP_URGENT_REQUEST: |
---|
| 71 | case MESSAGE_QUEUE_MP_URGENT_RESPONSE: |
---|
| 72 | case MESSAGE_QUEUE_MP_BROADCAST_REQUEST: |
---|
| 73 | case MESSAGE_QUEUE_MP_BROADCAST_RESPONSE: |
---|
| 74 | case MESSAGE_QUEUE_MP_FLUSH_REQUEST: |
---|
| 75 | case MESSAGE_QUEUE_MP_FLUSH_RESPONSE: |
---|
[e7d8b58] | 76 | case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST: |
---|
| 77 | case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE: |
---|
[ac7d5ef0] | 78 | break; |
---|
| 79 | |
---|
| 80 | } |
---|
| 81 | } |
---|
| 82 | |
---|
| 83 | /*PAGE |
---|
| 84 | * |
---|
| 85 | * _Message_queue_MP_Send_request_packet |
---|
| 86 | * |
---|
| 87 | */ |
---|
| 88 | |
---|
| 89 | rtems_status_code _Message_queue_MP_Send_request_packet ( |
---|
| 90 | Message_queue_MP_Remote_operations operation, |
---|
| 91 | Objects_Id message_queue_id, |
---|
[3b438fa] | 92 | void *buffer, |
---|
| 93 | unsigned32 *size_p, |
---|
| 94 | rtems_option option_set, |
---|
| 95 | rtems_interval timeout |
---|
[ac7d5ef0] | 96 | ) |
---|
| 97 | { |
---|
| 98 | Message_queue_MP_Packet *the_packet; |
---|
| 99 | |
---|
| 100 | switch ( operation ) { |
---|
| 101 | |
---|
| 102 | case MESSAGE_QUEUE_MP_SEND_REQUEST: |
---|
| 103 | case MESSAGE_QUEUE_MP_URGENT_REQUEST: |
---|
| 104 | case MESSAGE_QUEUE_MP_BROADCAST_REQUEST: |
---|
| 105 | case MESSAGE_QUEUE_MP_FLUSH_REQUEST: |
---|
[e7d8b58] | 106 | case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST: |
---|
[ac7d5ef0] | 107 | |
---|
| 108 | the_packet = _Message_queue_MP_Get_packet(); |
---|
[3a4ae6c] | 109 | the_packet->Prefix.the_class = MP_PACKET_MESSAGE_QUEUE; |
---|
[3b438fa] | 110 | the_packet->Prefix.length = sizeof(Message_queue_MP_Packet); |
---|
| 111 | if ( size_p ) |
---|
[3a4ae6c] | 112 | the_packet->Prefix.length += *size_p; |
---|
[3b438fa] | 113 | the_packet->Prefix.to_convert = sizeof(Message_queue_MP_Packet); |
---|
| 114 | |
---|
| 115 | /* |
---|
| 116 | * make sure message is not too big for our MPCI driver |
---|
| 117 | * We have to check it here instead of waiting for MPCI because |
---|
| 118 | * we are about to slam in the payload |
---|
| 119 | */ |
---|
| 120 | |
---|
[3a4ae6c] | 121 | if (the_packet->Prefix.length > _MPCI_table->maximum_packet_size) { |
---|
[3b438fa] | 122 | _Thread_Enable_dispatch(); |
---|
| 123 | return RTEMS_INVALID_SIZE; |
---|
| 124 | } |
---|
| 125 | |
---|
[e7d8b58] | 126 | if (! _Options_Is_no_wait(option_set)) |
---|
[ac7d5ef0] | 127 | the_packet->Prefix.timeout = timeout; |
---|
| 128 | |
---|
[3b438fa] | 129 | the_packet->operation = operation; |
---|
| 130 | the_packet->Prefix.id = message_queue_id; |
---|
| 131 | the_packet->option_set = option_set; |
---|
| 132 | |
---|
| 133 | /* |
---|
| 134 | * Copy the data into place if needed |
---|
| 135 | */ |
---|
| 136 | |
---|
[3a4ae6c] | 137 | if (buffer) { |
---|
[3b438fa] | 138 | the_packet->Buffer.size = *size_p; |
---|
[3652ad35] | 139 | _CORE_message_queue_Copy_buffer( |
---|
| 140 | buffer, |
---|
| 141 | the_packet->Buffer.buffer, |
---|
| 142 | *size_p |
---|
| 143 | ); |
---|
[3b438fa] | 144 | } |
---|
| 145 | |
---|
[ffe316d] | 146 | return (rtems_status_code) _MPCI_Send_request_packet( |
---|
| 147 | rtems_get_node(message_queue_id), |
---|
| 148 | &the_packet->Prefix, |
---|
| 149 | STATES_WAITING_FOR_MESSAGE |
---|
| 150 | ); |
---|
[3b438fa] | 151 | break; |
---|
[ac7d5ef0] | 152 | |
---|
[3b438fa] | 153 | case MESSAGE_QUEUE_MP_RECEIVE_REQUEST: |
---|
[ac7d5ef0] | 154 | |
---|
[3b438fa] | 155 | the_packet = _Message_queue_MP_Get_packet(); |
---|
[3a4ae6c] | 156 | the_packet->Prefix.the_class = MP_PACKET_MESSAGE_QUEUE; |
---|
[3b438fa] | 157 | the_packet->Prefix.length = sizeof(Message_queue_MP_Packet); |
---|
| 158 | the_packet->Prefix.to_convert = sizeof(Message_queue_MP_Packet); |
---|
| 159 | |
---|
[e7d8b58] | 160 | if (! _Options_Is_no_wait(option_set)) |
---|
[3b438fa] | 161 | the_packet->Prefix.timeout = timeout; |
---|
| 162 | |
---|
| 163 | the_packet->operation = MESSAGE_QUEUE_MP_RECEIVE_REQUEST; |
---|
| 164 | the_packet->Prefix.id = message_queue_id; |
---|
| 165 | the_packet->option_set = option_set; |
---|
| 166 | the_packet->size = 0; /* just in case of an error */ |
---|
| 167 | |
---|
[3a4ae6c] | 168 | _Thread_Executing->Wait.return_argument = (unsigned32 *)buffer; |
---|
| 169 | _Thread_Executing->Wait.return_argument_1 = size_p; |
---|
[3b438fa] | 170 | |
---|
[ffe316d] | 171 | return (rtems_status_code) _MPCI_Send_request_packet( |
---|
| 172 | rtems_get_node(message_queue_id), |
---|
| 173 | &the_packet->Prefix, |
---|
| 174 | STATES_WAITING_FOR_MESSAGE |
---|
| 175 | ); |
---|
[ac7d5ef0] | 176 | break; |
---|
| 177 | |
---|
| 178 | case MESSAGE_QUEUE_MP_ANNOUNCE_CREATE: |
---|
| 179 | case MESSAGE_QUEUE_MP_ANNOUNCE_DELETE: |
---|
| 180 | case MESSAGE_QUEUE_MP_EXTRACT_PROXY: |
---|
| 181 | case MESSAGE_QUEUE_MP_RECEIVE_RESPONSE: |
---|
| 182 | case MESSAGE_QUEUE_MP_SEND_RESPONSE: |
---|
| 183 | case MESSAGE_QUEUE_MP_URGENT_RESPONSE: |
---|
| 184 | case MESSAGE_QUEUE_MP_BROADCAST_RESPONSE: |
---|
| 185 | case MESSAGE_QUEUE_MP_FLUSH_RESPONSE: |
---|
[e7d8b58] | 186 | case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE: |
---|
[ac7d5ef0] | 187 | break; |
---|
| 188 | } |
---|
[3b438fa] | 189 | |
---|
[ac7d5ef0] | 190 | return RTEMS_SUCCESSFUL; |
---|
| 191 | } |
---|
| 192 | |
---|
| 193 | /*PAGE |
---|
| 194 | * |
---|
| 195 | * _Message_queue_MP_Send_response_packet |
---|
| 196 | * |
---|
| 197 | */ |
---|
| 198 | |
---|
| 199 | void _Message_queue_MP_Send_response_packet ( |
---|
| 200 | Message_queue_MP_Remote_operations operation, |
---|
| 201 | Objects_Id message_queue_id, |
---|
| 202 | Thread_Control *the_thread |
---|
| 203 | ) |
---|
| 204 | { |
---|
| 205 | Message_queue_MP_Packet *the_packet; |
---|
| 206 | |
---|
| 207 | switch ( operation ) { |
---|
| 208 | |
---|
| 209 | case MESSAGE_QUEUE_MP_RECEIVE_RESPONSE: |
---|
| 210 | case MESSAGE_QUEUE_MP_SEND_RESPONSE: |
---|
| 211 | case MESSAGE_QUEUE_MP_URGENT_RESPONSE: |
---|
| 212 | case MESSAGE_QUEUE_MP_BROADCAST_RESPONSE: |
---|
| 213 | case MESSAGE_QUEUE_MP_FLUSH_RESPONSE: |
---|
[e7d8b58] | 214 | case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE: |
---|
[ac7d5ef0] | 215 | |
---|
| 216 | the_packet = ( Message_queue_MP_Packet *) the_thread->receive_packet; |
---|
| 217 | |
---|
| 218 | /* |
---|
| 219 | * The packet being returned already contains the class, length, and |
---|
| 220 | * to_convert fields, therefore they are not set in this routine. |
---|
[3b438fa] | 221 | * |
---|
| 222 | * Exception: MESSAGE_QUEUE_MP_RECEIVE_RESPONSE needs payload length |
---|
| 223 | * added to 'length' |
---|
[ac7d5ef0] | 224 | */ |
---|
| 225 | the_packet->operation = operation; |
---|
| 226 | the_packet->Prefix.id = the_packet->Prefix.source_tid; |
---|
| 227 | |
---|
[3b438fa] | 228 | if (operation == MESSAGE_QUEUE_MP_RECEIVE_RESPONSE) |
---|
| 229 | the_packet->Prefix.length += the_packet->size; |
---|
| 230 | |
---|
[ac7d5ef0] | 231 | _MPCI_Send_response_packet( |
---|
| 232 | rtems_get_node( the_packet->Prefix.source_tid ), |
---|
| 233 | &the_packet->Prefix |
---|
| 234 | ); |
---|
| 235 | break; |
---|
| 236 | |
---|
| 237 | case MESSAGE_QUEUE_MP_ANNOUNCE_CREATE: |
---|
| 238 | case MESSAGE_QUEUE_MP_ANNOUNCE_DELETE: |
---|
| 239 | case MESSAGE_QUEUE_MP_EXTRACT_PROXY: |
---|
| 240 | case MESSAGE_QUEUE_MP_RECEIVE_REQUEST: |
---|
| 241 | case MESSAGE_QUEUE_MP_SEND_REQUEST: |
---|
| 242 | case MESSAGE_QUEUE_MP_URGENT_REQUEST: |
---|
| 243 | case MESSAGE_QUEUE_MP_BROADCAST_REQUEST: |
---|
| 244 | case MESSAGE_QUEUE_MP_FLUSH_REQUEST: |
---|
[e7d8b58] | 245 | case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST: |
---|
[ac7d5ef0] | 246 | break; |
---|
| 247 | |
---|
| 248 | } |
---|
| 249 | } |
---|
| 250 | |
---|
| 251 | /*PAGE |
---|
| 252 | * |
---|
| 253 | * |
---|
| 254 | * _Message_queue_MP_Process_packet |
---|
| 255 | * |
---|
| 256 | */ |
---|
| 257 | |
---|
| 258 | void _Message_queue_MP_Process_packet ( |
---|
| 259 | rtems_packet_prefix *the_packet_prefix |
---|
| 260 | ) |
---|
| 261 | { |
---|
| 262 | Message_queue_MP_Packet *the_packet; |
---|
| 263 | Thread_Control *the_thread; |
---|
| 264 | boolean ignored; |
---|
| 265 | |
---|
| 266 | the_packet = (Message_queue_MP_Packet *) the_packet_prefix; |
---|
| 267 | |
---|
| 268 | switch ( the_packet->operation ) { |
---|
| 269 | |
---|
| 270 | case MESSAGE_QUEUE_MP_ANNOUNCE_CREATE: |
---|
| 271 | |
---|
[7f6a24ab] | 272 | ignored = _Objects_MP_Allocate_and_open( |
---|
[ac7d5ef0] | 273 | &_Message_queue_Information, |
---|
| 274 | the_packet->name, |
---|
| 275 | the_packet->Prefix.id, |
---|
| 276 | TRUE |
---|
| 277 | ); |
---|
| 278 | |
---|
| 279 | _MPCI_Return_packet( the_packet_prefix ); |
---|
| 280 | break; |
---|
| 281 | |
---|
| 282 | case MESSAGE_QUEUE_MP_ANNOUNCE_DELETE: |
---|
| 283 | |
---|
| 284 | _Objects_MP_Close( &_Message_queue_Information, the_packet->Prefix.id ); |
---|
| 285 | |
---|
| 286 | _MPCI_Return_packet( the_packet_prefix ); |
---|
| 287 | break; |
---|
| 288 | |
---|
| 289 | case MESSAGE_QUEUE_MP_EXTRACT_PROXY: |
---|
| 290 | |
---|
| 291 | the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id ); |
---|
| 292 | |
---|
[e7d8b58] | 293 | if (! _Thread_Is_null( the_thread ) ) |
---|
[ac7d5ef0] | 294 | _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); |
---|
| 295 | |
---|
| 296 | _MPCI_Return_packet( the_packet_prefix ); |
---|
| 297 | break; |
---|
| 298 | |
---|
| 299 | case MESSAGE_QUEUE_MP_RECEIVE_REQUEST: |
---|
| 300 | |
---|
| 301 | the_packet->Prefix.return_code = rtems_message_queue_receive( |
---|
| 302 | the_packet->Prefix.id, |
---|
[3b438fa] | 303 | the_packet->Buffer.buffer, |
---|
| 304 | &the_packet->size, |
---|
[ac7d5ef0] | 305 | the_packet->option_set, |
---|
| 306 | the_packet->Prefix.timeout |
---|
| 307 | ); |
---|
| 308 | |
---|
[e7d8b58] | 309 | if (! _Thread_Is_proxy_blocking( the_packet->Prefix.return_code ) ) |
---|
[ac7d5ef0] | 310 | _Message_queue_MP_Send_response_packet( |
---|
| 311 | MESSAGE_QUEUE_MP_RECEIVE_RESPONSE, |
---|
| 312 | the_packet->Prefix.id, |
---|
| 313 | _Thread_Executing |
---|
| 314 | ); |
---|
| 315 | break; |
---|
| 316 | |
---|
| 317 | case MESSAGE_QUEUE_MP_RECEIVE_RESPONSE: |
---|
| 318 | |
---|
| 319 | the_thread = _MPCI_Process_response( the_packet_prefix ); |
---|
| 320 | |
---|
[3b438fa] | 321 | if (the_packet->Prefix.return_code == RTEMS_SUCCESSFUL) { |
---|
[3a4ae6c] | 322 | *(rtems_unsigned32 *)the_thread->Wait.return_argument_1 = |
---|
| 323 | the_packet->size; |
---|
[3b438fa] | 324 | |
---|
[3652ad35] | 325 | _CORE_message_queue_Copy_buffer( |
---|
[3b438fa] | 326 | the_packet->Buffer.buffer, |
---|
| 327 | the_thread->Wait.return_argument, |
---|
| 328 | the_packet->size |
---|
| 329 | ); |
---|
| 330 | } |
---|
[ac7d5ef0] | 331 | |
---|
| 332 | _MPCI_Return_packet( the_packet_prefix ); |
---|
| 333 | break; |
---|
| 334 | |
---|
| 335 | case MESSAGE_QUEUE_MP_SEND_REQUEST: |
---|
| 336 | |
---|
| 337 | the_packet->Prefix.return_code = rtems_message_queue_send( |
---|
| 338 | the_packet->Prefix.id, |
---|
[3b438fa] | 339 | the_packet->Buffer.buffer, |
---|
| 340 | the_packet->Buffer.size |
---|
[ac7d5ef0] | 341 | ); |
---|
| 342 | |
---|
| 343 | _Message_queue_MP_Send_response_packet( |
---|
| 344 | MESSAGE_QUEUE_MP_SEND_RESPONSE, |
---|
| 345 | the_packet->Prefix.id, |
---|
| 346 | _Thread_Executing |
---|
| 347 | ); |
---|
| 348 | break; |
---|
| 349 | |
---|
| 350 | case MESSAGE_QUEUE_MP_SEND_RESPONSE: |
---|
| 351 | case MESSAGE_QUEUE_MP_URGENT_RESPONSE: |
---|
| 352 | |
---|
| 353 | the_thread = _MPCI_Process_response( the_packet_prefix ); |
---|
| 354 | |
---|
| 355 | _MPCI_Return_packet( the_packet_prefix ); |
---|
| 356 | break; |
---|
| 357 | |
---|
| 358 | case MESSAGE_QUEUE_MP_URGENT_REQUEST: |
---|
| 359 | |
---|
| 360 | the_packet->Prefix.return_code = rtems_message_queue_urgent( |
---|
| 361 | the_packet->Prefix.id, |
---|
[3b438fa] | 362 | the_packet->Buffer.buffer, |
---|
| 363 | the_packet->Buffer.size |
---|
[ac7d5ef0] | 364 | ); |
---|
| 365 | |
---|
| 366 | _Message_queue_MP_Send_response_packet( |
---|
| 367 | MESSAGE_QUEUE_MP_URGENT_RESPONSE, |
---|
| 368 | the_packet->Prefix.id, |
---|
| 369 | _Thread_Executing |
---|
| 370 | ); |
---|
| 371 | break; |
---|
| 372 | |
---|
| 373 | case MESSAGE_QUEUE_MP_BROADCAST_REQUEST: |
---|
| 374 | |
---|
| 375 | the_packet->Prefix.return_code = rtems_message_queue_broadcast( |
---|
| 376 | the_packet->Prefix.id, |
---|
[3b438fa] | 377 | the_packet->Buffer.buffer, |
---|
| 378 | the_packet->Buffer.size, |
---|
[ac7d5ef0] | 379 | &the_packet->count |
---|
| 380 | ); |
---|
| 381 | |
---|
| 382 | _Message_queue_MP_Send_response_packet( |
---|
| 383 | MESSAGE_QUEUE_MP_BROADCAST_RESPONSE, |
---|
| 384 | the_packet->Prefix.id, |
---|
| 385 | _Thread_Executing |
---|
| 386 | ); |
---|
| 387 | break; |
---|
| 388 | |
---|
| 389 | case MESSAGE_QUEUE_MP_BROADCAST_RESPONSE: |
---|
| 390 | case MESSAGE_QUEUE_MP_FLUSH_RESPONSE: |
---|
[e7d8b58] | 391 | case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE: |
---|
[ac7d5ef0] | 392 | |
---|
| 393 | the_thread = _MPCI_Process_response( the_packet_prefix ); |
---|
| 394 | |
---|
| 395 | *(unsigned32 *)the_thread->Wait.return_argument = the_packet->count; |
---|
| 396 | |
---|
| 397 | _MPCI_Return_packet( the_packet_prefix ); |
---|
| 398 | break; |
---|
| 399 | |
---|
| 400 | case MESSAGE_QUEUE_MP_FLUSH_REQUEST: |
---|
| 401 | |
---|
| 402 | the_packet->Prefix.return_code = rtems_message_queue_flush( |
---|
| 403 | the_packet->Prefix.id, |
---|
| 404 | &the_packet->count |
---|
| 405 | ); |
---|
| 406 | |
---|
| 407 | _Message_queue_MP_Send_response_packet( |
---|
| 408 | MESSAGE_QUEUE_MP_FLUSH_RESPONSE, |
---|
| 409 | the_packet->Prefix.id, |
---|
| 410 | _Thread_Executing |
---|
| 411 | ); |
---|
| 412 | break; |
---|
| 413 | |
---|
[e7d8b58] | 414 | case MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST: |
---|
| 415 | |
---|
| 416 | the_packet->Prefix.return_code = rtems_message_queue_get_number_pending( |
---|
| 417 | the_packet->Prefix.id, |
---|
| 418 | &the_packet->count |
---|
| 419 | ); |
---|
| 420 | |
---|
| 421 | _Message_queue_MP_Send_response_packet( |
---|
| 422 | MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_RESPONSE, |
---|
| 423 | the_packet->Prefix.id, |
---|
| 424 | _Thread_Executing |
---|
| 425 | ); |
---|
| 426 | break; |
---|
| 427 | |
---|
[ac7d5ef0] | 428 | } |
---|
| 429 | } |
---|
| 430 | |
---|
| 431 | /*PAGE |
---|
| 432 | * |
---|
| 433 | * _Message_queue_MP_Send_object_was_deleted |
---|
| 434 | * |
---|
| 435 | */ |
---|
| 436 | |
---|
| 437 | void _Message_queue_MP_Send_object_was_deleted ( |
---|
| 438 | Thread_Control *the_proxy |
---|
| 439 | ) |
---|
| 440 | { |
---|
| 441 | the_proxy->receive_packet->return_code = RTEMS_OBJECT_WAS_DELETED; |
---|
| 442 | |
---|
| 443 | _Message_queue_MP_Send_response_packet( |
---|
| 444 | MESSAGE_QUEUE_MP_RECEIVE_RESPONSE, |
---|
| 445 | the_proxy->Wait.id, |
---|
| 446 | the_proxy |
---|
| 447 | ); |
---|
| 448 | } |
---|
| 449 | |
---|
| 450 | /*PAGE |
---|
| 451 | * |
---|
| 452 | * _Message_queue_MP_Send_extract_proxy |
---|
| 453 | * |
---|
| 454 | */ |
---|
| 455 | |
---|
| 456 | void _Message_queue_MP_Send_extract_proxy ( |
---|
| 457 | Thread_Control *the_thread |
---|
| 458 | ) |
---|
| 459 | { |
---|
| 460 | _Message_queue_MP_Send_process_packet( |
---|
| 461 | MESSAGE_QUEUE_MP_EXTRACT_PROXY, |
---|
| 462 | the_thread->Wait.id, |
---|
[3235ad9] | 463 | (rtems_name) 0, |
---|
[ac7d5ef0] | 464 | the_thread->Object.id |
---|
| 465 | ); |
---|
| 466 | } |
---|
| 467 | |
---|
| 468 | /*PAGE |
---|
| 469 | * |
---|
| 470 | * _Message_queue_MP_Get_packet |
---|
| 471 | * |
---|
| 472 | */ |
---|
| 473 | |
---|
| 474 | Message_queue_MP_Packet *_Message_queue_MP_Get_packet ( void ) |
---|
| 475 | { |
---|
| 476 | return ( (Message_queue_MP_Packet *) _MPCI_Get_packet() ); |
---|
| 477 | } |
---|
| 478 | |
---|
| 479 | /* end of file */ |
---|