Changeset 3270ca6 in rtems


Ignore:
Timestamp:
May 17, 1999, 10:53:34 PM (22 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
a2d0f39
Parents:
1e1b3e00
Message:

Forgot to actually remove the routines. :)

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/rtems/src/msg.c

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

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