source: rtems/c/src/exec/rtems/src/msg.c @ f4a8ee1

4.104.114.84.95
Last change on this file since f4a8ee1 was f4a8ee1, checked in by Joel Sherrill <joel.sherrill@…>, on 03/17/99 at 16:01:03

Unlimited objects patch from Chris Johns <ccj@…>. Email follows:

First, the unlimited patch. I have compiled the unlmited patch for the
Linux posix BSP only and it seems to work cleanly. I would like a really
major application run on this change before commiting as the changes are
very core and significant. I am currently building all the tests to run.

I have no targets suitable to test on at the moment.

I have tested the patch for inline functions and macros.

Turning macros on has found some core bugs. I have fixed these but have
not run all the tests. Please review the patch for these changes. They
are:

1) The conditional compilation for MP support broke the core messages
code. You cannot embed a conditional macro in another macro. The Send
and Urgent Send calls are macros.

2) User extensions handler initialisation now has two parameters. I have
updated the macros to support the extra parameter.

The patch also contains the gcc-target-default.cfg fix required to build
the kernel. More of a by product than a fix for you.

  • Property mode set to 100644
File size: 21.3 KB
Line 
1/*
2 *  Message Queue Manager
3 *
4 *
5 *  COPYRIGHT (c) 1989-1998.
6 *  On-Line Applications Research Corporation (OAR).
7 *  Copyright assigned to U.S. Government, 1994.
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$
14 */
15
16#include <rtems/system.h>
17#include <rtems/score/sysstate.h>
18#include <rtems/score/chain.h>
19#include <rtems/score/isr.h>
20#include <rtems/score/coremsg.h>
21#include <rtems/score/object.h>
22#include <rtems/score/states.h>
23#include <rtems/score/thread.h>
24#include <rtems/score/wkspace.h>
25#if defined(RTEMS_MULTIPROCESSING)
26#include <rtems/score/mpci.h>
27#endif
28#include <rtems/rtems/status.h>
29#include <rtems/rtems/attr.h>
30#include <rtems/rtems/message.h>
31#include <rtems/rtems/options.h>
32#include <rtems/rtems/support.h>
33
34/*PAGE
35 *
36 *  _MESSAGE_QUEUE_CORE_MESSAGE_QUEUE_MP_SUPPORT
37 *
38 *  Condition support for the MP. Helps the macro build.
39 *
40 */
41
42#if defined(RTEMS_MULTIPROCESSING)
43#define _MESSAGE_QUEUE_CORE_MESSAGE_QUEUE_MP_SUPPORT _Message_queue_Core_message_queue_mp_support
44#else
45#define _MESSAGE_QUEUE_CORE_MESSAGE_QUEUE_MP_SUPPORT NULL
46#endif
47
48/*PAGE
49 *
50 *  _Message_queue_Manager_initialization
51 *
52 *  This routine initializes all message queue manager related
53 *  data structures.
54 *
55 *  Input parameters:
56 *    maximum_message_queues - number of message queues to initialize
57 *
58 *  Output parameters:  NONE
59 */
60
61void _Message_queue_Manager_initialization(
62  unsigned32 maximum_message_queues
63)
64{
65  _Objects_Initialize_information(
66    &_Message_queue_Information,
67    OBJECTS_RTEMS_MESSAGE_QUEUES,
68    TRUE,
69    maximum_message_queues,
70    sizeof( Message_queue_Control ),
71    FALSE,
72    RTEMS_MAXIMUM_NAME_LENGTH,
73    FALSE
74  );
75
76  /*
77   *  Register the MP Process Packet routine.
78   */
79
80#if defined(RTEMS_MULTIPROCESSING)
81  _MPCI_Register_packet_processor(
82    MP_PACKET_MESSAGE_QUEUE,
83    _Message_queue_MP_Process_packet
84  );
85#endif
86
87}
88
89/*PAGE
90 *
91 *  _Message_queue_Allocate
92 *
93 *  Allocate a message queue and the space for its messages
94 *
95 *  Input parameters:
96 *    the_message_queue - the message queue to allocate message buffers
97 *    count             - maximum message and reserved buffer count
98 *    max_message_size  - maximum size of each message
99 *
100 *  Output parameters:
101 *    the_message_queue - set if successful, NULL otherwise
102 */
103
104Message_queue_Control *_Message_queue_Allocate (
105  unsigned32           count,
106  unsigned32           max_message_size
107)
108{
109  return
110    (Message_queue_Control *)_Objects_Allocate(&_Message_queue_Information);
111
112}
113
114/*PAGE
115 *
116 *  rtems_message_queue_create
117 *
118 *  This directive creates a message queue by allocating and initializing
119 *  a message queue data structure.
120 *
121 *  Input parameters:
122 *    name             - user defined queue name
123 *    count            - maximum message and reserved buffer count
124 *    max_message_size - maximum size of each message
125 *    attribute_set    - process method
126 *    id               - pointer to queue
127 *
128 *  Output parameters:
129 *    id                - queue id
130 *    RTEMS_SUCCESSFUL  - if successful
131 *    error code        - if unsuccessful
132 */
133
134rtems_status_code rtems_message_queue_create(
135  rtems_name          name,
136  unsigned32          count,
137  unsigned32          max_message_size,
138  rtems_attribute     attribute_set,
139  Objects_Id         *id
140)
141{
142  register Message_queue_Control *the_message_queue;
143  CORE_message_queue_Attributes   the_message_queue_attributes;
144  void                           *handler;
145#if defined(RTEMS_MULTIPROCESSING)
146  boolean                         is_global;
147#endif
148
149  if ( !rtems_is_name_valid( name ) )
150    return RTEMS_INVALID_NAME;
151
152#if defined(RTEMS_MULTIPROCESSING)
153  if ( (is_global = _Attributes_Is_global( attribute_set ) ) &&
154       !_System_state_Is_multiprocessing )
155    return RTEMS_MP_NOT_CONFIGURED;
156#endif
157
158  if (count == 0)
159      return RTEMS_INVALID_NUMBER;
160
161  if (max_message_size == 0)
162      return RTEMS_INVALID_SIZE;
163
164#if defined(RTEMS_MULTIPROCESSING)
165#if 1
166  /*
167   * I am not 100% sure this should be an error.
168   * It seems reasonable to create a que with a large max size,
169   * and then just send smaller msgs from remote (or all) nodes.
170   */
171 
172  if ( is_global && (_MPCI_table->maximum_packet_size < max_message_size) )
173    return RTEMS_INVALID_SIZE;
174#endif
175#endif
176       
177  _Thread_Disable_dispatch();              /* protects object pointer */
178
179  the_message_queue = _Message_queue_Allocate( count, max_message_size );
180
181  if ( !the_message_queue ) {
182    _Thread_Enable_dispatch();
183    return RTEMS_TOO_MANY;
184  }
185
186#if defined(RTEMS_MULTIPROCESSING)
187  if ( is_global &&
188    !( _Objects_MP_Allocate_and_open( &_Message_queue_Information,
189                              name, the_message_queue->Object.id, FALSE ) ) ) {
190    _Message_queue_Free( the_message_queue );
191    _Thread_Enable_dispatch();
192    return RTEMS_TOO_MANY;
193  }
194#endif
195
196  the_message_queue->attribute_set = attribute_set;
197
198  if (_Attributes_Is_priority( attribute_set ) )
199    the_message_queue_attributes.discipline =
200                                      CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY;
201  else
202    the_message_queue_attributes.discipline =
203                                      CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO;
204
205  handler = NULL;
206#if defined(RTEMS_MULTIPROCESSING)
207  handler = _Message_queue_MP_Send_extract_proxy;
208#endif
209
210  if ( ! _CORE_message_queue_Initialize(
211           &the_message_queue->message_queue,
212           OBJECTS_RTEMS_MESSAGE_QUEUES,
213           &the_message_queue_attributes,
214           count,
215           max_message_size,
216           handler ) ) {
217#if defined(RTEMS_MULTIPROCESSING)
218    if ( is_global )
219        _Objects_MP_Close(
220          &_Message_queue_Information, the_message_queue->Object.id);
221#endif
222
223    _Message_queue_Free( the_message_queue );
224    _Thread_Enable_dispatch();
225    return RTEMS_TOO_MANY;
226  }
227
228  _Objects_Open(
229    &_Message_queue_Information,
230    &the_message_queue->Object,
231    &name
232  );
233
234  *id = the_message_queue->Object.id;
235
236#if defined(RTEMS_MULTIPROCESSING)
237  if ( is_global )
238    _Message_queue_MP_Send_process_packet(
239      MESSAGE_QUEUE_MP_ANNOUNCE_CREATE,
240      the_message_queue->Object.id,
241      name,
242      0
243    );
244#endif
245
246  _Thread_Enable_dispatch();
247  return RTEMS_SUCCESSFUL;
248}
249
250/*PAGE
251 *
252 *  rtems_message_queue_ident
253 *
254 *  This directive returns the system ID associated with
255 *  the message queue name.
256 *
257 *  Input parameters:
258 *    name - user defined message queue name
259 *    node - node(s) to be searched
260 *    id   - pointer to message queue id
261 *
262 *  Output parameters:
263 *    *id               - message queue id
264 *    RTEMS_SUCCESSFUL - if successful
265 *    error code        - if unsuccessful
266 */
267
268rtems_status_code rtems_message_queue_ident(
269  rtems_name    name,
270  unsigned32    node,
271  Objects_Id   *id
272)
273{
274  Objects_Name_to_id_errors  status;
275
276  status = _Objects_Name_to_id(
277    &_Message_queue_Information,
278    &name,
279    node,
280    id
281  );
282
283  return _Status_Object_name_errors_to_status[ status ];
284}
285
286/*PAGE
287 *
288 *  rtems_message_queue_delete
289 *
290 *  This directive allows a thread to delete the message queue specified
291 *  by the given queue identifier.
292 *
293 *  Input parameters:
294 *    id - queue id
295 *
296 *  Output parameters:
297 *    RTEMS_SUCCESSFUL - if successful
298 *    error code        - if unsuccessful
299 */
300
301rtems_status_code rtems_message_queue_delete(
302  Objects_Id id
303)
304{
305  register Message_queue_Control *the_message_queue;
306  Objects_Locations               location;
307
308  the_message_queue = _Message_queue_Get( id, &location );
309  switch ( location ) {
310
311    case OBJECTS_REMOTE:
312#if defined(RTEMS_MULTIPROCESSING)
313      _Thread_Dispatch();
314      return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
315#endif
316
317    case OBJECTS_ERROR:
318      return RTEMS_INVALID_ID;
319
320    case OBJECTS_LOCAL:
321      _Objects_Close( &_Message_queue_Information,
322                      &the_message_queue->Object );
323
324      _CORE_message_queue_Close(
325        &the_message_queue->message_queue,
326#if defined(RTEMS_MULTIPROCESSING)
327        _Message_queue_MP_Send_object_was_deleted,
328#else
329        NULL,
330#endif
331        CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED
332      );
333
334      _Message_queue_Free( the_message_queue );
335
336#if defined(RTEMS_MULTIPROCESSING)
337      if ( _Attributes_Is_global( the_message_queue->attribute_set ) ) {
338        _Objects_MP_Close(
339          &_Message_queue_Information,
340          the_message_queue->Object.id
341        );
342
343        _Message_queue_MP_Send_process_packet(
344          MESSAGE_QUEUE_MP_ANNOUNCE_DELETE,
345          the_message_queue->Object.id,
346          0,                                 /* Not used */
347          0
348        );
349      }
350#endif
351
352      _Thread_Enable_dispatch();
353      return RTEMS_SUCCESSFUL;
354  }
355
356  return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
357}
358
359/*PAGE
360 *
361 *  rtems_message_queue_send
362 *
363 *  This routine implements the directives q_send.  It sends a
364 *  message to the specified message queue.
365 *
366 *  Input parameters:
367 *    id     - pointer to message queue
368 *    buffer - pointer to message buffer
369 *    size   - size of message to sent urgently
370 *
371 *  Output parameters:
372 *    RTEMS_SUCCESSFUL - if successful
373 *    error code        - if unsuccessful
374 */
375
376rtems_status_code rtems_message_queue_send(
377  Objects_Id            id,
378  void                 *buffer,
379  unsigned32            size
380)
381{
382  return( _Message_queue_Submit(id, buffer, size, MESSAGE_QUEUE_SEND_REQUEST) );
383}
384
385/*PAGE
386 *
387 *  rtems_message_queue_urgent
388 *
389 *  This routine implements the directives q_urgent.  It urgents a
390 *  message to the specified message queue.
391 *
392 *  Input parameters:
393 *    id     - pointer to message queue
394 *    buffer - pointer to message buffer
395 *    size   - size of message to sent urgently
396 *
397 *  Output parameters:
398 *    RTEMS_SUCCESSFUL - if successful
399 *    error code       - if unsuccessful
400 */
401
402rtems_status_code rtems_message_queue_urgent(
403  Objects_Id            id,
404  void                 *buffer,
405  unsigned32            size
406)
407{
408  return(_Message_queue_Submit(id, buffer, size, MESSAGE_QUEUE_URGENT_REQUEST));
409}
410
411/*PAGE
412 *
413 *  rtems_message_queue_broadcast
414 *
415 *  This directive sends a message for every thread waiting on the queue
416 *  designated by id.
417 *
418 *  Input parameters:
419 *    id     - pointer to message queue
420 *    buffer - pointer to message buffer
421 *    size   - size of message to broadcast
422 *    count  - pointer to area to store number of threads made ready
423 *
424 *  Output parameters:
425 *    count             - number of threads made ready
426 *    RTEMS_SUCCESSFUL  - if successful
427 *    error code        - if unsuccessful
428 */
429
430rtems_status_code rtems_message_queue_broadcast(
431  Objects_Id            id,
432  void                 *buffer,
433  unsigned32            size,
434  unsigned32           *count
435)
436{
437  register Message_queue_Control *the_message_queue;
438  Objects_Locations               location;
439  CORE_message_queue_Status       core_status;
440
441  the_message_queue = _Message_queue_Get( id, &location );
442  switch ( location ) {
443    case OBJECTS_REMOTE:
444#if defined(RTEMS_MULTIPROCESSING)
445      _Thread_Executing->Wait.return_argument = count;
446
447      return
448        _Message_queue_MP_Send_request_packet(
449          MESSAGE_QUEUE_MP_BROADCAST_REQUEST,
450          id,
451          buffer,
452          &size,
453          0,                               /* option_set not used */
454          MPCI_DEFAULT_TIMEOUT
455        );
456#endif
457
458    case OBJECTS_ERROR:
459      return RTEMS_INVALID_ID;
460
461    case OBJECTS_LOCAL:
462      core_status = _CORE_message_queue_Broadcast(
463                      &the_message_queue->message_queue,
464                      buffer,
465                      size,
466                      id,
467                      _MESSAGE_QUEUE_CORE_MESSAGE_QUEUE_MP_SUPPORT,
468                      count
469                    );
470                     
471      _Thread_Enable_dispatch();
472      return
473        _Message_queue_Translate_core_message_queue_return_code( core_status );
474
475  }
476  return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
477}
478
479/*PAGE
480 *
481 *  rtems_message_queue_receive
482 *
483 *  This directive dequeues a message from the designated message queue
484 *  and copies it into the requesting thread's buffer.
485 *
486 *  Input parameters:
487 *    id         - queue id
488 *    buffer     - pointer to message buffer
489 *    size       - size of message receive
490 *    option_set - options on receive
491 *    timeout    - number of ticks to wait
492 *
493 *  Output parameters:
494 *    RTEMS_SUCCESSFUL - if successful
495 *    error code       - if unsuccessful
496 */
497
498rtems_status_code rtems_message_queue_receive(
499  Objects_Id            id,
500  void                 *buffer,
501  unsigned32           *size,
502  unsigned32            option_set,
503  rtems_interval        timeout
504)
505{
506  register Message_queue_Control *the_message_queue;
507  Objects_Locations               location;
508  boolean                         wait;
509
510  the_message_queue = _Message_queue_Get( id, &location );
511  switch ( location ) {
512
513    case OBJECTS_REMOTE:
514#if defined(RTEMS_MULTIPROCESSING)
515      return _Message_queue_MP_Send_request_packet(
516          MESSAGE_QUEUE_MP_RECEIVE_REQUEST,
517          id,
518          buffer,
519          size,
520          option_set,
521          timeout
522        );
523#endif
524
525    case OBJECTS_ERROR:
526      return RTEMS_INVALID_ID;
527
528    case OBJECTS_LOCAL:
529      if ( _Options_Is_no_wait( option_set ) )
530        wait = FALSE;
531      else
532        wait = TRUE;
533 
534      _CORE_message_queue_Seize(
535        &the_message_queue->message_queue,
536        the_message_queue->Object.id,
537        buffer,
538        size,
539        wait,
540        timeout
541      );
542      _Thread_Enable_dispatch();
543      return( _Message_queue_Translate_core_message_queue_return_code(
544                  _Thread_Executing->Wait.return_code ) );
545
546  }
547
548  return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
549}
550
551/*PAGE
552 *
553 *  rtems_message_queue_flush
554 *
555 *  This directive removes all pending messages from a queue and returns
556 *  the number of messages removed.  If no messages were present then
557 *  a count of zero is returned.
558 *
559 *  Input parameters:
560 *    id    - queue id
561 *    count - return area for count
562 *
563 *  Output parameters:
564 *    count             - number of messages removed ( 0 = empty queue )
565 *    RTEMS_SUCCESSFUL - if successful
566 *    error code        - if unsuccessful
567 */
568
569rtems_status_code rtems_message_queue_flush(
570  Objects_Id  id,
571  unsigned32 *count
572)
573{
574  register Message_queue_Control *the_message_queue;
575  Objects_Locations               location;
576
577  the_message_queue = _Message_queue_Get( id, &location );
578  switch ( location ) {
579    case OBJECTS_REMOTE:
580#if defined(RTEMS_MULTIPROCESSING)
581      _Thread_Executing->Wait.return_argument = count;
582
583      return
584        _Message_queue_MP_Send_request_packet(
585          MESSAGE_QUEUE_MP_FLUSH_REQUEST,
586          id,
587          0,                               /* buffer not used */
588          0,                               /* size */
589          0,                               /* option_set not used */
590          MPCI_DEFAULT_TIMEOUT
591        );
592#endif
593
594    case OBJECTS_ERROR:
595      return RTEMS_INVALID_ID;
596
597    case OBJECTS_LOCAL:
598      *count = _CORE_message_queue_Flush( &the_message_queue->message_queue );
599      _Thread_Enable_dispatch();
600      return RTEMS_SUCCESSFUL;
601  }
602
603  return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
604}
605
606/*PAGE
607 *
608 *  rtems_message_queue_get_number_pending
609 *
610 *  This directive returns the number of messages pending.
611 *
612 *  Input parameters:
613 *    id    - queue id
614 *    count - return area for count
615 *
616 *  Output parameters:
617 *    count             - number of messages removed ( 0 = empty queue )
618 *    RTEMS_SUCCESSFUL - if successful
619 *    error code        - if unsuccessful
620 */
621
622rtems_status_code rtems_message_queue_get_number_pending(
623  Objects_Id  id,
624  unsigned32 *count
625)
626{
627  register Message_queue_Control *the_message_queue;
628  Objects_Locations               location;
629
630  the_message_queue = _Message_queue_Get( id, &location );
631  switch ( location ) {
632    case OBJECTS_REMOTE:
633#if defined(RTEMS_MULTIPROCESSING)
634      _Thread_Executing->Wait.return_argument = count;
635
636      return _Message_queue_MP_Send_request_packet(
637          MESSAGE_QUEUE_MP_GET_NUMBER_PENDING_REQUEST,
638          id,
639          0,                               /* buffer not used */
640          0,                               /* size */
641          0,                               /* option_set not used */
642          MPCI_DEFAULT_TIMEOUT
643        );
644#endif
645
646    case OBJECTS_ERROR:
647      return RTEMS_INVALID_ID;
648
649    case OBJECTS_LOCAL:
650      *count = the_message_queue->message_queue.number_of_pending_messages;
651      _Thread_Enable_dispatch();
652      return RTEMS_SUCCESSFUL;
653  }
654
655  return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
656}
657
658/*PAGE
659 *
660 *  _Message_queue_Submit
661 *
662 *  This routine implements the directives rtems_message_queue_send
663 *  and rtems_message_queue_urgent.  It processes a message that is
664 *  to be submitted to the designated message queue.  The message will
665 *  either be processed as a send send message which it will be inserted
666 *  at the rear of the queue or it will be processed as an urgent message
667 *  which will be inserted at the front of the queue.
668 *
669 *  Input parameters:
670 *    id          - pointer to message queue
671 *    buffer      - pointer to message buffer
672 *    size        - size in bytes of message to send
673 *    submit_type - send or urgent message
674 *
675 *  Output parameters:
676 *    RTEMS_SUCCESSFUL - if successful
677 *    error code       - if unsuccessful
678 */
679
680rtems_status_code _Message_queue_Submit(
681  Objects_Id                  id,
682  void                       *buffer,
683  unsigned32                  size,
684  Message_queue_Submit_types  submit_type
685)
686{
687  register Message_queue_Control  *the_message_queue;
688  Objects_Locations                location;
689  CORE_message_queue_Status        core_status;
690
691  the_message_queue = _Message_queue_Get( id, &location );
692  switch ( location )
693  {
694    case OBJECTS_REMOTE:
695#if defined(RTEMS_MULTIPROCESSING)
696      switch ( submit_type ) {
697        case MESSAGE_QUEUE_SEND_REQUEST:
698          return _Message_queue_MP_Send_request_packet(
699              MESSAGE_QUEUE_MP_SEND_REQUEST,
700              id,
701              buffer,
702              &size,
703              0,                               /* option_set */
704              MPCI_DEFAULT_TIMEOUT
705            );
706
707        case MESSAGE_QUEUE_URGENT_REQUEST:
708          return _Message_queue_MP_Send_request_packet(
709              MESSAGE_QUEUE_MP_URGENT_REQUEST,
710              id,
711              buffer,
712              &size,
713              0,                               /* option_set */
714              MPCI_DEFAULT_TIMEOUT
715            );
716      }
717      break;
718#endif
719
720    case OBJECTS_ERROR:
721      return RTEMS_INVALID_ID;
722
723    case OBJECTS_LOCAL:
724      switch ( submit_type ) {
725        case MESSAGE_QUEUE_SEND_REQUEST:
726          core_status = _CORE_message_queue_Send(
727                          &the_message_queue->message_queue,
728                          buffer,
729                          size,
730                          id,
731                          _MESSAGE_QUEUE_CORE_MESSAGE_QUEUE_MP_SUPPORT
732                        );
733          break;
734        case MESSAGE_QUEUE_URGENT_REQUEST:
735          core_status = _CORE_message_queue_Urgent(
736                          &the_message_queue->message_queue,
737                          buffer,
738                          size,
739                          id,
740                          _MESSAGE_QUEUE_CORE_MESSAGE_QUEUE_MP_SUPPORT
741                        );
742          break;
743        default:
744          core_status = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL;
745          return RTEMS_INTERNAL_ERROR;   /* should never get here */
746      }
747
748      _Thread_Enable_dispatch();
749      return _Message_queue_Translate_core_message_queue_return_code(
750                core_status );
751         
752  }
753  return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
754}
755
756/*PAGE
757 *
758 *  _Message_queue_Translate_core_message_queue_return_code
759 *
760 *  Input parameters:
761 *    the_message_queue_status - message_queue status code to translate
762 *
763 *  Output parameters:
764 *    rtems status code - translated RTEMS status code
765 *
766 */
767 
768rtems_status_code _Message_queue_Translate_core_message_queue_return_code (
769  unsigned32 the_message_queue_status
770)
771{
772  switch ( the_message_queue_status ) {
773    case  CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL:
774      return RTEMS_SUCCESSFUL;
775    case  CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE:
776      return RTEMS_INVALID_SIZE;
777    case  CORE_MESSAGE_QUEUE_STATUS_TOO_MANY:
778      return RTEMS_TOO_MANY;
779    case CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED:
780      return RTEMS_UNSATISFIED;
781    case CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT:
782      return RTEMS_UNSATISFIED;
783    case CORE_MESSAGE_QUEUE_STATUS_WAS_DELETED:
784      return RTEMS_OBJECT_WAS_DELETED;
785    case CORE_MESSAGE_QUEUE_STATUS_TIMEOUT:
786      return RTEMS_TIMEOUT;
787    case THREAD_STATUS_PROXY_BLOCKING:
788      return RTEMS_PROXY_BLOCKING;
789  }
790  _Internal_error_Occurred(         /* XXX */
791    INTERNAL_ERROR_RTEMS_API,
792    TRUE,
793    the_message_queue_status
794  );
795  return RTEMS_INTERNAL_ERROR;   /* unreached - only to remove warnings */
796}
797
798/*PAGE
799 *
800 *  _Message_queue_Core_message_queue_mp_support
801 *
802 *  Input parameters:
803 *    the_thread - the remote thread the message was submitted to
804 *    id         - id of the message queue
805 *
806 *  Output parameters: NONE
807 */
808 
809#if defined(RTEMS_MULTIPROCESSING)
810void  _Message_queue_Core_message_queue_mp_support (
811  Thread_Control *the_thread,
812  Objects_Id      id
813)
814{
815  the_thread->receive_packet->return_code = RTEMS_SUCCESSFUL;
816 
817  _Message_queue_MP_Send_response_packet(
818    MESSAGE_QUEUE_MP_RECEIVE_RESPONSE,
819    id,
820    the_thread
821  );
822}
823#endif
Note: See TracBrowser for help on using the repository browser.