Changeset 507d382 in rtems for cpukit/score/src/coremsgseize.c


Ignore:
Timestamp:
Sep 11, 2009, 8:00:30 PM (11 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 5, master
Children:
5a6d25fc
Parents:
b094233
Message:

2009-09-11 Joel Sherrill <joel.sherrill@…>

  • score/include/rtems/score/coremsg.h, score/inline/rtems/score/coremsg.inl, score/src/coremsg.c, score/src/coremsginsert.c, score/src/coremsgseize.c, score/src/coremsgsubmit.c, score/src/objectnametoidstring.c: Disable the Core Message Queue features of notification, priority messages, and blocking sends when no API requires them.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/src/coremsgseize.c

    rb094233 r507d382  
    6969  CORE_message_queue_Buffer_control *the_message;
    7070  Thread_Control                    *executing;
    71   Thread_Control                    *the_thread;
    7271
    7372  executing = _Thread_Executing;
     
    8079
    8180    *size_p = the_message->Contents.size;
    82     _Thread_Executing->Wait.count = the_message->priority;
     81    #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY)
     82      _Thread_Executing->Wait.count = the_message->priority;
     83    #endif
    8384    _CORE_message_queue_Copy_buffer(the_message->Contents.buffer,buffer,*size_p);
    8485
    85     /*
    86      *  There could be a thread waiting to send a message.  If there
    87      *  is not, then we can go ahead and free the buffer.
    88      *
    89      *  NOTE: If we note that the queue was not full before this receive,
    90      *  then we can avoid this dequeue.
    91      */
    92 
    93     the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue );
    94     if ( !the_thread ) {
     86    #if !defined(RTEMS_SCORE_COREMSG_ENABLE_BLOCKING_SEND)
     87      /*
     88       *  There is not an API with blocking sends enabled.  So return immediately.
     89       */
    9590      _CORE_message_queue_Free_message_buffer( the_message_queue, the_message );
    9691      return;
     92    #else
     93    {
     94      Thread_Control   *the_thread;
     95
     96      /*
     97       *  There could be a thread waiting to send a message.  If there
     98       *  is not, then we can go ahead and free the buffer.
     99       *
     100       *  NOTE: If we note that the queue was not full before this receive,
     101       *  then we can avoid this dequeue.
     102       */
     103      the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue );
     104      if ( !the_thread ) {
     105        _CORE_message_queue_Free_message_buffer( the_message_queue, the_message );
     106        return;
     107      }
     108
     109      /*
     110       *  There was a thread waiting to send a message.  This code
     111       *  puts the messages in the message queue on behalf of the
     112       *  waiting task.
     113       */
     114      #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY)
     115        the_message->priority  = the_thread->Wait.count;
     116      #endif
     117      the_message->Contents.size = (size_t) the_thread->Wait.option;
     118      _CORE_message_queue_Copy_buffer(
     119        the_thread->Wait.return_argument_second.immutable_object,
     120        the_message->Contents.buffer,
     121        the_message->Contents.size
     122      );
     123
     124      _CORE_message_queue_Insert_message(
     125         the_message_queue,
     126         the_message,
     127         #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY)
     128           the_message->priority,
     129         #else
     130           0
     131         #endif
     132      );
     133      return;
    97134    }
    98 
    99     /*
    100      *  There was a thread waiting to send a message.  This code
    101      *  puts the messages in the message queue on behalf of the
    102      *  waiting task.
    103      */
    104 
    105     the_message->priority  = the_thread->Wait.count;
    106     the_message->Contents.size = (size_t) the_thread->Wait.option;
    107     _CORE_message_queue_Copy_buffer(
    108       the_thread->Wait.return_argument_second.immutable_object,
    109       the_message->Contents.buffer,
    110       the_message->Contents.size
    111     );
    112 
    113     _CORE_message_queue_Insert_message(
    114        the_message_queue,
    115        the_message,
    116        the_message->priority
    117     );
    118     return;
     135    #endif
    119136  }
    120137
Note: See TracChangeset for help on using the changeset viewer.