source: rtems/c/src/exec/score/macros/coremsg.inl @ 5e9b32b

4.104.114.84.95
Last change on this file since 5e9b32b was 5e9b32b, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 26, 1995 at 7:27:15 PM

posix support initially added

  • 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, 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 __CORE_MESSAGE_QUEUE_inl
18#define __CORE_MESSAGE_QUEUE_inl
19
20/*PAGE
21 *
22 *  _CORE_message_queue_Send
23 *
24 */
25 
26#define _CORE_message_queue_Send( _the_message_queue, _buffer, _size, \
27_id, _api_message_queue_mp_support ) \
28  _CORE_message_queue_Submit( (_the_message_queue), (_buffer), (_size), \
29     (_id), (_api_message_queue_mp_support), CORE_MESSAGE_QUEUE_SEND_REQUEST )
30 
31/*PAGE
32 *
33 *  _CORE_message_queue_Urgent
34 *
35 */
36 
37#define _CORE_message_queue_Urgent( _the_message_queue, _buffer, _size, \
38_id, _api_message_queue_mp_support ) \
39  _CORE_message_queue_Submit( (_the_message_queue), (_buffer), (_size), \
40     (_id), (_api_message_queue_mp_support), CORE_MESSAGE_QUEUE_URGENT_REQUEST )
41
42/*PAGE
43 *
44 *  _CORE_message_queue_Copy_buffer
45 */
46
47#define _CORE_message_queue_Copy_buffer( _source, _destination, _size ) \
48  memcpy( _destination, _source, _size)
49
50/*PAGE
51 *
52 *  _CORE_message_queue_Allocate_message_buffer
53 *
54 */
55
56#define _CORE_message_queue_Allocate_message_buffer( _the_message_queue ) \
57  (CORE_message_queue_Buffer_control *) \
58    _Chain_Get( &(_the_message_queue)->Inactive_messages )
59
60/*PAGE
61 *
62 *  _CORE_message_queue_Free_message_buffer
63 *
64 */
65
66#define _CORE_message_queue_Free_message_buffer( _the_message_queue, _the_message ) \
67  _Chain_Append( \
68    &(_the_message_queue)->Inactive_messages, \
69    &(_the_message)->Node \
70  )
71
72/*PAGE
73 *
74 *  _CORE_message_queue_Is_priority
75 *
76 */
77 
78#define _CORE_message_queue_Is_priority( _the_attribute ) \
79  ((_the_attribute)->discipline == CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY)
80
81/*PAGE
82 *
83 *  _CORE_message_queue_Get_pending_message
84 *
85 */
86
87#define _CORE_message_queue_Get_pending_message( _the_message_queue ) \
88   (CORE_message_queue_Buffer_control *) \
89     _Chain_Get_unprotected( &(_the_message_queue)->Pending_messages )
90
91/*PAGE
92 *
93 *  _CORE_message_queue_Append
94 *
95 */
96
97#define _CORE_message_queue_Append( _the_message_queue, _the_message ) \
98   _Chain_Append( &(_the_message_queue)->Pending_messages, \
99                  &(_the_message)->Node )
100
101/*PAGE
102 *
103 *  _CORE_message_queue_Prepend
104 *
105 */
106
107#define _CORE_message_queue_Prepend( _the_message_queue, _the_message ) \
108   _Chain_Prepend( &(_the_message_queue)->Pending_messages, \
109                   &(_the_message)->Node )
110
111/*PAGE
112 *
113 *  _CORE_message_queue_Is_null
114 *
115 */
116
117#define _CORE_message_queue_Is_null( _the_message_queue ) \
118   ( (_the_message_queue) == NULL  )
119
120/*PAGE
121 *
122 *  _CORE_message_queue_Is_notify_enabled
123 *
124 */
125 
126#define _CORE_message_queue_Is_notify_enabled( _the_message_queue ) \
127  ( (_the_message_queue)->notify_handler != NULL )
128 
129/*PAGE
130 *
131 *  _CORE_message_queue_Set_notify
132 *
133 */
134 
135#define _CORE_message_queue_Set_notify( \
136  _the_message_queue, _the_handler, _the_argument ) \
137    do { \
138      (_the_message_queue->notify_handler  = (_the_handler); \
139      (_the_message_queue->notify_argument = (_the_argument); \
140    } while ( 0 )
141
142#endif
143/* end of include file */
Note: See TracBrowser for help on using the repository browser.