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