Changeset 641b44c in rtems for cpukit/rtems/src/msgqbroadcast.c


Ignore:
Timestamp:
May 20, 2016, 12:21:12 PM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
62c528e6
Parents:
0a00b2b
git-author:
Sebastian Huber <sebastian.huber@…> (05/20/16 12:21:12)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/20/16 14:16:59)
Message:

rtems: _Message_queue_Get_interrupt_disable()

Use _Objects_Get_local() for _Message_queue_Get_interrupt_disable() to
get rid of the location parameter. Move remote object handling to
message queue MPCI support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/rtems/src/msgqbroadcast.c

    r0a00b2b r641b44c  
    1919#endif
    2020
    21 #include <rtems/system.h>
    22 #include <rtems/score/chain.h>
    23 #include <rtems/score/isr.h>
    24 #include <rtems/score/coremsgimpl.h>
    25 #include <rtems/score/thread.h>
    26 #include <rtems/score/wkspace.h>
    27 #include <rtems/rtems/status.h>
    28 #include <rtems/rtems/attrimpl.h>
    2921#include <rtems/rtems/messageimpl.h>
    30 #include <rtems/rtems/options.h>
    31 #include <rtems/rtems/support.h>
    3222
    3323rtems_status_code rtems_message_queue_broadcast(
     
    3828)
    3929{
    40   Message_queue_Control          *the_message_queue;
    41   Objects_Locations               location;
    42   CORE_message_queue_Status       core_status;
    43   ISR_lock_Context                lock_context;
     30  Message_queue_Control     *the_message_queue;
     31  ISR_lock_Context           lock_context;
     32  CORE_message_queue_Status  status;
    4433
    45   if ( !buffer )
     34  if ( buffer == NULL ) {
    4635    return RTEMS_INVALID_ADDRESS;
     36  }
    4737
    48   if ( !count )
     38  if ( count == NULL ) {
    4939    return RTEMS_INVALID_ADDRESS;
     40  }
    5041
    5142  the_message_queue = _Message_queue_Get_interrupt_disable(
    5243    id,
    53     &location,
    5444    &lock_context
    5545  );
    56   switch ( location ) {
    5746
    58     case OBJECTS_LOCAL:
    59       core_status = _CORE_message_queue_Broadcast(
    60                       &the_message_queue->message_queue,
    61                       buffer,
    62                       size,
    63                       _Message_queue_Core_message_queue_mp_support,
    64                       id,
    65                       count,
    66                       &lock_context
    67                     );
    68       return
    69         _Message_queue_Translate_core_message_queue_return_code( core_status );
     47  if ( the_message_queue == NULL ) {
     48#if defined(RTEMS_MULTIPROCESSING)
     49    _Message_queue_MP_Broadcast( id, buffer, size, count );
     50#else
     51    return RTEMS_INVALID_ID;
     52#endif
     53  }
    7054
    71 #if defined(RTEMS_MULTIPROCESSING)
    72     case OBJECTS_REMOTE:
    73       _Thread_Executing->Wait.return_argument = count;
    74 
    75       return
    76         _Message_queue_MP_Send_request_packet(
    77           MESSAGE_QUEUE_MP_BROADCAST_REQUEST,
    78           id,
    79           buffer,
    80           &size,
    81           0,                               /* option_set not used */
    82           MPCI_DEFAULT_TIMEOUT
    83         );
    84 #endif
    85 
    86     case OBJECTS_ERROR:
    87       break;
    88   }
    89   return RTEMS_INVALID_ID;
     55  status = _CORE_message_queue_Broadcast(
     56    &the_message_queue->message_queue,
     57    buffer,
     58    size,
     59    _Message_queue_Core_message_queue_mp_support,
     60    id,
     61    count,
     62    &lock_context
     63  );
     64  return _Message_queue_Translate_core_message_queue_return_code( status );
    9065}
Note: See TracChangeset for help on using the changeset viewer.