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_FIXED_MEMORY_POOL_inl_ |
---|
10 | #define __ITRON_FIXED_MEMORY_POOL_inl_ |
---|
11 | |
---|
12 | #ifdef __cplusplus |
---|
13 | extern "C" { |
---|
14 | #endif |
---|
15 | |
---|
16 | /* |
---|
17 | * _ITRON_Fixed_memory_pool_Allocate |
---|
18 | * |
---|
19 | * DESCRIPTION: |
---|
20 | * |
---|
21 | * This routine allocates the fixed_memory_pool associated with the specified |
---|
22 | * fixed_memory_pool ID from the pool of inactive fixed_memory_pools. |
---|
23 | * |
---|
24 | * Input parameters: |
---|
25 | * mpfid - id of fixed_memory_pool to allocate |
---|
26 | * status - pointer to status variable |
---|
27 | * |
---|
28 | * Output parameters: |
---|
29 | * returns - pointer to the fixed_memory_pool control block |
---|
30 | * *status - status |
---|
31 | */ |
---|
32 | |
---|
33 | RTEMS_INLINE_ROUTINE ITRON_Fixed_memory_pool_Control |
---|
34 | *_ITRON_Fixed_memory_pool_Allocate( |
---|
35 | ID mpfid |
---|
36 | ) |
---|
37 | { |
---|
38 | return (ITRON_Fixed_memory_pool_Control *)_ITRON_Objects_Allocate_by_index( |
---|
39 | &_ITRON_Fixed_memory_pool_Information, |
---|
40 | mpfid, |
---|
41 | sizeof(ITRON_Fixed_memory_pool_Control) |
---|
42 | ); |
---|
43 | } |
---|
44 | |
---|
45 | /* |
---|
46 | * _ITRON_Fixed_memory_pool_Clarify_allocation_id_error |
---|
47 | * |
---|
48 | * This function is invoked when an object allocation ID error |
---|
49 | * occurs to determine the specific ITRON error code to return. |
---|
50 | */ |
---|
51 | |
---|
52 | #define _ITRON_Fixed_memory_pool_Clarify_allocation_id_error( _id ) \ |
---|
53 | _ITRON_Objects_Clarify_allocation_id_error( \ |
---|
54 | &_ITRON_Fixed_memory_pool_Information, (_id) ) |
---|
55 | |
---|
56 | /* |
---|
57 | * _ITRON_Fixed_memory_pool_Clarify_get_id_error |
---|
58 | * |
---|
59 | * This function is invoked when an object get ID error |
---|
60 | * occurs to determine the specific ITRON error code to return. |
---|
61 | */ |
---|
62 | |
---|
63 | #define _ITRON_Fixed_memory_pool_Clarify_get_id_error( _id ) \ |
---|
64 | _ITRON_Objects_Clarify_get_id_error( \ |
---|
65 | &_ITRON_Fixed_memory_pool_Information, (_id) ) |
---|
66 | |
---|
67 | /* |
---|
68 | * _ITRON_Fixed_memory_pool_Free |
---|
69 | * |
---|
70 | * DESCRIPTION: |
---|
71 | * |
---|
72 | * This routine frees a fixed_memory_pool control block to the |
---|
73 | * inactive chain of free fixed_memory_pool control blocks. |
---|
74 | * |
---|
75 | * Input parameters: |
---|
76 | * the_fixed_memory_pool - pointer to fixed_memory_pool control block |
---|
77 | * |
---|
78 | * Output parameters: NONE |
---|
79 | */ |
---|
80 | |
---|
81 | RTEMS_INLINE_ROUTINE void _ITRON_Fixed_memory_pool_Free ( |
---|
82 | ITRON_Fixed_memory_pool_Control *the_fixed_memory_pool |
---|
83 | ) |
---|
84 | { |
---|
85 | _ITRON_Objects_Free( |
---|
86 | &_ITRON_Fixed_memory_pool_Information, |
---|
87 | &the_fixed_memory_pool->Object |
---|
88 | ); |
---|
89 | } |
---|
90 | |
---|
91 | /*PAGE |
---|
92 | * |
---|
93 | * _ITRON_Fixed_memory_pool_Get |
---|
94 | * |
---|
95 | * DESCRIPTION: |
---|
96 | * |
---|
97 | * This function maps fixed memory pool IDs to control blocks. |
---|
98 | * If ID corresponds to a local fixed memory pool, then it returns |
---|
99 | * the_fixed memory pool control pointer which maps to ID and location |
---|
100 | * is set to OBJECTS_LOCAL. if the fixed memory pool ID is global and |
---|
101 | * resides on a remote node, then location is set to OBJECTS_REMOTE, |
---|
102 | * and the fixed memory pool is undefined. Otherwise, location is set |
---|
103 | * to OBJECTS_ERROR and the fixed memory pool is undefined. |
---|
104 | * |
---|
105 | * Input parameters: |
---|
106 | * id - ITRON fixed 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_Fixed_memory_pool_Control |
---|
114 | *_ITRON_Fixed_memory_pool_Get ( |
---|
115 | ID id, |
---|
116 | Objects_Locations *location |
---|
117 | ) |
---|
118 | { |
---|
119 | return (ITRON_Fixed_memory_pool_Control *) |
---|
120 | _ITRON_Objects_Get( &_ITRON_Fixed_memory_pool_Information, id, location ); |
---|
121 | } |
---|
122 | |
---|
123 | /*PAGE |
---|
124 | * |
---|
125 | * _ITRON_Fixed_memory_pool_Is_null |
---|
126 | * |
---|
127 | * This function returns TRUE if the_fixed_memory_pool is NULL |
---|
128 | * and FALSE otherwise. |
---|
129 | * |
---|
130 | * Input parameters: |
---|
131 | * the_fixed_memory_pool - pointer to fixed_memory_pool control block |
---|
132 | * |
---|
133 | * Output parameters: |
---|
134 | * TRUE - if the_fixed_memory_pool is NULL |
---|
135 | * FALSE - otherwise |
---|
136 | */ |
---|
137 | |
---|
138 | RTEMS_INLINE_ROUTINE boolean _ITRON_Fixed_memory_pool_Is_null ( |
---|
139 | ITRON_Fixed_memory_pool_Control *the_fixed_memory_pool |
---|
140 | ) |
---|
141 | { |
---|
142 | return ( the_fixed_memory_pool == NULL ); |
---|
143 | } |
---|
144 | |
---|
145 | /* |
---|
146 | * XXX insert inline routines here |
---|
147 | */ |
---|
148 | |
---|
149 | #ifdef __cplusplus |
---|
150 | } |
---|
151 | #endif |
---|
152 | |
---|
153 | #endif |
---|
154 | /* end of include file */ |
---|
155 | |
---|