25 #ifndef _CLDSMUTILS_H_
26 #define _CLDSMUTILS_H_
79 #if !defined(DSM_DATA_CHECK_LEVEL)
80 #define DSM_DATA_CHECK_LEVEL 1
87 #if (defined(NDEBUG) || defined(DSM_PROFILING_BUILD))
89 #define READ_UINT8_L0CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
90 READ_UINT8( pData, var8 ); \
91 if (!(condn)) { relErrActn; }
93 #define READ_UINT16_L0CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
94 READ_UINT16( pData, var16 ); \
95 if (!(condn)) { relErrActn; }
97 #define READ_UINT32_L0CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
98 READ_UINT32( pData, var32 ); \
99 if (!(condn)) { relErrActn; }
102 #define GET_UINT8_L0CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
103 GET_UINT8( pData, var8 ); \
104 if (!(condn)) { relErrActn; }
106 #define GET_UINT16_L0CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
107 GET_UINT16( pData, var16 ); \
108 if (!(condn)) { relErrActn; }
110 #define GET_UINT32_L0CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
111 GET_UINT32( pData, var32 ); \
112 if (!(condn)) { relErrActn; }
117 #define READ_UINT8_L0CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
118 READ_UINT8( pData, var8 ); \
119 if (!(condn)) { dbgErrActn; relErrActn; }
121 #define READ_UINT16_L0CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
122 READ_UINT16( pData, var16 ); \
123 if (!(condn)) { dbgErrActn; relErrActn; }
125 #define READ_UINT32_L0CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
126 READ_UINT32( pData, var32 ); \
127 if (!(condn)) { dbgErrActn; relErrActn; }
130 #define GET_UINT8_L0CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
131 GET_UINT8( pData, var8 ); \
132 if (!(condn)) { dbgErrActn; relErrActn; }
134 #define GET_UINT16_L0CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
135 GET_UINT16( pData, var16 ); \
136 if (!(condn)) { dbgErrActn; relErrActn; }
138 #define GET_UINT32_L0CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
139 GET_UINT32( pData, var32 ); \
140 if (!(condn)) { dbgErrActn; relErrActn; }
147 #if DSM_DATA_CHECK_LEVEL >= 1
151 #if (defined(NDEBUG) || defined(DSM_PROFILING_BUILD))
153 #define READ_UINT8_L1CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
154 READ_UINT8( pData, var8 ); \
155 if (!(condn)) { relErrActn; }
157 #define READ_UINT16_L1CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
158 READ_UINT16( pData, var16 ); \
159 if (!(condn)) { relErrActn; }
161 #define READ_UINT32_L1CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
162 READ_UINT32( pData, var32 ); \
163 if (!(condn)) { relErrActn; }
165 #define ADV_UINT8_L1CHK READ_UINT8_L1CHK
166 #define ADV_UINT16_L1CHK READ_UINT16_L1CHK
167 #define ADV_UINT32_L1CHK READ_UINT32_L1CHK
169 #define GET_UINT8_L1CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
170 GET_UINT8( pData, var8 ); \
171 if (!(condn)) { relErrActn; }
173 #define GET_UINT16_L1CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
174 GET_UINT16( pData, var16 ); \
175 if (!(condn)) { relErrActn; }
177 #define GET_UINT32_L1CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
178 GET_UINT32( pData, var32 ); \
179 if (!(condn)) { relErrActn; }
184 #define READ_UINT8_L1CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
185 READ_UINT8( pData, var8 ); \
186 if (!(condn)) { dbgErrActn; relErrActn; }
188 #define READ_UINT16_L1CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
189 READ_UINT16( pData, var16 ); \
190 if (!(condn)) { dbgErrActn; relErrActn; }
192 #define READ_UINT32_L1CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
193 READ_UINT32( pData, var32 ); \
194 if (!(condn)) { dbgErrActn; relErrActn; }
196 #define ADV_UINT8_L1CHK READ_UINT8_L1CHK
197 #define ADV_UINT16_L1CHK READ_UINT16_L1CHK
198 #define ADV_UINT32_L1CHK READ_UINT32_L1CHK
200 #define GET_UINT8_L1CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
201 GET_UINT8( pData, var8 ); \
202 if (!(condn)) { dbgErrActn; relErrActn; }
204 #define GET_UINT16_L1CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
205 GET_UINT16( pData, var16 ); \
206 if (!(condn)) { dbgErrActn; relErrActn; }
208 #define GET_UINT32_L1CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
209 GET_UINT32( pData, var32 ); \
210 if (!(condn)) { dbgErrActn; relErrActn; }
218 #if (defined(NDEBUG) || defined(DSM_PROFILING_BUILD))
220 #define READ_UINT8_L1CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
221 READ_UINT8( pData, var8 )
223 #define READ_UINT16_L1CHK( pData, var16, condn, dbgErrActn, relErrActn) \
224 READ_UINT16( pData, var16 )
226 #define READ_UINT32_L1CHK( pData, var32, condn, dbgErrActn, relErrActn) \
227 READ_UINT32( pData, var32 )
229 #define ADV_UINT8_L1CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
230 SET_POS_REL( pData, 1 )
232 #define ADV_UINT16_L1CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
233 SET_POS_REL( pData, 2 )
235 #define ADV_UINT32_L1CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
236 SET_POS_REL( pData, 4 )
238 #define GET_UINT8_L1CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
239 GET_UINT8( pData, var8 )
241 #define GET_UINT16_L1CHK( pData, var16, condn, dbgErrActn, relErrActn) \
242 GET_UINT16( pData, var16 )
244 #define GET_UINT32_L1CHK( pData, var32, condn, dbgErrActn, relErrActn) \
245 GET_UINT32( pData, var32 )
250 #define READ_UINT8_L1CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
251 READ_UINT8( pData, var8 ); \
252 if (!(condn)) { dbgErrActn; }
254 #define READ_UINT16_L1CHK( pData, var16, condn, dbgErrActn, relErrActn) \
255 READ_UINT16( pData, var16 ); \
256 if (!(condn)) { dbgErrActn; }
258 #define READ_UINT32_L1CHK( pData, var32, condn, dbgErrActn, relErrActn) \
259 READ_UINT32( pData, var32 ); \
260 if (!(condn)) { dbgErrActn; }
262 #define ADV_UINT8_L1CHK READ_UINT8_L1CHK
263 #define ADV_UINT16_L1CHK READ_UINT16_L1CHK
264 #define ADV_UINT32_L1CHK READ_UINT32_L1CHK
266 #define GET_UINT8_L1CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
267 GET_UINT8( pData, var8 ); \
268 if (!(condn)) { dbgErrActn; }
270 #define GET_UINT16_L1CHK( pData, var16, condn, dbgErrActn, relErrActn) \
271 GET_UINT16( pData, var16 ); \
272 if (!(condn)) { dbgErrActn; }
274 #define GET_UINT32_L1CHK( pData, var32, condn, dbgErrActn, relErrActn) \
275 GET_UINT32( pData, var32 ); \
276 if (!(condn)) { dbgErrActn; }
284 #if DSM_DATA_CHECK_LEVEL >= 2
288 #if (defined(NDEBUG) || defined(DSM_PROFILING_BUILD))
290 #define READ_UINT8_L2CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
291 READ_UINT8( pData, var8 ); \
292 if (!(condn)) { relErrActn; }
294 #define READ_UINT16_L2CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
295 READ_UINT16( pData, var16 ); \
296 if (!(condn)) { relErrActn; }
298 #define READ_UINT32_L2CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
299 READ_UINT32( pData, var32 ); \
300 if (!(condn)) { relErrActn; }
302 #define ADV_UINT8_L2CHK READ_UINT8_L2CHK
303 #define ADV_UINT16_L2CHK READ_UINT16_L2CHK
304 #define ADV_UINT32_L2CHK READ_UINT32_L2CHK
306 #define GET_UINT8_L2CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
307 GET_UINT8( pData, var8 ); \
308 if (!(condn)) { relErrActn; }
310 #define GET_UINT16_L2CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
311 GET_UINT16( pData, var16 ); \
312 if (!(condn)) { relErrActn; }
314 #define GET_UINT32_L2CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
315 GET_UINT32( pData, var32 ); \
316 if (!(condn)) { relErrActn; }
321 #define READ_UINT8_L2CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
322 READ_UINT8( pData, var8 ); \
323 if (!(condn)) { dbgErrActn; relErrActn; }
325 #define READ_UINT16_L2CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
326 READ_UINT16( pData, var16 ); \
327 if (!(condn)) { dbgErrActn; relErrActn; }
329 #define READ_UINT32_L2CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
330 READ_UINT32( pData, var32 ); \
331 if (!(condn)) { dbgErrActn; relErrActn; }
333 #define ADV_UINT8_L2CHK READ_UINT8_L2CHK
334 #define ADV_UINT16_L2CHK READ_UINT16_L2CHK
335 #define ADV_UINT32_L2CHK READ_UINT32_L2CHK
337 #define GET_UINT8_L2CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
338 GET_UINT8( pData, var8 ); \
339 if (!(condn)) { dbgErrActn; relErrActn; }
341 #define GET_UINT16_L2CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
342 GET_UINT16( pData, var16 ); \
343 if (!(condn)) { dbgErrActn; relErrActn; }
345 #define GET_UINT32_L2CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
346 GET_UINT32( pData, var32 ); \
347 if (!(condn)) { dbgErrActn; relErrActn; }
355 #if (defined(NDEBUG) || defined(DSM_PROFILING_BUILD))
357 #define READ_UINT8_L2CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
358 READ_UINT8( pData, var8 )
360 #define READ_UINT16_L2CHK( pData, var16, condn, dbgErrActn, relErrActn) \
361 READ_UINT16( pData, var16 )
363 #define READ_UINT32_L2CHK( pData, var32, condn, dbgErrActn, relErrActn) \
364 READ_UINT32( pData, var32 )
366 #define ADV_UINT8_L2CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
367 SET_POS_REL( pData, 1 )
369 #define ADV_UINT16_L2CHK( pData, var16, condn, dbgErrActn, relErrActn ) \
370 SET_POS_REL( pData, 2 )
372 #define ADV_UINT32_L2CHK( pData, var32, condn, dbgErrActn, relErrActn ) \
373 SET_POS_REL( pData, 4 )
375 #define GET_UINT8_L2CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
376 GET_UINT8( pData, var8 )
378 #define GET_UINT16_L2CHK( pData, var16, condn, dbgErrActn, relErrActn) \
379 GET_UINT16( pData, var16 )
381 #define GET_UINT32_L2CHK( pData, var32, condn, dbgErrActn, relErrActn) \
382 GET_UINT32( pData, var32 )
386 #define READ_UINT8_L2CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
387 READ_UINT8( pData, var8 ); \
388 if (!(condn)) { dbgErrActn; }
390 #define READ_UINT16_L2CHK( pData, var16, condn, dbgErrActn, relErrActn) \
391 READ_UINT16( pData, var16 ); \
392 if (!(condn)) { dbgErrActn; }
394 #define READ_UINT32_L2CHK( pData, var32, condn, dbgErrActn, relErrActn) \
395 READ_UINT32( pData, var32 ); \
396 if (!(condn)) { dbgErrActn; }
398 #define ADV_UINT8_L2CHK READ_UINT8_L2CHK
399 #define ADV_UINT16_L2CHK READ_UINT16_L2CHK
400 #define ADV_UINT32_L2CHK READ_UINT32_L2CHK
402 #define GET_UINT8_L2CHK( pData, var8, condn, dbgErrActn, relErrActn ) \
403 GET_UINT8( pData, var8 ); \
404 if (!(condn)) { dbgErrActn; }
406 #define GET_UINT16_L2CHK( pData, var16, condn, dbgErrActn, relErrActn) \
407 GET_UINT16( pData, var16 ); \
408 if (!(condn)) { dbgErrActn; }
410 #define GET_UINT32_L2CHK( pData, var32, condn, dbgErrActn, relErrActn) \
411 GET_UINT32( pData, var32 ); \
412 if (!(condn)) { dbgErrActn; }
435 #define GET_UINT8_C( pData, opVar ) opVar = *(pData)
443 #define GET_UINT16_C( pData, opVar ) \
447 result = (U16BIT)*(pData); \
448 opVar = (U16BIT)((result << 8) | *((pData) + 1)); \
457 #define GET_UINT32_C( pData, opVar ) \
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)); \
473 #define READ_UINT8_C( pData, opVar ) (opVar = *(pData)++)
481 #define READ_UINT16_C( pData, opVar ) \
485 result = (U16BIT)*(pData)++; \
486 opVar = (U16BIT)((result << 8) | *(pData)++); \
495 #define READ_UINT24_C( pData, opVar ) \
499 result = (U32BIT)*(pData)++; \
500 result = (U32BIT)((result << 8) | *(pData)++); \
501 opVar = (U32BIT)((result << 8) | *(pData)++); \
509 #define READ_UINT32_C( pData, opVar ) \
513 result = (U32BIT)*(pData)++; \
514 result = (U32BIT)((result << 8) | *(pData)++); \
515 result = (U32BIT)((result << 8) | *(pData)++); \
516 opVar = (U32BIT)((result << 8) | *(pData)++); \
533 #define READ_OBJECT_KEY_C( pData, objKey, valid ) \
536 U8BIT *pResultData = objKey.data; \
538 objKeyLen = *(pData)++; \
541 objKey.length = objKeyLen; \
543 switch (objKeyLen) { \
546 *pResultData = *(pData)++; \
550 *(pResultData)++ = *(pData)++; \
551 *pResultData = *(pData)++; \
555 *(pResultData)++ = *(pData)++; \
556 *(pResultData)++ = *(pData)++; \
557 *pResultData = *(pData)++; \
561 *(pResultData)++ = *(pData)++; \
562 *(pResultData)++ = *(pData)++; \
563 *(pResultData)++ = *(pData)++; \
564 *pResultData = *(pData)++; \
575 #define OUI_SPECIFIER_TYPE 0x01000000
576 #define OUI_SPECIFIER_MASK 0xFF000000
577 #define OUI_DATA_MASK 0x00FFFFFF
601 E_DsmObjectKind convertObjectKindStr( U32BIT objectKindStr );
604 E_DscError currErr, E_DscError newErr );
606 void readUInt16Seq( MemSeqRef memAreaRef, U16BIT *pUi16 );
608 void readUInt32Seq( MemSeqRef memAreaRef, U32BIT *pUi32 );
610 void getUInt8Seq( MemSeqRef memAreaRef, U8BIT *pUi8 );
612 void getUInt16Seq( MemSeqRef memAreaRef, U16BIT *pUi16 );
614 void getUInt32Seq( MemSeqRef memAreaRef, U32BIT *pUi32 );
616 void readObjectKeySeq( MemSeqRef memAreaRef,
P_ObjectKey pObjectKey,
624 U16BIT getIorInfoContig(
const MemPtr mpIorData, U32BIT *pIorTypeId,
627 P_Compatibility DSC_UtilParseCompatibilityDesc(
P_DsmCoreInst idp,
628 MemPtr pData, U16BIT length, U32BIT specifier );
630 BOOLEAN DSC_UtilCheckCompatibility( U8BIT *pData, U16BIT len,
633 #ifdef MEM_CONTIGUOUS
634 #define getIorInfoSeq getIorInfoContig
641 U16BIT getIorInfoSeq(
const MemPtr mpIorData, U32BIT *pIorTypeId,
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.