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