DSMCC  17.9.0
 All Data Structures Files Functions Typedefs
clDsmUtils.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2004 Ocean Blue Software Ltd
4  * Copyright © 2001 Koninklijke Philips Electronics N.V
5  *
6  * This file is part of a DTVKit Software Component
7  * You are permitted to copy, modify or distribute this file subject to the terms
8  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
9  *
10  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
11  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
12  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
13  *
14  * If you or your organisation is not a member of DTVKit then you have access
15  * to this source code outside of the terms of the licence agreement
16  * and you are expected to delete this and any associated files immediately.
17  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
18  *******************************************************************************/
25 #ifndef _CLDSMUTILS_H_
26 #define _CLDSMUTILS_H_
27 
28 
29 /*-------------------------------- Includes --------------------------------*/
30 
31 #include "clDsmSystem.h"
32 
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 
39 /*----------------------------- Exported Macros ----------------------------*/
40 
41 /*
42 -- These macro definitions provide three 'priority' levels (0, 1, 2) of error
43 -- checking on 8/16/32bit values stored in contiguous memory OR managed memory.
44 -- The highest priority (0) is always performed and cannot be disabled, the
45 -- lower two priorities can be optionally disabled for retail mode (at compile
46 -- time).
47 --
48 -- The lower priority levels (2 or 1 & 2) can be enabled/disabled for retail
49 -- builds (via DSM_DATA_CHECK_LEVEL).
50 --
51 -- Both lower levels (1 & 2) of checking are always enabled in debug mode
52 --
53 -- Syntax is:
54 -- <action>_UINT<sz>_L<lvl>CHK( pData, var<sz>, condn, dbgErrActn, relErrActn )
55 --
56 -- <action> = READ - Always reads value + advances read ptr
57 -- <action> = GET - Always reads value only
58 -- <action> = ADV - If checking level enabled (or debug mode)
59 -- reads value + advances read ptr
60 -- else
61 -- advances read ptr only
62 -- <sz> = 8, 16, 32
63 -- <lvl> = 1 - Level 1 priority checking only
64 -- <lvl> = 2 - Level 1 and level 2 checking
65 --
66 -- var<sz> = 'temporary' variable to receive UINT<sz>
67 -- *** NB. Must be of the correct type ***
68 -- *** Is not used/assigned if <action> = ADV_ & checking disabled ***
69 --
70 -- pData = pointer/reference to MSByte of UINT<size> in memory
71 --
72 -- condn = valid condition to be checked for error (eg. var8 >= 4 )
73 --
74 -- dbgErrActn = command(s) to execute on error condition in debug builds
75 -- relErrActn = command(s) to execute on error condition in all builds
76 -- *** NB. dbgErrAction always executed before relErrAction ***
77 --
78 */
79 #if !defined(DSM_DATA_CHECK_LEVEL)
80  #define DSM_DATA_CHECK_LEVEL 1
81 #endif
82 
83 
84 /* -- Level 0 data checking always performed */
85 /* -- No advance only macros at level 0 since data always read and checked */
86 
87 #if (defined(NDEBUG) || defined(DSM_PROFILING_BUILD))
88 
89  #define READ_UINT8_L0CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
90  READ_UINT8( pData, var8 ); \
91  if (!(condn)) { relErrActn; }
92 
93  #define READ_UINT16_L0CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
94  READ_UINT16( pData, var16 ); \
95  if (!(condn)) { relErrActn; }
96 
97  #define READ_UINT32_L0CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
98  READ_UINT32( pData, var32 ); \
99  if (!(condn)) { relErrActn; }
100 
101 
102  #define GET_UINT8_L0CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
103  GET_UINT8( pData, var8 ); \
104  if (!(condn)) { relErrActn; }
105 
106  #define GET_UINT16_L0CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
107  GET_UINT16( pData, var16 ); \
108  if (!(condn)) { relErrActn; }
109 
110  #define GET_UINT32_L0CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
111  GET_UINT32( pData, var32 ); \
112  if (!(condn)) { relErrActn; }
113 
114 #else
115 /* -- Debug build */
116 
117  #define READ_UINT8_L0CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
118  READ_UINT8( pData, var8 ); \
119  if (!(condn)) { dbgErrActn; relErrActn; }
120 
121  #define READ_UINT16_L0CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
122  READ_UINT16( pData, var16 ); \
123  if (!(condn)) { dbgErrActn; relErrActn; }
124 
125  #define READ_UINT32_L0CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
126  READ_UINT32( pData, var32 ); \
127  if (!(condn)) { dbgErrActn; relErrActn; }
128 
129 
130  #define GET_UINT8_L0CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
131  GET_UINT8( pData, var8 ); \
132  if (!(condn)) { dbgErrActn; relErrActn; }
133 
134  #define GET_UINT16_L0CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
135  GET_UINT16( pData, var16 ); \
136  if (!(condn)) { dbgErrActn; relErrActn; }
137 
138  #define GET_UINT32_L0CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
139  GET_UINT32( pData, var32 ); \
140  if (!(condn)) { dbgErrActn; relErrActn; }
141 
142 #endif
143 
144 
145 /* -- Level 1 data checking is optional */
146 
147 #if DSM_DATA_CHECK_LEVEL >= 1
148 
149 /* -- Level 1 data checking in all builds (default) */
150 
151  #if (defined(NDEBUG) || defined(DSM_PROFILING_BUILD))
152 
153  #define READ_UINT8_L1CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
154  READ_UINT8( pData, var8 ); \
155  if (!(condn)) { relErrActn; }
156 
157  #define READ_UINT16_L1CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
158  READ_UINT16( pData, var16 ); \
159  if (!(condn)) { relErrActn; }
160 
161  #define READ_UINT32_L1CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
162  READ_UINT32( pData, var32 ); \
163  if (!(condn)) { relErrActn; }
164 
165  #define ADV_UINT8_L1CHK READ_UINT8_L1CHK
166  #define ADV_UINT16_L1CHK READ_UINT16_L1CHK
167  #define ADV_UINT32_L1CHK READ_UINT32_L1CHK
168 
169  #define GET_UINT8_L1CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
170  GET_UINT8( pData, var8 ); \
171  if (!(condn)) { relErrActn; }
172 
173  #define GET_UINT16_L1CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
174  GET_UINT16( pData, var16 ); \
175  if (!(condn)) { relErrActn; }
176 
177  #define GET_UINT32_L1CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
178  GET_UINT32( pData, var32 ); \
179  if (!(condn)) { relErrActn; }
180 
181  #else
182 /* -- Debug build */
183 
184  #define READ_UINT8_L1CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
185  READ_UINT8( pData, var8 ); \
186  if (!(condn)) { dbgErrActn; relErrActn; }
187 
188  #define READ_UINT16_L1CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
189  READ_UINT16( pData, var16 ); \
190  if (!(condn)) { dbgErrActn; relErrActn; }
191 
192  #define READ_UINT32_L1CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
193  READ_UINT32( pData, var32 ); \
194  if (!(condn)) { dbgErrActn; relErrActn; }
195 
196  #define ADV_UINT8_L1CHK READ_UINT8_L1CHK
197  #define ADV_UINT16_L1CHK READ_UINT16_L1CHK
198  #define ADV_UINT32_L1CHK READ_UINT32_L1CHK
199 
200  #define GET_UINT8_L1CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
201  GET_UINT8( pData, var8 ); \
202  if (!(condn)) { dbgErrActn; relErrActn; }
203 
204  #define GET_UINT16_L1CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
205  GET_UINT16( pData, var16 ); \
206  if (!(condn)) { dbgErrActn; relErrActn; }
207 
208  #define GET_UINT32_L1CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
209  GET_UINT32( pData, var32 ); \
210  if (!(condn)) { dbgErrActn; relErrActn; }
211 
212  #endif
213 
214 #else
215 
216 /* -- Level 1 data checking in debug builds only */
217 
218  #if (defined(NDEBUG) || defined(DSM_PROFILING_BUILD))
219 
220  #define READ_UINT8_L1CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
221  READ_UINT8( pData, var8 )
222 
223  #define READ_UINT16_L1CHK( pData, var16, condn, dbgErrActn, relErrActn) \
224  READ_UINT16( pData, var16 )
225 
226  #define READ_UINT32_L1CHK( pData, var32, condn, dbgErrActn, relErrActn) \
227  READ_UINT32( pData, var32 )
228 
229  #define ADV_UINT8_L1CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
230  SET_POS_REL( pData, 1 )
231 
232  #define ADV_UINT16_L1CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
233  SET_POS_REL( pData, 2 )
234 
235  #define ADV_UINT32_L1CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
236  SET_POS_REL( pData, 4 )
237 
238  #define GET_UINT8_L1CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
239  GET_UINT8( pData, var8 )
240 
241  #define GET_UINT16_L1CHK( pData, var16, condn, dbgErrActn, relErrActn) \
242  GET_UINT16( pData, var16 )
243 
244  #define GET_UINT32_L1CHK( pData, var32, condn, dbgErrActn, relErrActn) \
245  GET_UINT32( pData, var32 )
246 
247  #else
248 /* -- Debug Build */
249 
250  #define READ_UINT8_L1CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
251  READ_UINT8( pData, var8 ); \
252  if (!(condn)) { dbgErrActn; }
253 
254  #define READ_UINT16_L1CHK( pData, var16, condn, dbgErrActn, relErrActn) \
255  READ_UINT16( pData, var16 ); \
256  if (!(condn)) { dbgErrActn; }
257 
258  #define READ_UINT32_L1CHK( pData, var32, condn, dbgErrActn, relErrActn) \
259  READ_UINT32( pData, var32 ); \
260  if (!(condn)) { dbgErrActn; }
261 
262  #define ADV_UINT8_L1CHK READ_UINT8_L1CHK
263  #define ADV_UINT16_L1CHK READ_UINT16_L1CHK
264  #define ADV_UINT32_L1CHK READ_UINT32_L1CHK
265 
266  #define GET_UINT8_L1CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
267  GET_UINT8( pData, var8 ); \
268  if (!(condn)) { dbgErrActn; }
269 
270  #define GET_UINT16_L1CHK( pData, var16, condn, dbgErrActn, relErrActn) \
271  GET_UINT16( pData, var16 ); \
272  if (!(condn)) { dbgErrActn; }
273 
274  #define GET_UINT32_L1CHK( pData, var32, condn, dbgErrActn, relErrActn) \
275  GET_UINT32( pData, var32 ); \
276  if (!(condn)) { dbgErrActn; }
277 
278  #endif
279 #endif
280 
281 
282 /* -- Level 2 data checking is optional */
283 
284 #if DSM_DATA_CHECK_LEVEL >= 2
285 
286 /* -- Level 2 data checking in all builds */
287 
288  #if (defined(NDEBUG) || defined(DSM_PROFILING_BUILD))
289 
290  #define READ_UINT8_L2CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
291  READ_UINT8( pData, var8 ); \
292  if (!(condn)) { relErrActn; }
293 
294  #define READ_UINT16_L2CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
295  READ_UINT16( pData, var16 ); \
296  if (!(condn)) { relErrActn; }
297 
298  #define READ_UINT32_L2CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
299  READ_UINT32( pData, var32 ); \
300  if (!(condn)) { relErrActn; }
301 
302  #define ADV_UINT8_L2CHK READ_UINT8_L2CHK
303  #define ADV_UINT16_L2CHK READ_UINT16_L2CHK
304  #define ADV_UINT32_L2CHK READ_UINT32_L2CHK
305 
306  #define GET_UINT8_L2CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
307  GET_UINT8( pData, var8 ); \
308  if (!(condn)) { relErrActn; }
309 
310  #define GET_UINT16_L2CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
311  GET_UINT16( pData, var16 ); \
312  if (!(condn)) { relErrActn; }
313 
314  #define GET_UINT32_L2CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
315  GET_UINT32( pData, var32 ); \
316  if (!(condn)) { relErrActn; }
317 
318  #else
319 /* -- Debug build */
320 
321  #define READ_UINT8_L2CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
322  READ_UINT8( pData, var8 ); \
323  if (!(condn)) { dbgErrActn; relErrActn; }
324 
325  #define READ_UINT16_L2CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
326  READ_UINT16( pData, var16 ); \
327  if (!(condn)) { dbgErrActn; relErrActn; }
328 
329  #define READ_UINT32_L2CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
330  READ_UINT32( pData, var32 ); \
331  if (!(condn)) { dbgErrActn; relErrActn; }
332 
333  #define ADV_UINT8_L2CHK READ_UINT8_L2CHK
334  #define ADV_UINT16_L2CHK READ_UINT16_L2CHK
335  #define ADV_UINT32_L2CHK READ_UINT32_L2CHK
336 
337  #define GET_UINT8_L2CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
338  GET_UINT8( pData, var8 ); \
339  if (!(condn)) { dbgErrActn; relErrActn; }
340 
341  #define GET_UINT16_L2CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
342  GET_UINT16( pData, var16 ); \
343  if (!(condn)) { dbgErrActn; relErrActn; }
344 
345  #define GET_UINT32_L2CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
346  GET_UINT32( pData, var32 ); \
347  if (!(condn)) { dbgErrActn; relErrActn; }
348 
349  #endif
350 
351 #else
352 
353 /* -- Level 2 data checking in debug builds only (default) */
354 
355  #if (defined(NDEBUG) || defined(DSM_PROFILING_BUILD))
356 
357  #define READ_UINT8_L2CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
358  READ_UINT8( pData, var8 )
359 
360  #define READ_UINT16_L2CHK( pData, var16, condn, dbgErrActn, relErrActn) \
361  READ_UINT16( pData, var16 )
362 
363  #define READ_UINT32_L2CHK( pData, var32, condn, dbgErrActn, relErrActn) \
364  READ_UINT32( pData, var32 )
365 
366  #define ADV_UINT8_L2CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
367  SET_POS_REL( pData, 1 )
368 
369  #define ADV_UINT16_L2CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
370  SET_POS_REL( pData, 2 )
371 
372  #define ADV_UINT32_L2CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
373  SET_POS_REL( pData, 4 )
374 
375  #define GET_UINT8_L2CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
376  GET_UINT8( pData, var8 )
377 
378  #define GET_UINT16_L2CHK( pData, var16, condn, dbgErrActn, relErrActn) \
379  GET_UINT16( pData, var16 )
380 
381  #define GET_UINT32_L2CHK( pData, var32, condn, dbgErrActn, relErrActn) \
382  GET_UINT32( pData, var32 )
383 
384  #else
385 
386  #define READ_UINT8_L2CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
387  READ_UINT8( pData, var8 ); \
388  if (!(condn)) { dbgErrActn; }
389 
390  #define READ_UINT16_L2CHK( pData, var16, condn, dbgErrActn, relErrActn) \
391  READ_UINT16( pData, var16 ); \
392  if (!(condn)) { dbgErrActn; }
393 
394  #define READ_UINT32_L2CHK( pData, var32, condn, dbgErrActn, relErrActn) \
395  READ_UINT32( pData, var32 ); \
396  if (!(condn)) { dbgErrActn; }
397 
398  #define ADV_UINT8_L2CHK READ_UINT8_L2CHK
399  #define ADV_UINT16_L2CHK READ_UINT16_L2CHK
400  #define ADV_UINT32_L2CHK READ_UINT32_L2CHK
401 
402  #define GET_UINT8_L2CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
403  GET_UINT8( pData, var8 ); \
404  if (!(condn)) { dbgErrActn; }
405 
406  #define GET_UINT16_L2CHK( pData, var16, condn, dbgErrActn, relErrActn) \
407  GET_UINT16( pData, var16 ); \
408  if (!(condn)) { dbgErrActn; }
409 
410  #define GET_UINT32_L2CHK( pData, var32, condn, dbgErrActn, relErrActn) \
411  GET_UINT32( pData, var32 ); \
412  if (!(condn)) { dbgErrActn; }
413 
414  #endif
415 #endif
416 
417 
418 
419 
420 /*
421 -- These macros provide standardised reading of 8/16/32bit values from
422 -- contiguous memory (assuming Big endian data)
423 --
424 -- 'GET' macros 'return' the value and do not change the data pointer
425 --
426 -- 'READ' macros write the value into a parameter and increment the data
427 -- pointer by the data length
428 */
429 
430 /*
431 -- pData type is U8BIT*, opVar type is U8BIT
432 -- On entry - pData->MSByte
433 -- On exit - pData->MSByte
434 */
435 #define GET_UINT8_C( pData, opVar ) opVar = *(pData)
436 
437 
438 /*
439 -- pData type is U8BIT*, opVar type is U16BIT
440 -- On entry - pData->MSByte
441 -- On exit - pData->MSByte
442 */
443 #define GET_UINT16_C( pData, opVar ) \
444  { \
445  U16BIT result; \
446  \
447  result = (U16BIT)*(pData); \
448  opVar = (U16BIT)((result << 8) | *((pData) + 1)); \
449  }
450 
451 
452 /*
453 -- pData type = U8BIT*, opVar type = U16BIT
454 -- On entry - pData->MSByte
455 -- On exit - pData->MSByte
456 */
457 #define GET_UINT32_C( pData, opVar ) \
458  { \
459  U32BIT result; \
460  \
461  result = (U32BIT)*(pData); \
462  result = (U32BIT)((result << 8) | *((pData) + 1)); \
463  result = (U32BIT)((result << 8) | *((pData) + 2)); \
464  opVar = (U32BIT)((result << 8) | *((pData) + 3)); \
465  }
466 
467 
468 /*
469 -- pData type is U8BIT*, opVar type is U8BIT
470 -- On entry - pData->MSByte
471 -- On exit - pData += 1
472 */
473 #define READ_UINT8_C( pData, opVar ) (opVar = *(pData)++)
474 
475 
476 /*
477 -- pData type is U8BIT*, opVar type is U16BIT
478 -- On entry - pData->MSByte
479 -- On exit - pData += 2
480 */
481 #define READ_UINT16_C( pData, opVar ) \
482  { \
483  U16BIT result; \
484  \
485  result = (U16BIT)*(pData)++; \
486  opVar = (U16BIT)((result << 8) | *(pData)++); \
487  }
488 
489 
490 /*
491 -- pData type = U8BIT*, opVar type = U32BIT
492 -- On entry - pData->MSByte
493 -- On exit - pData += 3
494 */
495 #define READ_UINT24_C( pData, opVar ) \
496  { \
497  U32BIT result; \
498  \
499  result = (U32BIT)*(pData)++; \
500  result = (U32BIT)((result << 8) | *(pData)++); \
501  opVar = (U32BIT)((result << 8) | *(pData)++); \
502  }
503 
504 /*
505 -- pData type = U8BIT*, opVar type = U16BIT
506 -- On entry - pData->MSByte
507 -- On exit - pData += 4
508 */
509 #define READ_UINT32_C( pData, opVar ) \
510  { \
511  U32BIT result; \
512  \
513  result = (U32BIT)*(pData)++; \
514  result = (U32BIT)((result << 8) | *(pData)++); \
515  result = (U32BIT)((result << 8) | *(pData)++); \
516  opVar = (U32BIT)((result << 8) | *(pData)++); \
517  }
518 
519 
520 /*
521 -- This macro provides standardised reading of object key values from
522 -- contiguous memory (assuming Big endian data).
523 --
524 -- Uses switch to make it fast (& avoid loop or function call overhead
525 -- of memcpy). Currently only used in two places so code overhead
526 -- not a problem.
527 --
528 -- pData type = U8BIT*, objKey type = S_ObjectKey, valid type = BOOLEAN
529 -- On entry - pData -> objectKeyLength field
530 -- On exit - If valid: pData += objectKeyLength + 1
531 -- Else: pData set back to initial position
532 */
533 #define READ_OBJECT_KEY_C( pData, objKey, valid ) \
534  { \
535  U8BIT objKeyLen; \
536  U8BIT *pResultData = objKey.data; \
537  \
538  objKeyLen = *(pData)++; \
539  \
540  valid = TRUE; \
541  objKey.length = objKeyLen; \
542  \
543  switch (objKeyLen) { \
544  \
545  case 1: \
546  *pResultData = *(pData)++; \
547  break; \
548  \
549  case 2: \
550  *(pResultData)++ = *(pData)++; \
551  *pResultData = *(pData)++; \
552  break; \
553  \
554  case 3: \
555  *(pResultData)++ = *(pData)++; \
556  *(pResultData)++ = *(pData)++; \
557  *pResultData = *(pData)++; \
558  break; \
559  \
560  case 4: \
561  *(pResultData)++ = *(pData)++; \
562  *(pResultData)++ = *(pData)++; \
563  *(pResultData)++ = *(pData)++; \
564  *pResultData = *(pData)++; \
565  break; \
566  \
567  default: \
568  objKey.length = 0; \
569  pData -= 1; \
570  valid = FALSE; \
571  break; \
572  } \
573  }
574 
575 #define OUI_SPECIFIER_TYPE 0x01000000
576 #define OUI_SPECIFIER_MASK 0xFF000000
577 #define OUI_DATA_MASK 0x00FFFFFF
578 
579 /*------------------------------ Exported Types ----------------------------*/
580 
581 typedef struct s_modelVersion
582 {
583  U16BIT model;
584  U16BIT version;
586 
587 typedef struct s_compatibility
588 {
589  U16BIT hw_num;
590  U16BIT sw_num;
591  S_modelVersion *hwlist;
592  S_modelVersion *swlist;
594 
595 /*------------------------------ Exported Data -----------------------------*/
596 
597 
598 /*--------------------------- Exported Prototypes --------------------------*/
599 
600 
601 E_DsmObjectKind convertObjectKindStr( U32BIT objectKindStr );
602 
603 E_DscError handleInLoopError( P_DsmCoreInst idp,
604  E_DscError currErr, E_DscError newErr );
605 
606 void readUInt16Seq( MemSeqRef memAreaRef, U16BIT *pUi16 );
607 
608 void readUInt32Seq( MemSeqRef memAreaRef, U32BIT *pUi32 );
609 
610 void getUInt8Seq( MemSeqRef memAreaRef, U8BIT *pUi8 );
611 
612 void getUInt16Seq( MemSeqRef memAreaRef, U16BIT *pUi16 );
613 
614 void getUInt32Seq( MemSeqRef memAreaRef, U32BIT *pUi32 );
615 
616 void readObjectKeySeq( MemSeqRef memAreaRef, P_ObjectKey pObjectKey,
617  BOOLEAN *pValid );
618 
619 
620 /* -- CONTIGUOUS MEMORY DATA ACCESS FUNCTIONS */
621 
622 #include "defMemUtilsContig.h" /* -- Default mem type for functions */
623 
624 U16BIT getIorInfoContig( const MemPtr mpIorData, U32BIT *pIorTypeId,
625  P_ObjectLocation pLocation, P_DeliveryParaTap pTap );
626 
627 P_Compatibility DSC_UtilParseCompatibilityDesc( P_DsmCoreInst idp,
628  MemPtr pData, U16BIT length, U32BIT specifier );
629 
630 BOOLEAN DSC_UtilCheckCompatibility( U8BIT *pData, U16BIT len,
631  U32BIT specifier, S_SsuModelVersion smv );
632 
633 #ifdef MEM_CONTIGUOUS
634  #define getIorInfoSeq getIorInfoContig
635 #else
636 
637 /* -- MANAGED MEMORY DATA ACCESS FUNCTIONS */
638 
639 #include "defMemUtilsMgd.h" /* -- Default mem type for functions */
640 
641 U16BIT getIorInfoSeq( const MemPtr mpIorData, U32BIT *pIorTypeId,
642  P_ObjectLocation pLocation, P_DeliveryParaTap pTap );
643 
644 #endif
646 /*----------------------------------------------------------------------------*/
647 
648 #ifdef __cplusplus
649 }
650 #endif
651 #endif /* _CLDSMUTILS_H_ */
General include file for clDsm library internal definitions.
Defines memory access utils to work with contiguous memory.
Defines memory access utils to work with managed (MemMgr) memory.