source: rtems/c/src/exec/score/macros/rtems/score/coremsg.inl @ 43b6f75

4.104.114.84.95
Last change on this file since 43b6f75 was 43b6f75, checked in by Joel Sherrill <joel.sherrill@…>, on 11/30/00 at 14:08:30

2000-11-30 Joel Sherrill <joel@…>

  • General effort to make things compile with macros not inlines
  • inline/rtems/score/coremutex.inl: Added comment indicating for macros there is another copy of _CORE_mutex_Seize_interrupt_trylock() in src/coremutexseize.c.
  • src/coremutexseize.c: Added body of _CORE_mutex_Seize_interrupt_trylock() for macro case.
  • macros/rtems/score/coremutex.inl: Added prototype for _CORE_mutex_Seize_interrupt_trylock() since there is a real body when macros are enabled.
  • macros/rtems/score/coresem.inl: Added macro implementation of _CORE_semaphore_Seize_isr_disable.
  • macros/score/Makefile.am: Fixed typos.
  • rtems/score/address.inl: Correct macro implementation of _Addresses_Is_aligned() so it would compile.
  • macros/rtems/score/coremsg.inl: Added closing parentheses.
  • 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/*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, _wait, _timeout ) \
27  _CORE_message_queue_Submit( (_the_message_queue), (_buffer), (_size), \
28     (_id), (_api_message_queue_mp_support), \
29     CORE_MESSAGE_QUEUE_SEND_REQUEST, (_wait), (_timeout) )
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, _wait, _timeout ) \
39  _CORE_message_queue_Submit( (_the_message_queue), (_buffer), (_size), \
40     (_id), (_api_message_queue_mp_support), \
41     CORE_MESSAGE_QUEUE_URGENT_REQUEST, (_wait), (_timeout) )
42
43/*PAGE
44 *
45 *  _CORE_message_queue_Copy_buffer
46 */
47
48#define _CORE_message_queue_Copy_buffer( _source, _destination, _size ) \
49  memcpy( _destination, _source, _size)
50
51/*PAGE
52 *
53 *  _CORE_message_queue_Allocate_message_buffer
54 *
55 */
56
57#define _CORE_message_queue_Allocate_message_buffer( _the_message_queue ) \
58  (CORE_message_queue_Buffer_control *) \
59    _Chain_Get( &(_the_message_queue)->Inactive_messages )
60
61/*PAGE
62 *
63 *  _CORE_message_queue_Free_message_buffer
64 *
65 */
66
67#define _CORE_message_queue_Free_message_buffer( _the_message_queue, _the_message ) \
68  _Chain_Append( \
69    &(_the_message_queue)->Inactive_messages, \
70    &(_the_message)->Node \
71  )
72
73/*PAGE
74 *
75 *  _CORE_message_queue_Is_priority
76 *
77 */
78 
79#define _CORE_message_queue_Is_priority( _the_attribute ) \
80  ((_the_attribute)->discipline == CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY)
81
82/*PAGE
83 *
84 *  _CORE_message_queue_Get_pending_message
85 *
86 */
87
88#define _CORE_message_queue_Get_pending_message( _the_message_queue ) \
89   (CORE_message_queue_Buffer_control *) \
90     _Chain_Get_unprotected( &(_the_message_queue)->Pending_messages )
91
92/*PAGE
93 *
94 *  _CORE_message_queue_Append
95 *
96 */
97
98#define _CORE_message_queue_Append( _the_message_queue, _the_message ) \
99   _Chain_Append( &(_the_message_queue)->Pending_messages, \
100                  &(_the_message)->Node )
101
102/*PAGE
103 *
104 *  _CORE_message_queue_Prepend
105 *
106 */
107
108#define _CORE_message_queue_Prepend( _the_message_queue, _the_message ) \
109   _Chain_Prepend( &(_the_message_queue)->Pending_messages, \
110                   &(_the_message)->Node )
111
112/*PAGE
113 *
114 *  _CORE_message_queue_Is_null
115 *
116 */
117
118#define _CORE_message_queue_Is_null( _the_message_queue ) \
119   ( (_the_message_queue) == NULL  )
120
121/*PAGE
122 *
123 *  _CORE_message_queue_Is_notify_enabled
124 *
125 */
126 
127#define _CORE_message_queue_Is_notify_enabled( _the_message_queue ) \
128  ( (_the_message_queue)->notify_handler != NULL )
129 
130/*PAGE
131 *
132 *  _CORE_message_queue_Set_notify
133 *
134 */
135 
136#define _CORE_message_queue_Set_notify( \
137  _the_message_queue, _the_handler, _the_argument ) \
138    do { \
139      (_the_message_queue)->notify_handler  = (_the_handler); \
140      (_the_message_queue)->notify_argument = (_the_argument); \
141    } while ( 0 )
142
143#endif
144/* end of include file */
Note: See TracBrowser for help on using the repository browser.