source: rtems/c/src/exec/rtems/macros/message.inl @ b2c491a0

4.104.114.84.95
Last change on this file since b2c491a0 was b2c491a0, checked in by Joel Sherrill <joel.sherrill@…>, on 08/22/95 at 14:52:08

make inline and macro implementations match

  • Property mode set to 100644
File size: 2.5 KB
Line 
1/*  message.inl
2 *
3 *  This include file contains the macro implementation of all
4 *  inlined routines in the Message Manager.
5 *
6 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
7 *  On-Line Applications Research Corporation (OAR).
8 *  All rights assigned to U.S. Government, 1994.
9 *
10 *  This material may be reproduced by or for the U.S. Government pursuant
11 *  to the copyright license under the clause at DFARS 252.227-7013.  This
12 *  notice must appear in all copies of this file and its derivatives.
13 *
14 *  $Id$
15 */
16
17#ifndef __MESSAGE_QUEUE_inl
18#define __MESSAGE_QUEUE_inl
19
20/*PAGE
21 *
22 *  _Message_queue_Copy_buffer
23 */
24
25#define _Message_queue_Copy_buffer( _source, _destination ) \
26  memcpy( _destination, _source, _size)
27
28/*PAGE
29 *
30 *  _Message_queue_Allocate_message_buffer
31 *
32 */
33
34#define _Message_queue_Allocate_message_buffer() \
35   (Message_queue_Buffer_control *) \
36     _Chain_Get( &_Message_queue_Inactive_messages )
37
38/*PAGE
39 *
40 *  _Message_queue_Free_message_buffer
41 *
42 */
43
44#define _Message_queue_Free_message_buffer( _the_message ) \
45   _Chain_Append( &_Message_queue_Inactive_messages, &(_the_message)->Node )
46
47/*PAGE
48 *
49 *  _Message_queue_Get_pending_message
50 *
51 */
52
53#define _Message_queue_Get_pending_message( _the_message_queue ) \
54   (Message_queue_Buffer_control *) \
55     _Chain_Get_unprotected( &(_the_message_queue)->Pending_messages )
56
57/*PAGE
58 *
59 *  _Message_queue_Append
60 *
61 */
62
63#define _Message_queue_Append( _the_message_queue, _the_message ) \
64   _Chain_Append( &(_the_message_queue)->Pending_messages, \
65                  &(_the_message)->Node )
66
67/*PAGE
68 *
69 *  _Message_queue_Prepend
70 *
71 */
72
73#define _Message_queue_Prepend( _the_message_queue, _the_message ) \
74   _Chain_Prepend( &(_the_message_queue)->Pending_messages, \
75                   &(_the_message)->Node )
76
77/*PAGE
78 *
79 *  _Message_queue_Is_null
80 *
81 */
82
83#define _Message_queue_Is_null( _the_message_queue ) \
84   ( (_the_message_queue) == NULL  )
85
86/*PAGE
87 *
88 *  _Message_queue_Free
89 *
90 */
91
92#define _Message_queue_Free( _the_message_queue ) \
93  do { \
94    \
95    if ( (_the_messsage_queue)->message_buffers ) { \
96      _Workspace_Free((void *) (_the_message_queue)->message_buffers); \
97      (_the_message_queue)->message_buffers = 0; \
98    }
99    \
100    _Objects_Free( \
101      &_Message_queue_Information, \
102      &(_the_message_queue)->Object \
103    ); \
104  } while ( 0 )
105
106
107/*PAGE
108 *
109 *  _Message_queue_Get
110 *
111 */
112
113#define _Message_queue_Get( _id, _location ) \
114  (Message_queue_Control *) \
115     _Objects_Get( &_Message_queue_Information, (_id), (_location) )
116
117#endif
118/* end of include file */
Note: See TracBrowser for help on using the repository browser.