source: rtems/c/src/exec/rtems/inline/message.inl @ b3ac6a8d

4.104.114.84.95
Last change on this file since b3ac6a8d was 3a4ae6c, checked in by Joel Sherrill <joel.sherrill@…>, on 09/11/95 at 19:35:39

The word "RTEMS" almost completely removed from the core.

Configuration Table Template file added and all tests
modified to use this. All gvar.h and conftbl.h files
removed from test directories.

Configuration parameter maximum_devices added.

Core semaphore and mutex handlers added and RTEMS API Semaphore
Manager updated to reflect this.

Initialization sequence changed to invoke API specific initialization
routines. Initialization tasks table now owned by RTEMS Tasks Manager.

Added user extension for post-switch.

Utilized user extensions to implement API specific functionality
like signal dispatching.

Added extensions to the System Initialization Thread so that an
API can register a function to be invoked while the system
is being initialized. These are largely equivalent to the
pre-driver and post-driver hooks.

Added the Modules file oar-go32_p5, modified oar-go32, and modified
the file make/custom/go32.cfg to look at an environment varable which
determines what CPU model is being used.

All BSPs updated to reflect named devices and clock driver's IOCTL
used by the Shared Memory Driver. Also merged clock isr into
main file and removed ckisr.c where possible.

Updated spsize to reflect new and moved variables.

Makefiles for the executive source and include files updated to show
break down of files into Core, RTEMS API, and Neither.

Header and inline files installed into subdirectory based on whether
logically in the Core or a part of the RTEMS API.

  • Property mode set to 100644
File size: 3.0 KB
Line 
1/*  message.inl
2 *
3 *  This include file contains the static inline 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#include <rtems/core/wkspace.h>
21
22/*PAGE
23 *
24 *  _Message_queue_Copy_buffer
25 *
26 */
27
28STATIC INLINE void _Message_queue_Copy_buffer (
29  void      *source,
30  void      *destination,
31  unsigned32 size
32)
33{
34  memcpy(destination, source, size);
35}
36
37/*PAGE
38 *
39 *  _Message_queue_Allocate_message_buffer
40 *
41 */
42
43STATIC INLINE Message_queue_Buffer_control *
44_Message_queue_Allocate_message_buffer (
45    Message_queue_Control *the_message_queue
46)
47{
48   return (Message_queue_Buffer_control *)
49     _Chain_Get( &the_message_queue->Inactive_messages );
50}
51
52/*PAGE
53 *
54 *  _Message_queue_Free_message_buffer
55 *
56 */
57
58STATIC INLINE void _Message_queue_Free_message_buffer (
59    Message_queue_Control        *the_message_queue,
60    Message_queue_Buffer_control *the_message
61)
62{
63  _Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node );
64}
65
66/*PAGE
67 *
68 *  _Message_queue_Get_pending_message
69 *
70 */
71
72STATIC INLINE
73  Message_queue_Buffer_control *_Message_queue_Get_pending_message (
74  Message_queue_Control *the_message_queue
75)
76{
77  return (Message_queue_Buffer_control *)
78    _Chain_Get_unprotected( &the_message_queue->Pending_messages );
79}
80
81/*PAGE
82 *
83 *  _Message_queue_Append
84 *
85 */
86
87STATIC INLINE void _Message_queue_Append (
88  Message_queue_Control        *the_message_queue,
89  Message_queue_Buffer_control *the_message
90)
91{
92  _Chain_Append( &the_message_queue->Pending_messages, &the_message->Node );
93}
94
95/*PAGE
96 *
97 *  _Message_queue_Prepend
98 *
99 */
100
101STATIC INLINE void _Message_queue_Prepend (
102  Message_queue_Control        *the_message_queue,
103  Message_queue_Buffer_control *the_message
104)
105{
106  _Chain_Prepend(
107    &the_message_queue->Pending_messages,
108    &the_message->Node
109  );
110}
111
112/*PAGE
113 *
114 *  _Message_queue_Is_null
115 *
116 */
117
118STATIC INLINE boolean _Message_queue_Is_null (
119  Message_queue_Control *the_message_queue
120)
121{
122  return ( the_message_queue == NULL  );
123}
124
125
126/*PAGE
127 *
128 *  _Message_queue_Free
129 *
130 */
131
132STATIC INLINE void _Message_queue_Free (
133  Message_queue_Control *the_message_queue
134)
135{
136  if (the_message_queue->message_buffers) {
137    _Workspace_Free((void *) the_message_queue->message_buffers);
138    the_message_queue->message_buffers = 0;
139  }
140 
141  _Objects_Free( &_Message_queue_Information, &the_message_queue->Object );
142}
143
144/*PAGE
145 *
146 *  _Message_queue_Get
147 *
148 */
149
150STATIC INLINE Message_queue_Control *_Message_queue_Get (
151  Objects_Id         id,
152  Objects_Locations *location
153)
154{
155  return (Message_queue_Control *)
156     _Objects_Get( &_Message_queue_Information, id, location );
157}
158
159#endif
160/* end of include file */
Note: See TracBrowser for help on using the repository browser.