1 | /** |
---|
2 | * @file rtems/rtems/message.inl |
---|
3 | */ |
---|
4 | |
---|
5 | /* |
---|
6 | * This include file contains the static inline implementation of all |
---|
7 | * inlined routines in the Message Manager. |
---|
8 | * |
---|
9 | * COPYRIGHT (c) 1989-1999. |
---|
10 | * On-Line Applications Research Corporation (OAR). |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.com/license/LICENSE. |
---|
15 | * |
---|
16 | * $Id$ |
---|
17 | */ |
---|
18 | |
---|
19 | #ifndef _RTEMS_RTEMS_MESSAGE_INL |
---|
20 | #define _RTEMS_RTEMS_MESSAGE_INL |
---|
21 | |
---|
22 | #include <rtems/score/wkspace.h> |
---|
23 | |
---|
24 | /*PAGE |
---|
25 | * |
---|
26 | * _Message_queue_Is_null |
---|
27 | * |
---|
28 | * DESCRIPTION: |
---|
29 | * |
---|
30 | * This function places the_message at the rear of the outstanding |
---|
31 | * messages on the_message_queue. |
---|
32 | */ |
---|
33 | |
---|
34 | RTEMS_INLINE_ROUTINE boolean _Message_queue_Is_null ( |
---|
35 | Message_queue_Control *the_message_queue |
---|
36 | ) |
---|
37 | { |
---|
38 | return ( the_message_queue == NULL ); |
---|
39 | } |
---|
40 | |
---|
41 | |
---|
42 | /*PAGE |
---|
43 | * |
---|
44 | * _Message_queue_Free |
---|
45 | * |
---|
46 | * DESCRIPTION: |
---|
47 | * |
---|
48 | * This routine deallocates a message queue control block into |
---|
49 | * the inactive chain of free message queue control blocks. |
---|
50 | */ |
---|
51 | |
---|
52 | RTEMS_INLINE_ROUTINE void _Message_queue_Free ( |
---|
53 | Message_queue_Control *the_message_queue |
---|
54 | ) |
---|
55 | { |
---|
56 | _Objects_Free( &_Message_queue_Information, &the_message_queue->Object ); |
---|
57 | } |
---|
58 | |
---|
59 | /*PAGE |
---|
60 | * |
---|
61 | * _Message_queue_Get |
---|
62 | * |
---|
63 | * DESCRIPTION: |
---|
64 | * |
---|
65 | * This function maps message queue IDs to message queue control |
---|
66 | * blocks. If ID corresponds to a local message queue, then it |
---|
67 | * returns the_message_queue control pointer which maps to ID |
---|
68 | * and location is set to OBJECTS_LOCAL. If the message queue ID is |
---|
69 | * global and resides on a remote node, then location is set |
---|
70 | * to OBJECTS_REMOTE, and the_message_queue is undefined. |
---|
71 | * Otherwise, location is set to OBJECTS_ERROR and |
---|
72 | * the_message_queue is undefined. |
---|
73 | */ |
---|
74 | |
---|
75 | RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Get ( |
---|
76 | Objects_Id id, |
---|
77 | Objects_Locations *location |
---|
78 | ) |
---|
79 | { |
---|
80 | return (Message_queue_Control *) |
---|
81 | _Objects_Get( &_Message_queue_Information, id, location ); |
---|
82 | } |
---|
83 | |
---|
84 | #endif |
---|
85 | /* end of include file */ |
---|