FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/gpf/inc/p_mem.h @ 316:79080922d8e4
GPF: FRAME C sources and include files imported from LoCosto source
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Thu, 10 Apr 2014 04:06:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
315:1b4beffc8055 | 316:79080922d8e4 |
---|---|
1 /* | |
2 +------------------------------------------------------------------------------ | |
3 | File: mem.h | |
4 +------------------------------------------------------------------------------ | |
5 | Copyright Condat AG 1999-2000, Berlin | |
6 | All rights reserved. | |
7 | | |
8 | This file is confidential and a trade secret of Condat AG. | |
9 | The receipt of or possession of this file does not convey | |
10 | any rights to reproduce or disclose its contents or to | |
11 | manufacture, use, or sell anything it may describe, in | |
12 | whole, or in part, without the specific written consent of | |
13 | Condat AG. | |
14 +------------------------------------------------------------------------------ | |
15 | Purpose: Definitions for the entity MEM. | |
16 | $Identity:$ | |
17 +------------------------------------------------------------------------------ | |
18 */ | |
19 | |
20 #ifndef MEM_H | |
21 #define MEM_H | |
22 | |
23 /*==== INCLUDES ==============================================================*/ | |
24 | |
25 #include "typedefs.h" | |
26 #include "vsi.h" | |
27 #include "pei.h" | |
28 #include "tools.h" | |
29 | |
30 /*==== GENERATED CONTENT ======================================================*/ | |
31 | |
32 /* | |
33 +--------------------------------------------------------------------------+ | |
34 | PROJECT : PROTOCOL STACK | | |
35 | FILE : p_8010_112_mem_sap.val | | |
36 | SOURCE : "s:\g23m\condat\ms\DFILE\PRIM\8010_112_mem_sap.pdf" | | |
37 | LastModified : "12 February, 2003 by Gert Z. Srensen (GSO)" | | |
38 | IdAndVersion : "8010.112.02.002" | | |
39 | SrcFileTime : "Wed Nov 26 14:28:02 2003" | | |
40 | Generated by CCDGEN_2.4.11 on Tue Sep 21 10:40:12 2004 | | |
41 | !!DO NOT MODIFY!!DO NOT MODIFY!!DO NOT MODIFY!! | | |
42 +--------------------------------------------------------------------------+ | |
43 */ | |
44 | |
45 /* PRAGMAS | |
46 * PREFIX : MEM | |
47 * COMPATIBILITY_DEFINES : NO | |
48 * ALWAYS_ENUM_IN_VAL_FILE: YES | |
49 * ENABLE_GROUP: NO | |
50 * CAPITALIZE_TYPENAME: NO | |
51 */ | |
52 | |
53 | |
54 #ifndef P_8010_112_MEM_SAP_VAL | |
55 #define P_8010_112_MEM_SAP_VAL | |
56 | |
57 | |
58 #define CDG_ENTER__P_8010_112_MEM_SAP_VAL | |
59 | |
60 #define CDG_ENTER__FILENAME _P_8010_112_MEM_SAP_VAL | |
61 #define CDG_ENTER__P_8010_112_MEM_SAP_VAL__FILE_TYPE CDGINC | |
62 #define CDG_ENTER__P_8010_112_MEM_SAP_VAL__LAST_MODIFIED _12_February_2003_by_Gert_Z_Srensen_GSO | |
63 #define CDG_ENTER__P_8010_112_MEM_SAP_VAL__ID_AND_VERSION _8010_112_02_002 | |
64 | |
65 #define CDG_ENTER__P_8010_112_MEM_SAP_VAL__SRC_FILE_TIME _Wed_Nov_26_14_28_02_2003 | |
66 | |
67 #include "CDG_ENTER.h" | |
68 | |
69 #undef CDG_ENTER__P_8010_112_MEM_SAP_VAL | |
70 | |
71 #undef CDG_ENTER__FILENAME | |
72 | |
73 | |
74 /* | |
75 * user defined constants | |
76 */ | |
77 #define MEM_MAX_NUMBER_OF_BUFFERS (0x40) | |
78 #define MEM_MAX_NUMBER_OF_USERS (0x40) | |
79 #define MEM_UNORDERED_BUFFER (0x0) | |
80 #define MEM_FIFO_BUFFER (0x1) | |
81 #define MEM_MAX_RAB_ID (0x10) | |
82 #define MEM_MAX_MEMORY_POOL_SIZE (0xffffff) | |
83 #define MEM_INVALID_USER_HANDLE (0x0) | |
84 #define MEM_INVALID_BUFFER_HANDLE (0x0) | |
85 #define MEM_RLC_UL_AM_MODE (0x0) | |
86 #define MEM_RLC_UL_UM_MODE (0x1) | |
87 #define MEM_RLC_UL_TM_MODE (0x2) | |
88 #define MEM_INVALID_MEMORY_HANDLE (0x0) | |
89 | |
90 #include "CDG_LEAVE.h" | |
91 | |
92 #endif | |
93 | |
94 | |
95 /* | |
96 +--------------------------------------------------------------------------+ | |
97 | PROJECT : PROTOCOL STACK | | |
98 | FILE : p_8010_112_mem_sap.h | | |
99 | SOURCE : "s:\g23m\condat\ms\DFILE\PRIM\8010_112_mem_sap.pdf" | | |
100 | LastModified : "12 February, 2003 by Gert Z. Srensen (GSO)" | | |
101 | IdAndVersion : "8010.112.02.002" | | |
102 | SrcFileTime : "Wed Nov 26 14:28:02 2003" | | |
103 | Generated by CCDGEN_2.4.11 on Tue Sep 21 10:40:12 2004 | | |
104 | !!DO NOT MODIFY!!DO NOT MODIFY!!DO NOT MODIFY!! | | |
105 +--------------------------------------------------------------------------+ | |
106 */ | |
107 | |
108 /* PRAGMAS | |
109 * PREFIX : MEM | |
110 * COMPATIBILITY_DEFINES : NO | |
111 * ALWAYS_ENUM_IN_VAL_FILE: YES | |
112 * ENABLE_GROUP: NO | |
113 * CAPITALIZE_TYPENAME: NO | |
114 */ | |
115 | |
116 | |
117 #ifndef P_8010_112_MEM_SAP_H | |
118 #define P_8010_112_MEM_SAP_H | |
119 | |
120 | |
121 #define CDG_ENTER__P_8010_112_MEM_SAP_H | |
122 | |
123 #define CDG_ENTER__FILENAME _P_8010_112_MEM_SAP_H | |
124 #define CDG_ENTER__P_8010_112_MEM_SAP_H__FILE_TYPE CDGINC | |
125 #define CDG_ENTER__P_8010_112_MEM_SAP_H__LAST_MODIFIED _12_February_2003_by_Gert_Z_Srensen_GSO | |
126 #define CDG_ENTER__P_8010_112_MEM_SAP_H__ID_AND_VERSION _8010_112_02_002 | |
127 | |
128 #define CDG_ENTER__P_8010_112_MEM_SAP_H__SRC_FILE_TIME _Wed_Nov_26_14_28_02_2003 | |
129 | |
130 #include "CDG_ENTER.h" | |
131 | |
132 #undef CDG_ENTER__P_8010_112_MEM_SAP_H | |
133 | |
134 #undef CDG_ENTER__FILENAME | |
135 | |
136 | |
137 #ifndef __T_MEM_no_parms__ | |
138 #define __T_MEM_no_parms__ | |
139 /* | |
140 * No parameters. | |
141 * CCDGEN:WriteStruct_Count==14836 | |
142 */ | |
143 typedef struct | |
144 { | |
145 U8 none; /*< 0: 1> No parameters */ | |
146 U8 zzz_align0; /*< 1: 1> alignment */ | |
147 U8 zzz_align1; /*< 2: 1> alignment */ | |
148 U8 zzz_align2; /*< 3: 1> alignment */ | |
149 } T_MEM_no_parms; | |
150 #endif | |
151 | |
152 #ifndef __T_MEM_uplink_buffer_users_info__ | |
153 #define __T_MEM_uplink_buffer_users_info__ | |
154 /* | |
155 * No parameters. | |
156 * CCDGEN:WriteStruct_Count==14839 | |
157 */ | |
158 typedef struct | |
159 { | |
160 U8 rab_id; /*< 0: 1> Radio access identifier */ | |
161 U8 rlc_mode; /*< 1: 1> RLC Mode */ | |
162 U8 zzz_align0; /*< 2: 1> alignment */ | |
163 U8 zzz_align1; /*< 3: 1> alignment */ | |
164 U32 bits_per_tti; /*< 4: 4> Bits per TTI */ | |
165 U16 rlc_tx_window_size; /*< 8: 2> RLC window size */ | |
166 U8 zzz_align2; /*< 10: 1> alignment */ | |
167 U8 zzz_align3; /*< 11: 1> alignment */ | |
168 } T_MEM_uplink_buffer_users_info; | |
169 #endif | |
170 | |
171 | |
172 /* | |
173 * End of substructure section, begin of primitive definition section | |
174 */ | |
175 | |
176 #ifndef __T_MEM_READY_IND__ | |
177 #define __T_MEM_READY_IND__ | |
178 /* | |
179 * | |
180 * CCDGEN:WriteStruct_Count==14842 | |
181 */ | |
182 typedef struct | |
183 { | |
184 U8 user_handle; /*< 0: 1> User Handle */ | |
185 U8 user_parameter; /*< 1: 1> User parameter */ | |
186 U8 zzz_align0; /*< 2: 1> alignment */ | |
187 U8 zzz_align1; /*< 3: 1> alignment */ | |
188 } T_MEM_READY_IND; | |
189 #endif | |
190 | |
191 #ifndef __T_MEM_BUFFER__ | |
192 #define __T_MEM_BUFFER__ | |
193 /* | |
194 * | |
195 * CCDGEN:WriteStruct_Count==14845 | |
196 */ | |
197 typedef struct | |
198 { | |
199 U32 memory_pool_size; /*< 0: 4> Memory pool size */ | |
200 U32 allocated; /*< 4: 4> Parameter */ | |
201 U8 ordering; /*< 8: 1> Ordering */ | |
202 U8 delete_pending; /*< 9: 1> Parameter */ | |
203 U8 zzz_align0; /*< 10: 1> alignment */ | |
204 U8 zzz_align1; /*< 11: 1> alignment */ | |
205 U32 max_allocated; /*< 12: 4> Parameter */ | |
206 U32 fifo_read_index; /*< 16: 4> Parameter */ | |
207 U32 fifo_write_index; /*< 20: 4> Parameter */ | |
208 } T_MEM_BUFFER; | |
209 #endif | |
210 | |
211 | |
212 #include "CDG_LEAVE.h" | |
213 | |
214 | |
215 #endif | |
216 | |
217 | |
218 /*==== CONSTS ================================================================*/ | |
219 | |
220 #define MEM_READY_IND (0x8000408b) | |
221 #define MEM_BUFFER (0x8001408b) | |
222 | |
223 | |
224 #ifdef ENTITY_MEM | |
225 | |
226 #define VSI_CALLER mem_handle, | |
227 #define VSI_CALLER_SINGLE mem_handle | |
228 | |
229 #endif | |
230 | |
231 #define MEM_STATISTICS | |
232 | |
233 #define MAX_UPLINK_USERS 11 /* Maximum number of uplink buffer users. Corresponds */ | |
234 /* maxim number of available rab identifiers */ | |
235 #define MAX_RAB_ID 16 /* Maximum RAB identifier. Used in array declarations. 15+1 */ | |
236 #define RAB_TRANSMIT_BUFFER_SIZE_BYTES 500000 /* Uplink buffer size */ | |
237 #define MAX_SDU_SIZE 1520 | |
238 | |
239 | |
240 /*==== TYPES =================================================================*/ | |
241 | |
242 typedef struct | |
243 { | |
244 T_HANDLE comm_handle; /* Communication handle to user */ | |
245 U8 user_parameter; /* User defined parameter */ | |
246 U8 buffer_id; /* Id of buffer used by this user */ | |
247 | |
248 U32 low; /* Flow control low */ | |
249 U32 high; /* Flow control high */ | |
250 U32 max; /* Flow control max */ | |
251 U32 allocated; /* Allocated number of octets */ | |
252 | |
253 #ifdef MEM_STATISTICS | |
254 U32 max_allocated; /* Max number of octets allocated by user */ | |
255 #endif /* STATISTICS */ | |
256 | |
257 U16 space_before; /* Extra space to allocate before user data */ | |
258 U8 space_after; /* Extra space to allocate after user data */ | |
259 U8 ready; /* TRUE if ready to receive data from this user */ | |
260 U8 delete_pending; /* TRUE if user is to be deleted when all freed */ | |
261 | |
262 } T_MEM_USER; | |
263 | |
264 | |
265 typedef struct | |
266 { | |
267 U8* (*get_user_data) (U32 memory_handle, U16 *ptr_length); | |
268 U8 (*create_user) (U8 buffer_handle, U8 user_parameter, char *task_name); | |
269 U8 (*create_buffer) (U8 ordering, U32 memory_pool_size); | |
270 U8* (*alloc) (U8 user_handle, U16 length, U32 *ptr_handle); | |
271 void (*dealloc) (U32 memory_handle); | |
272 void (*delete_user) (U8 user_handle); | |
273 void (*delete_buffer) (U8 buffer_handle); | |
274 } T_MEM_PROPERTIES; | |
275 | |
276 /*==== EXPORTS ===============================================================*/ | |
277 | |
278 #ifdef MEM_PEI_C | |
279 | |
280 /* Task handle for MEM */ | |
281 T_HANDLE mem_handle; | |
282 | |
283 /* Semaphore used to guarantee exclusive access at critical points */ | |
284 T_HANDLE mem_semaphore_handle; | |
285 | |
286 /*T_MEM_BUFFER *mem_buffer[MEM_MAX_NUMBER_OF_BUFFERS];*/ | |
287 T_MEM_USER *mem_user[MEM_MAX_NUMBER_OF_USERS]; | |
288 | |
289 #else /* MEM_PEI_C */ | |
290 | |
291 extern T_HANDLE mem_handle; | |
292 extern T_HANDLE mem_semaphore_handle; | |
293 extern T_MEM_BUFFER *mem_buffer[MEM_MAX_NUMBER_OF_BUFFERS]; | |
294 extern T_MEM_USER *mem_user[MEM_MAX_NUMBER_OF_USERS]; | |
295 | |
296 #endif /* MEM_PEI_C */ | |
297 | |
298 extern U8 mem_create_buffer(U8 ordering, U32 memory_pool_size); | |
299 extern void mem_delete_buffer(U8 buffer_handle); | |
300 extern U8 mem_create_user(U8 buffer_handle, U8 user_parameter, char *task_name); | |
301 extern void mem_init(void); | |
302 extern void mem_delete_user(U8 user_handle); | |
303 extern U8 mem_create_uplink_user(char* task_name, U8 mem_rab_id); | |
304 extern void mem_delete_uplink_user(U8 user_handle); | |
305 extern void mem_adjust_uplink_users_flow_control(T_MEM_uplink_buffer_users_info *users_info[MEM_MAX_RAB_ID]); | |
306 extern void mem_configure_flow_control(U8 user_handle, U32 low, U32 high, U32 max); | |
307 extern void mem_configure_extra_space(U8 user_handle, U16 space_before, U8 space_after); | |
308 extern BOOL mem_ready(U8 user_handle); | |
309 extern U8 *mem_alloc(U8 user_handle, U16 length, U32 *ptr_handle); | |
310 extern void mem_dealloc(U32 memory_handle); | |
311 extern void mem_realloc(U32 memory_handle, U16 length); | |
312 extern U8 *mem_get_user_data(U32 memory_handle, U16 *ptr_length); | |
313 extern U16 mem_get_space_before(U32 memory_handle); | |
314 extern U8 mem_get_space_after(U32 memory_handle); | |
315 extern U8 *mem_decrease_space_before(U32 memory_handle, U16 delta_space_before, U16 *ptr_length); | |
316 extern void mem_increase_space_before(U32 memory_handle, U16 delta_space_before); | |
317 extern void mem_decrease_space_after(U32 memory_handle, U8 delta_space_after); | |
318 extern void mem_increase_space_after(U32 memory_handle, U8 delta_space_after); | |
319 extern void mem_send_ready_ind(T_HANDLE com_handle, U8 user_handle, U8 user_paramaeter); | |
320 | |
321 #endif /* MEM_H */ |