Changeset bb322a0 in rtems


Ignore:
Timestamp:
Aug 22, 1995, 3:37:59 PM (26 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
da6375b
Parents:
b2c491a0
Message:

make inline and macro implementations match

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/rtems/macros/message.inl

    rb2c491a0 rbb322a0  
    2323 */
    2424
    25 #define _Message_queue_Copy_buffer( _source, _destination ) \
     25#define _Message_queue_Copy_buffer( _source, _destination, _size ) \
    2626  memcpy( _destination, _source, _size)
    2727
     
    3232 */
    3333
    34 #define _Message_queue_Allocate_message_buffer() \
    35    (Message_queue_Buffer_control *) \
    36      _Chain_Get( &_Message_queue_Inactive_messages )
     34#define _Message_queue_Allocate_message_buffer( _the_message_queue ) \
     35  (Message_queue_Buffer_control *) \
     36    _Chain_Get( &(_the_message_queue)->Inactive_messages )
    3737
    3838/*PAGE
     
    4242 */
    4343
    44 #define _Message_queue_Free_message_buffer( _the_message ) \
    45    _Chain_Append( &_Message_queue_Inactive_messages, &(_the_message)->Node )
     44#define _Message_queue_Free_message_buffer( _the_message_queue, _the_message ) \
     45  _Chain_Append( \
     46    &(_the_message_queue)->Inactive_messages, \
     47    &(_the_message)->Node \
     48  )
    4649
    4750/*PAGE
     
    9396  do { \
    9497    \
    95     if ( (_the_messsage_queue)->message_buffers ) { \
     98    if ( (_the_message_queue)->message_buffers ) { \
    9699      _Workspace_Free((void *) (_the_message_queue)->message_buffers); \
    97100      (_the_message_queue)->message_buffers = 0; \
    98     }
     101    } \
    99102    \
    100103    _Objects_Free( \
  • c/src/exec/rtems/macros/rtems/rtems/message.inl

    rb2c491a0 rbb322a0  
    2323 */
    2424
    25 #define _Message_queue_Copy_buffer( _source, _destination ) \
     25#define _Message_queue_Copy_buffer( _source, _destination, _size ) \
    2626  memcpy( _destination, _source, _size)
    2727
     
    3232 */
    3333
    34 #define _Message_queue_Allocate_message_buffer() \
    35    (Message_queue_Buffer_control *) \
    36      _Chain_Get( &_Message_queue_Inactive_messages )
     34#define _Message_queue_Allocate_message_buffer( _the_message_queue ) \
     35  (Message_queue_Buffer_control *) \
     36    _Chain_Get( &(_the_message_queue)->Inactive_messages )
    3737
    3838/*PAGE
     
    4242 */
    4343
    44 #define _Message_queue_Free_message_buffer( _the_message ) \
    45    _Chain_Append( &_Message_queue_Inactive_messages, &(_the_message)->Node )
     44#define _Message_queue_Free_message_buffer( _the_message_queue, _the_message ) \
     45  _Chain_Append( \
     46    &(_the_message_queue)->Inactive_messages, \
     47    &(_the_message)->Node \
     48  )
    4649
    4750/*PAGE
     
    9396  do { \
    9497    \
    95     if ( (_the_messsage_queue)->message_buffers ) { \
     98    if ( (_the_message_queue)->message_buffers ) { \
    9699      _Workspace_Free((void *) (_the_message_queue)->message_buffers); \
    97100      (_the_message_queue)->message_buffers = 0; \
    98     }
     101    } \
    99102    \
    100103    _Objects_Free( \
  • c/src/exec/rtems/src/msg.c

    rb2c491a0 rbb322a0  
    6969    unsigned32 allocated_message_size;
    7070
    71     mq = (Message_queue_Control *)_Objects_Allocate(&_Message_queue_Information);
     71    mq = \
     72      (Message_queue_Control *)_Objects_Allocate(&_Message_queue_Information);
     73
    7274    if (mq == 0)
    7375        goto failed;
     
    8082   
    8183    allocated_message_size = max_message_size;
    82     if (allocated_message_size & (sizeof(unsigned32) - 1))
    83     {
     84    if (allocated_message_size & (sizeof(unsigned32) - 1)) {
    8485        allocated_message_size += sizeof(unsigned32);
    8586        allocated_message_size &= ~(sizeof(unsigned32) - 1);
    8687    }
    8788   
    88     message_buffering_required = count * (allocated_message_size + sizeof(Message_queue_Buffer_control));
     89    message_buffering_required =
     90      count * (allocated_message_size + sizeof(Message_queue_Buffer_control));
    8991 
    90     mq->message_buffers = (Message_queue_Buffer *) _Workspace_Allocate(message_buffering_required);
     92    mq->message_buffers =
     93      (Message_queue_Buffer *) _Workspace_Allocate(message_buffering_required);
     94
    9195    if (mq->message_buffers == 0)
    9296        goto failed;
    9397 
    94     _Chain_Initialize(&mq->Inactive_messages,
    95                       mq->message_buffers,
    96                       count,
    97                       allocated_message_size + sizeof(Message_queue_Buffer_control));
     98    _Chain_Initialize
     99      (&mq->Inactive_messages,
     100      mq->message_buffers,
     101      count,
     102      allocated_message_size + sizeof(Message_queue_Buffer_control)
     103    );
    98104    return mq;
    99105
  • cpukit/rtems/macros/rtems/rtems/message.inl

    rb2c491a0 rbb322a0  
    2323 */
    2424
    25 #define _Message_queue_Copy_buffer( _source, _destination ) \
     25#define _Message_queue_Copy_buffer( _source, _destination, _size ) \
    2626  memcpy( _destination, _source, _size)
    2727
     
    3232 */
    3333
    34 #define _Message_queue_Allocate_message_buffer() \
    35    (Message_queue_Buffer_control *) \
    36      _Chain_Get( &_Message_queue_Inactive_messages )
     34#define _Message_queue_Allocate_message_buffer( _the_message_queue ) \
     35  (Message_queue_Buffer_control *) \
     36    _Chain_Get( &(_the_message_queue)->Inactive_messages )
    3737
    3838/*PAGE
     
    4242 */
    4343
    44 #define _Message_queue_Free_message_buffer( _the_message ) \
    45    _Chain_Append( &_Message_queue_Inactive_messages, &(_the_message)->Node )
     44#define _Message_queue_Free_message_buffer( _the_message_queue, _the_message ) \
     45  _Chain_Append( \
     46    &(_the_message_queue)->Inactive_messages, \
     47    &(_the_message)->Node \
     48  )
    4649
    4750/*PAGE
     
    9396  do { \
    9497    \
    95     if ( (_the_messsage_queue)->message_buffers ) { \
     98    if ( (_the_message_queue)->message_buffers ) { \
    9699      _Workspace_Free((void *) (_the_message_queue)->message_buffers); \
    97100      (_the_message_queue)->message_buffers = 0; \
    98     }
     101    } \
    99102    \
    100103    _Objects_Free( \
  • cpukit/rtems/src/msg.c

    rb2c491a0 rbb322a0  
    6969    unsigned32 allocated_message_size;
    7070
    71     mq = (Message_queue_Control *)_Objects_Allocate(&_Message_queue_Information);
     71    mq = \
     72      (Message_queue_Control *)_Objects_Allocate(&_Message_queue_Information);
     73
    7274    if (mq == 0)
    7375        goto failed;
     
    8082   
    8183    allocated_message_size = max_message_size;
    82     if (allocated_message_size & (sizeof(unsigned32) - 1))
    83     {
     84    if (allocated_message_size & (sizeof(unsigned32) - 1)) {
    8485        allocated_message_size += sizeof(unsigned32);
    8586        allocated_message_size &= ~(sizeof(unsigned32) - 1);
    8687    }
    8788   
    88     message_buffering_required = count * (allocated_message_size + sizeof(Message_queue_Buffer_control));
     89    message_buffering_required =
     90      count * (allocated_message_size + sizeof(Message_queue_Buffer_control));
    8991 
    90     mq->message_buffers = (Message_queue_Buffer *) _Workspace_Allocate(message_buffering_required);
     92    mq->message_buffers =
     93      (Message_queue_Buffer *) _Workspace_Allocate(message_buffering_required);
     94
    9195    if (mq->message_buffers == 0)
    9296        goto failed;
    9397 
    94     _Chain_Initialize(&mq->Inactive_messages,
    95                       mq->message_buffers,
    96                       count,
    97                       allocated_message_size + sizeof(Message_queue_Buffer_control));
     98    _Chain_Initialize
     99      (&mq->Inactive_messages,
     100      mq->message_buffers,
     101      count,
     102      allocated_message_size + sizeof(Message_queue_Buffer_control)
     103    );
    98104    return mq;
    99105
Note: See TracChangeset for help on using the changeset viewer.