source: rtems/cpukit/score/macros/rtems/score/coremsg.inl @ a50b011f

4.104.114.84.95
Last change on this file since a50b011f was a50b011f, checked in by Joel Sherrill <joel.sherrill@…>, on Aug 14, 2002 at 11:32:25 PM

2002-08-14 Joel Sherrill <joel@…>

  • macros/rtems/score/coremsg.inl: Add <string.h> to remove warning.
  • src/threadidlebody.c: Add return 0 to avoid warning.
  • Property mode set to 100644
File size: 3.4 KB
Line 
1/*  coremsg.inl
2 *
3 *  This include file contains the macro implementation of all
4 *  inlined routines in the Core Message Handler.
5 *
6 *  COPYRIGHT (c) 1989-1999.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.OARcorp.com/rtems/license.html.
12 *
13 *  $Id$
14 */
15
16#ifndef __CORE_MESSAGE_QUEUE_inl
17#define __CORE_MESSAGE_QUEUE_inl
18
19#include <string.h>  /* for memcpy */
20
21/*PAGE
22 *
23 *  _CORE_message_queue_Send
24 *
25 */
26
27#define _CORE_message_queue_Send( _the_message_queue, _buffer, _size, \
28       _id, _api_message_queue_mp_support, _wait, _timeout ) \
29  _CORE_message_queue_Submit( (_the_message_queue), (_buffer), (_size), \
30     (_id), (_api_message_queue_mp_support), \
31     CORE_MESSAGE_QUEUE_SEND_REQUEST, (_wait), (_timeout) )
32 
33/*PAGE
34 *
35 *  _CORE_message_queue_Urgent
36 *
37 */
38 
39#define _CORE_message_queue_Urgent( _the_message_queue, _buffer, _size, \
40       _id, _api_message_queue_mp_support, _wait, _timeout ) \
41  _CORE_message_queue_Submit( (_the_message_queue), (_buffer), (_size), \
42     (_id), (_api_message_queue_mp_support), \
43     CORE_MESSAGE_QUEUE_URGENT_REQUEST, (_wait), (_timeout) )
44
45/*PAGE
46 *
47 *  _CORE_message_queue_Copy_buffer
48 */
49
50#define _CORE_message_queue_Copy_buffer( _source, _destination, _size ) \
51  memcpy( _destination, _source, _size)
52
53/*PAGE
54 *
55 *  _CORE_message_queue_Allocate_message_buffer
56 *
57 */
58
59#define _CORE_message_queue_Allocate_message_buffer( _the_message_queue ) \
60  (CORE_message_queue_Buffer_control *) \
61    _Chain_Get( &(_the_message_queue)->Inactive_messages )
62
63/*PAGE
64 *
65 *  _CORE_message_queue_Free_message_buffer
66 *
67 */
68
69#define _CORE_message_queue_Free_message_buffer( _the_message_queue, _the_message ) \
70  _Chain_Append( \
71    &(_the_message_queue)->Inactive_messages, \
72    &(_the_message)->Node \
73  )
74
75/*PAGE
76 *
77 *  _CORE_message_queue_Is_priority
78 *
79 */
80 
81#define _CORE_message_queue_Is_priority( _the_attribute ) \
82  ((_the_attribute)->discipline == CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY)
83
84/*PAGE
85 *
86 *  _CORE_message_queue_Get_pending_message
87 *
88 */
89
90#define _CORE_message_queue_Get_pending_message( _the_message_queue ) \
91   (CORE_message_queue_Buffer_control *) \
92     _Chain_Get_unprotected( &(_the_message_queue)->Pending_messages )
93
94/*PAGE
95 *
96 *  _CORE_message_queue_Append
97 *
98 */
99
100#define _CORE_message_queue_Append( _the_message_queue, _the_message ) \
101   _Chain_Append( &(_the_message_queue)->Pending_messages, \
102                  &(_the_message)->Node )
103
104/*PAGE
105 *
106 *  _CORE_message_queue_Prepend
107 *
108 */
109
110#define _CORE_message_queue_Prepend( _the_message_queue, _the_message ) \
111   _Chain_Prepend( &(_the_message_queue)->Pending_messages, \
112                   &(_the_message)->Node )
113
114/*PAGE
115 *
116 *  _CORE_message_queue_Is_null
117 *
118 */
119
120#define _CORE_message_queue_Is_null( _the_message_queue ) \
121   ( (_the_message_queue) == NULL  )
122
123/*PAGE
124 *
125 *  _CORE_message_queue_Is_notify_enabled
126 *
127 */
128 
129#define _CORE_message_queue_Is_notify_enabled( _the_message_queue ) \
130  ( (_the_message_queue)->notify_handler != NULL )
131 
132/*PAGE
133 *
134 *  _CORE_message_queue_Set_notify
135 *
136 */
137 
138#define _CORE_message_queue_Set_notify( \
139  _the_message_queue, _the_handler, _the_argument ) \
140    do { \
141      (_the_message_queue)->notify_handler  = (_the_handler); \
142      (_the_message_queue)->notify_argument = (_the_argument); \
143    } while ( 0 )
144
145#endif
146/* end of include file */
Note: See TracBrowser for help on using the repository browser.