1 | /* |
---|
2 | * COPYRIGHT (c) 1989-1999. |
---|
3 | * On-Line Applications Research Corporation (OAR). |
---|
4 | * |
---|
5 | * The license and distribution terms for this file may be |
---|
6 | * found in the file LICENSE in this distribution or at |
---|
7 | * http://www.OARcorp.com/rtems/license.html. |
---|
8 | * |
---|
9 | * $Id$ |
---|
10 | */ |
---|
11 | |
---|
12 | #ifndef __ITRON_MESSAGE_BUFFER_inl_ |
---|
13 | #define __ITRON_MESSAGE_BUFFER_inl_ |
---|
14 | |
---|
15 | #ifdef __cplusplus |
---|
16 | extern "C" { |
---|
17 | #endif |
---|
18 | |
---|
19 | /* |
---|
20 | * _ITRON_Message_buffer_Allocate |
---|
21 | * |
---|
22 | * DESCRIPTION: |
---|
23 | * |
---|
24 | * This routine allocates the message buffer associated with the specified |
---|
25 | * message buffer ID from the pool of inactive message buffers. |
---|
26 | * |
---|
27 | * Input parameters: |
---|
28 | * mbfid - id of message buffer to allocate |
---|
29 | * status - pointer to status variable |
---|
30 | * |
---|
31 | * Output parameters: |
---|
32 | * returns - pointer to the message buffer control block |
---|
33 | * *status - status |
---|
34 | */ |
---|
35 | |
---|
36 | RTEMS_INLINE_ROUTINE ITRON_Message_buffer_Control |
---|
37 | *_ITRON_Message_buffer_Allocate( |
---|
38 | ID mbfid |
---|
39 | ) |
---|
40 | { |
---|
41 | return (ITRON_Message_buffer_Control *)_ITRON_Objects_Allocate_by_index( |
---|
42 | &_ITRON_Message_buffer_Information, |
---|
43 | mbfid, |
---|
44 | sizeof(ITRON_Message_buffer_Control) |
---|
45 | ); |
---|
46 | } |
---|
47 | |
---|
48 | /* |
---|
49 | * _ITRON_Message_buffer_Clarify_allocation_id_error |
---|
50 | * |
---|
51 | * This function is invoked when an object allocation ID error |
---|
52 | * occurs to determine the specific ITRON error code to return. |
---|
53 | */ |
---|
54 | |
---|
55 | #define _ITRON_Message_buffer_Clarify_allocation_id_error( _id ) \ |
---|
56 | _ITRON_Objects_Clarify_allocation_id_error( \ |
---|
57 | &_ITRON_Message_buffer_Information, (_id) ) |
---|
58 | |
---|
59 | /* |
---|
60 | * _ITRON_Message_buffer_Clarify_get_id_error |
---|
61 | * |
---|
62 | * This function is invoked when an object get ID error |
---|
63 | * occurs to determine the specific ITRON error code to return. |
---|
64 | */ |
---|
65 | |
---|
66 | #define _ITRON_Message_buffer_Clarify_get_id_error( _id ) \ |
---|
67 | _ITRON_Objects_Clarify_get_id_error( &_ITRON_Message_buffer_Information, (_id) ) |
---|
68 | |
---|
69 | /* |
---|
70 | * _ITRON_Message_buffer_Free |
---|
71 | * |
---|
72 | * DESCRIPTION: |
---|
73 | * |
---|
74 | * This routine frees a message buffer control block to the |
---|
75 | * inactive chain of free message buffer control blocks. |
---|
76 | * |
---|
77 | * Input parameters: |
---|
78 | * the_message_buffer - pointer to message_buffer control block |
---|
79 | * |
---|
80 | * Output parameters: NONE |
---|
81 | */ |
---|
82 | |
---|
83 | RTEMS_INLINE_ROUTINE void _ITRON_Message_buffer_Free ( |
---|
84 | ITRON_Message_buffer_Control *the_message_buffer |
---|
85 | ) |
---|
86 | { |
---|
87 | _ITRON_Objects_Free( |
---|
88 | &_ITRON_Message_buffer_Information, |
---|
89 | &the_message_buffer->Object |
---|
90 | ); |
---|
91 | } |
---|
92 | |
---|
93 | /*PAGE |
---|
94 | * |
---|
95 | * _ITRON_Message_buffer_Get |
---|
96 | * |
---|
97 | * DESCRIPTION: |
---|
98 | * |
---|
99 | * This function maps message buffer IDs to message buffer control blocks. |
---|
100 | * If ID corresponds to a local message buffer, then it returns |
---|
101 | * the message buffer control pointer which maps to ID and location |
---|
102 | * is set to OBJECTS_LOCAL. if the message buffer ID is global and |
---|
103 | * resides on a remote node, then location is set to OBJECTS_REMOTE, |
---|
104 | * and the message buffer is undefined. Otherwise, location is set |
---|
105 | * to OBJECTS_ERROR and the message buffer is undefined. |
---|
106 | * |
---|
107 | * Input parameters: |
---|
108 | * id - ITRON message_buffer ID. |
---|
109 | * the_location - pointer to a location variable |
---|
110 | * |
---|
111 | * Output parameters: |
---|
112 | * *the_location - location of the object |
---|
113 | */ |
---|
114 | |
---|
115 | RTEMS_INLINE_ROUTINE ITRON_Message_buffer_Control *_ITRON_Message_buffer_Get ( |
---|
116 | ID id, |
---|
117 | Objects_Locations *location |
---|
118 | ) |
---|
119 | { |
---|
120 | return (ITRON_Message_buffer_Control *) |
---|
121 | _ITRON_Objects_Get( &_ITRON_Message_buffer_Information, id, location ); |
---|
122 | } |
---|
123 | |
---|
124 | /*PAGE |
---|
125 | * |
---|
126 | * _ITRON_Message_buffer_Is_null |
---|
127 | * |
---|
128 | * This function returns TRUE if the_message_buffer is NULL |
---|
129 | * and FALSE otherwise. |
---|
130 | * |
---|
131 | * Input parameters: |
---|
132 | * the_message_buffer - pointer to message buffer control block |
---|
133 | * |
---|
134 | * Output parameters: |
---|
135 | * TRUE - if the_message_buffer is NULL |
---|
136 | * FALSE - otherwise |
---|
137 | */ |
---|
138 | |
---|
139 | RTEMS_INLINE_ROUTINE boolean _ITRON_Message_buffer_Is_null ( |
---|
140 | ITRON_Message_buffer_Control *the_message_buffer |
---|
141 | ) |
---|
142 | { |
---|
143 | return ( the_message_buffer == NULL ); |
---|
144 | } |
---|
145 | |
---|
146 | /* |
---|
147 | * XXX insert inline routines here |
---|
148 | */ |
---|
149 | |
---|
150 | #ifdef __cplusplus |
---|
151 | } |
---|
152 | #endif |
---|
153 | |
---|
154 | #endif |
---|
155 | /* end of include file */ |
---|
156 | |
---|