|
|
NVIDIA DriveOS Linux SDK API Reference
|
7.2.5.0 Early Access Release
|
Go to the documentation of this file.
13 #ifndef INCLUDED_NVOS_STATIC_ANALYSIS_H
14 #define INCLUDED_NVOS_STATIC_ANALYSIS_H
31 #define NVOS_EXIT(x) _Exit(x)
33 #define NVOS_EXIT(x) _exit(x)
36 #if defined(__linux__)
37 #if !defined(NVOS_EXIT)
39 #define NVOS_EXIT(x) _exit(x)
43 #if defined(__cplusplus)
68 #define NVOS_MISRA(type, num) MISRA_C_2023_##type##_##num
82 #define NVOS_CERT(num) CERT_##num
87 #define NVOS_COV_STRING(x) #x
118 #define NVOS_COV_WHITELIST(type, checker, comment_str) \
119 _Pragma(NVOS_COV_STRING(coverity compliance type checker comment_str))
149 #define NVOS_COV_WHITELIST_BLOCK_BEGIN(type, num, checker, comment_str) \
150 _Pragma(NVOS_COV_STRING(coverity compliance block type:num checker comment_str))
165 #define NVOS_COV_WHITELIST_BLOCK_END(checker) \
166 _Pragma(NVOS_COV_STRING(coverity compliance end_block checker))
188 #define NVOS_COV_PEND_WHITELIST(checker, comment_str) \
189 NVOS_COV_WHITELIST(deviate, checker, comment_str)
196 #define NVOS_MISRA(type, num)
197 #define NVOS_CERT(num)
198 #define NVOS_COV_STRING(x)
199 #define NVOS_COV_WHITELIST(type, checker, comment_str)
200 #define NVOS_COV_WHITELIST_BLOCK_BEGIN(type, num, checker, comment_str)
201 #define NVOS_COV_WHITELIST_BLOCK_END(checker)
202 #define NVOS_COV_PEND_WHITELIST(checker, comment_str)
210 #define ERR_INT30_C_ADDU16 0x378
211 #define ERR_INT30_C_ADDU32 0x377
212 #define ERR_INT30_C_ADDU64 0x376
213 #define ERR_INT30_C_SUBU32 0x375
214 #define ERR_INT30_C_SUBU64 0x374
215 #define ERR_INT30_C_MULTU32 0x373
216 #define ERR_INT30_C_MULTU64 0x372
217 #define ERR_INT32_C_ADDS32 0x371
218 #define ERR_INT32_C_ADDS64 0x370
219 #define ERR_INT32_C_SUBS32 0x369
220 #define ERR_INT32_C_SUBS64 0x368
221 #define ERR_INT32_C_MULTS32 0x367
222 #define ERR_INT32_C_MULTS64 0x366
223 #define ERR_INT32_C_DIVS32 0x365
224 #define ERR_INT32_C_DIVS64 0x364
225 #define ERR_INT31_C_CAST_U64TOU8 0x361
226 #define ERR_INT31_C_CAST_U32TOS32 0x360
227 #define ERR_INT31_C_CAST_U32TOU16 0x359
228 #define ERR_INT31_C_CAST_U32TOU8 0x358
229 #define ERR_INT31_C_CAST_U64TOU32 0x357
230 #define ERR_INT31_C_CAST_U64TOS32 0x356
231 #define ERR_INT31_C_CAST_S32TOU32 0x355
232 #define ERR_INT31_C_CAST_S64TOU32 0x354
233 #define ERR_INT31_C_CAST_S32TOU64 0x353
234 #define ERR_INT31_C_CAST_S32TOU8 0x352
235 #define ERR_INT31_C_CAST_S64TOU64 0x351
236 #define ERR_INT31_C_CAST_S64TOS32 0x350
237 #define ERR_INT31_C_CAST_U64TOS64 0x34F
238 #define ERR_INT30_C_ADDU64UPTR 0x34E
239 #define ERR_INT30_C_ADDU32UPTR 0x34D
240 #define ERR_INT30_C_ADDU32VPTR ERR_INT30_C_ADDU32UPTR
241 #define ERR_INT30_C_MULTSIZET 0x34C
246 #define VA_ADDR_MASK 0xFFFFFFFFFFFFUL
247 #define OFFSET_MASK 0xFFFFUL
254 #define NvBoolTrue ((NvBoolVar)0xBABAFACEU)
261 #define NvBoolFalse ((NvBoolVar)0x45450531U)
267 #define NV_UINTPTR_MAX ((uintptr_t)0U - 1U)
282 static inline bool AddU16(uint16_t op1, uint16_t op2, uint16_t *result)
286 if ((((uint16_t)UINT16_MAX - op1) < op2) ==
false) {
287 *result = (uint16_t)(op1 + op2);
294 #if defined(INT16_MAX)
298 static inline bool AddS16(int16_t op1, int16_t op2, int16_t *result)
302 if (((op2 > 0) && (op1 > (INT16_MAX - op2))) ||
303 ((op2 < 0) && (op1 < (INT16_MIN - op2)))) {
316 static inline bool AddU32(uint32_t op1, uint32_t op2, uint32_t *result)
320 if (((UINT32_MAX - op1) < op2) ==
false) {
331 static inline bool AddS32(int32_t op1, int32_t op2, int32_t *result)
335 if (((op2 > 0) && (op1 > (INT32_MAX - op2))) ||
336 ((op2 < 0) && (op1 < (INT32_MIN - op2)))) {
348 static inline bool AddU64(uint64_t op1, uint64_t op2, uint64_t *result)
352 if (((UINT64_MAX - op1) < op2) ==
false) {
362 static inline bool AddS64(int64_t op1, int64_t op2, int64_t *result)
366 if (((op2 > 0) && (op1 > (INT64_MAX - op2))) ||
367 ((op2 < 0) && (op1 < (INT64_MIN - op2)))) {
380 static inline bool MultU32(uint32_t op1, uint32_t op2, uint32_t *result)
384 if ((op1 == 0U) || (op2 == 0U)) {
386 }
else if ((op1 > (UINT32_MAX / op2)) ==
false) {
402 static inline bool MultU16(uint16_t op1, uint16_t op2, uint16_t *result)
406 if ((op1 == 0U) || (op2 == 0U)) {
409 uint32_t prod = (uint32_t)op1 * (uint32_t)op2;
411 if (prod > (uint32_t)UINT16_MAX) {
414 *result = (uint16_t)prod;
431 if (op1 <= (uint64_t)UINT32_MAX) {
432 *result = (uint32_t)op1;
445 if (*x < UINT32_MAX) {
458 if (*x < UINT64_MAX) {
473 if (op1 <= (uint64_t)INT32_MAX) {
474 *result = (int32_t)op1;
489 if (op1 <= (uint32_t)INT32_MAX) {
490 *result = (int32_t)op1;
506 *result = (uint32_t)op1;
521 if ((op1 >= 0) && (op1 <= (int32_t)UINT16_MAX)) {
522 *result = (uint16_t)op1;
533 static inline bool MultU64(uint64_t op1, uint64_t op2, uint64_t *result)
537 if ((op1 == 0U) || (op2 == 0U)) {
539 }
else if ((op1 > (UINT64_MAX / op2)) ==
false) {
562 static inline bool MultS32(int32_t op1, int32_t op2, int32_t *result)
566 if ((op1 == 0) || (op2 == 0)) {
568 }
else if (op1 > (INT32_MAX / op2)) {
585 static inline bool MultS64(int64_t op1, int64_t op2, int64_t *result)
591 if (op1 > (INT64_MAX / op2)) {
595 if (op2 < (INT64_MIN / op1)) {
601 if (op1 < (INT64_MIN / op2)) {
605 if ( (op1 != 0) && (op2 < (INT64_MAX / op1))) {
620 static inline bool SubU32(uint32_t op1, uint32_t op2, uint32_t *result)
624 if ((op1 < op2) ==
false) {
636 static inline bool SubU16(uint16_t op1, uint16_t op2, uint16_t *result)
640 if ((op1 < op2) ==
false) {
641 *result = (uint16_t)(op1 - op2);
653 static inline bool SubS32(int32_t op1, int32_t op2, int32_t *result)
657 if (((op2 > 0) && (op1 < (INT32_MIN + op2))) ||
658 ((op2 < 0) && (op1 > (INT32_MAX + op2)))) {
672 static inline bool SubU64(uint64_t op1, uint64_t op2, uint64_t *result)
676 if ((op1 < op2) ==
false) {
688 static inline bool SubS64(int64_t op1, int64_t op2, int64_t *result)
692 if (((op2 > 0) && (op1 < (INT64_MIN + op2))) ||
693 ((op2 < 0) && (op1 > (INT64_MAX + op2)))) {
708 bool SubSizet(
size_t op1,
size_t op2,
size_t *result)
710 if ((op1 < op2) ==
false) {
733 if ((((uint16_t)UINT16_MAX - op1) < op2) ==
false) {
734 *result = (uint16_t)(op1 + op2);
749 if (((UINT32_MAX - op1) < op2) ==
false) {
765 if (((UINT64_MAX - op1) < op2) ==
false) {
799 uint32_t op2,
const void **result)
802 if (op1 > (
const void *)((uintptr_t)
NV_UINTPTR_MAX - (uintptr_t)op2)) {
805 *result = (
const void *)((
const uint8_t *)op1 + op2);
836 if (((SIZE_MAX - op1) < op2) ==
false) {
853 if ((op1 == (
size_t)0) || (op2 == (
size_t)0)) {
855 }
else if (op1 > (SIZE_MAX / op2)) {
888 if ((op1 == 0U) || (op2 == 0U)) {
890 }
else if ((op1 > (UINT32_MAX / op2)) ==
true) {
907 if ((op1 == 0UL) || (op2 == 0UL)) {
909 }
else if ((op1 > (UINT64_MAX / op2)) ==
true) {
926 if ((op1 < op2) ==
false) {
943 if ((op1 < op2) ==
false) {
960 if ((op1 < op2) ==
false) {
976 if (((op2 > 0) && (op1 > (INT32_MAX - op2))) ||
977 ((op2 < 0) && (op1 < (INT32_MIN - op2)))) {
987 if (((op2 > 0) && (op1 > (INT64_MAX - op2))) ||
988 ((op2 < 0) && (op1 < (INT64_MIN - op2)))) {
1006 if (((op2 > 0) && (op1 < (INT32_MIN + op2))) ||
1007 ((op2 < 0) && (op1 > (INT32_MAX + op2)))) {
1010 *result = op1 - op2;
1017 if (((op2 > 0) && (op1 < (INT64_MIN + op2))) ||
1018 ((op2 < 0) && (op1 > (INT64_MAX + op2)))) {
1021 *result = op1 - op2;
1036 if ((op2 == 0) || ((op1 == INT32_MIN) && (op2 == -1))) {
1039 *result = op1 / op2;
1046 if ((op2 == 0) || ((op1 == INT64_MIN) && (op2 == -1))) {
1049 *result = op1 / op2;
1063 return (uint32_t)op;
1069 if (op > (uint32_t)INT32_MAX) {
1078 if (op > (uint32_t)UINT16_MAX) {
1081 return (uint16_t)op;
1087 if (op > (uint32_t)UINT8_MAX) {
1096 if (op > (uint32_t)INT8_MAX) {
1105 if (op > (uint64_t)UINT8_MAX) {
1114 if (op > UINT32_MAX) {
1117 return (uint32_t)op;
1123 if (op > (uint64_t)INT32_MAX) {
1132 if ((op > (int64_t)UINT32_MAX) || (op < 0)) {
1135 return (uint32_t)op;
1144 return (uint64_t)op;
1150 if ((op > (int32_t)UINT8_MAX) || (op < 0)) {
1162 return (uint64_t)op;
1168 int32_t
max = INT32_MAX;
1169 int32_t
min = INT32_MIN;
1171 if ((op > (int64_t)
max) || (op < (int64_t)
min)) {
1180 if (op > (uint64_t)INT64_MAX) {
1196 *result = op1 + op2;
1211 if (op1 <= (
const void *)((uintptr_t)
NV_UINTPTR_MAX - (uintptr_t)op2)) {
1212 *result = (
const void *)((
const uint8_t *)op1 + op2);
1226 if ((op > UINT32_MAX) ==
false) {
1227 *result = (uint32_t)op;
1242 if ((op > (uint64_t)INT64_MAX) ==
false) {
1243 *result = (int64_t)op;
1256 *result = (int64_t)op;
1267 if ((op > (uint32_t)UINT16_MAX) ==
false) {
1268 *result = (uint16_t)op;
1283 if ((op > (uint32_t)INT32_MAX) ==
false) {
1284 *result = (int32_t)op;
1299 if ((op > (uint32_t )UINT8_MAX) ==
false) {
1300 *result = (uint8_t)op;
1316 *result = (uint64_t)op;
1331 if ((op >= 0) && ((op > (int64_t)UINT32_MAX) ==
false)) {
1332 *result = (uint32_t)op;
1346 int32_t
max = INT32_MAX;
1347 int32_t
min = INT32_MIN;
1349 if ((op >= (int64_t)
min) && (op <= (int64_t)
max)) {
1350 *result = (int32_t)op;
1365 if ((op < 0) ==
false) {
1366 *result = (uint32_t)op;
1373 #if defined(INT16_MAX)
1378 bool NvConvertInt32toInt16(int32_t op, int16_t *result)
1382 if ((op > INT16_MAX) ==
false) {
1383 *result = (int16_t)op;
1394 bool NvConvertUint16toInt16(uint16_t op, int16_t *result)
1398 if ((op > (uint16_t)INT16_MAX) ==
false) {
1399 *result = (int16_t)op;
1411 #if defined(__QNX__)
1414 void NvWritel(uintptr_t base, uint64_t offset, uint32_t val)
1420 uint32_t NvReadl(uintptr_t base, uint64_t offset)
1474 *result = (operand << shift);
1497 *result = (operand >> shift);
1504 #if defined(__cplusplus)
1507 #endif // INCLUDED_NVOS_STATIC_ANALYSIS_H
static int32_t NvConvertFlagUInt32toInt32(uint32_t flag_uint32)
CERT INT30-C: Readl and writel APIs to avoid CERT-C warnings.
static bool SubU64(uint64_t op1, uint64_t op2, uint64_t *result)
CERT INT30-C: Precondition test to ensure that unsigned integer subtraction operation do not wrap.
static bool MultU16(uint16_t op1, uint16_t op2, uint16_t *result)
CERT INT30-C: Precondition test to ensure that unsigned integer multiplication operation do not wrap.
static uint32_t CastS32toU32WithExit(int32_t op)
Casting functions to fix CERT INT31-C: Ensure integer conversions do not result in lost or misinterpr...
#define ERR_INT30_C_ADDU64
#define ERR_INT30_C_MULTSIZET
static bool ShiftLeftU32(uint32_t operand, uint32_t shift, uint32_t *result)
CERT INT34-C:
static void incrementUInt32(uint32_t *x)
Increment uint32_t by one Precondition test to ensure value is within RANGE_MAX.
static void SubS32WithExit(int32_t op1, int32_t op2, int32_t *result)
CERT INT32-C: Precondition test to ensure that signed integer subtraction operation does not overflow...
#define ERR_INT30_C_MULTU32
static bool AddU32(uint32_t op1, uint32_t op2, uint32_t *result)
CERT INT30-C: Precondition test to ensure that unsigned integer add operation do not wrap.
#define ERR_INT31_C_CAST_U64TOS64
#define ERR_INT31_C_CAST_S32TOU64
static void AddU64WithExit(uint64_t op1, uint64_t op2, uint64_t *result)
CERT INT30-C: Precondition test to ensure that unsigned integer add operation do not wrap.
static void MultSizetWithExit(size_t op1, size_t op2, size_t *result)
CERT INT30-C: Precondition test to ensure that size_t multiplication operation do not wrap.
static void AddSizetWithExit(size_t op1, size_t op2, size_t *result)
CERT INT30-C: Precondition test to ensure that size_t add operation do not wrap.
convert signedness of 32bit value
#define NV_UINTPTR_MAX
Define macro to replace uintptr_t max.
static bool MultS32(int32_t op1, int32_t op2, int32_t *result)
Precondition test to ensure that signed integer multiplication operation do not wrap.
static int32_t CastU64toS32WithExit(uint64_t op)
#define ERR_INT30_C_ADDU64UPTR
#define NVOS_MISRA(type, num)
These macros are used for whitelisting coverity violations.
static void AddS64WithExit(int64_t op1, int64_t op2, int64_t *result)
static void SubU64WithExit(uint64_t op1, uint64_t op2, uint64_t *result)
CERT INT30-C: Precondition test to ensure that unsigned integer subtraction operation do not wrap.
#define ERR_INT31_C_CAST_S64TOU64
static void AddS32WithExit(int32_t op1, int32_t op2, int32_t *result)
CERT INT32-C: Precondition test to ensure that signed integer add operation do not overflow.
static bool AddU32UPTR(uintptr_t op1, uint32_t op2, uintptr_t *result)
CERT INT30-C: Ensure that uintptr_t and unsigned integer add do not result in lost or misinterpreted ...
static bool ShiftRightU32(uint32_t operand, uint32_t shift, uint32_t *result)
CERT INT34-C:
#define ERR_INT30_C_ADDU16
Exit codes for function that call NVOS_EXIT().
static bool AddS32(int32_t op1, int32_t op2, int32_t *result)
CERT INT30-C Precondition test to ensure that integer add operation do not wrap.
static uint64_t CastS64toU64WithExit(int64_t op)
static bool MultU64(uint64_t op1, uint64_t op2, uint64_t *result)
CERT INT30-C: Precondition test to ensure that unsigned integer multiplication operation do not wrap.
#define ERR_INT30_C_MULTU64
static bool NvConvertUint32toUint8(uint32_t op, uint8_t *result)
CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data.
static void AddU32WithExit(uint32_t op1, uint32_t op2, uint32_t *result)
CERT INT30-C: Precondition test to ensure that unsigned integer add operation do not wrap.
static bool SubS64(int64_t op1, int64_t op2, int64_t *result)
CERT INT30-C Precondition test to ensure that signed integer subtraction operation do not wrap.
#define ERR_INT32_C_ADDS64
static void AddU64UPTRWithExit(uintptr_t op1, uint64_t op2, uintptr_t *result)
CERT INT30-C: Precondition test to ensure that uintptr_t unsigned integer add operation do not wrap F...
static void SubS64WithExit(int64_t op1, int64_t op2, int64_t *result)
static bool NvConvertLint64toULint64(int64_t op, uint64_t *result)
CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data.
#define ERR_INT32_C_DIVS32
static bool NvConvertInt32toUint32(int32_t op, uint32_t *result)
CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data.
static uint32_t NvConvertFlagInt32toUInt32(int32_t flag_int32)
CERT INT31-C:
static void AddU32OffsetToVoidPtrWithExit(const void *op1, uint32_t op2, const void **result)
CERT INT30-C: Precondition test to ensure that void * and unsigned integer add operation does not wra...
static bool NvConvertLint64toUint32(int64_t op, uint32_t *result)
CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data.
static bool SubU32(uint32_t op1, uint32_t op2, uint32_t *result)
CERT INT30-C: Precondition test to ensure that unsigned integer subtraction operation do not wrap.
static bool AddU32OffsetToVoidPtr(const void *op1, uint32_t op2, const void **result)
CERT INT30-C: Ensure that adding a 32-bit integer offset to a void pointer does not result in integer...
static bool NvConvertUint32toInt32(uint32_t op, int32_t *result)
CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data.
static uint32_t CastS64toU32WithExit(int64_t op)
static void MultU64WithExit(uint64_t op1, uint64_t op2, uint64_t *result)
CERT INT30-C: Precondition test to ensure that unsigned integer multiplication operation do not wrap.
#define ERR_INT32_C_SUBS64
static void DivS32WithExit(int32_t op1, int32_t op2, int32_t *result)
CERT INT32-C: Precondition test to ensure that signed integer division operation does not overflow or...
#define ERR_INT31_C_CAST_U32TOU8
static uint16_t CastU32toU16WithExit(uint32_t op)
#define ERR_INT30_C_SUBU64
static bool SubU16(uint16_t op1, uint16_t op2, uint16_t *result)
CERT INT30-C: Precondition test to ensure that unsigned integer subtraction operation do not wrap.
static void AddU16WithExit(uint16_t op1, uint16_t op2, uint16_t *result)
Exit API is not supported in LK and BL.
#define ERR_INT30_C_ADDU32UPTR
#define ERR_INT32_C_DIVS64
static uint8_t CastU64toU8WithExit(uint64_t op)
static void DivS64WithExit(int64_t op1, int64_t op2, int64_t *result)
#define ERR_INT32_C_SUBS32
static char CastU32toCharWithExit(uint32_t op)
static void incrementUInt64(uint64_t *x)
Increment uint64_t by one Precondition test to ensure value is within RANGE_MAX.
static void NvConvertUint32toInt64(uint32_t op, int64_t *result)
MISRA RULE 10.8 Ensure that integer conversions do not result in lost or misinterpreted data.
#define ERR_INT30_C_ADDU32
static void AddU32UPTRWithExit(uintptr_t op1, uint32_t op2, uintptr_t *result)
CERT INT30-C: Precondition test to ensure that uintptr_t and unsigned integer add operation do not wr...
static int32_t CastS64toS32WithExit(int64_t op)
#define ERR_INT31_C_CAST_S64TOS32
#define ERR_INT30_C_SUBU32
static uint8_t CastS32toU8WithExit(int32_t op)
#define ERR_INT31_C_CAST_U64TOS32
static bool SubSizet(size_t op1, size_t op2, size_t *result)
CERT INT30-C: Precondition test to ensure that size_t subtraction operation do not wrap.
static bool NvConvertLint64toInt32(int64_t op, int32_t *result)
CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data.
static int64_t CastU64toS64WithExit(uint64_t op)
static bool AddU64(uint64_t op1, uint64_t op2, uint64_t *result)
CERT INT30-C: Precondition test to ensure that unsigned integer add operation do not wrap.
static bool SubS32(int32_t op1, int32_t op2, int32_t *result)
CERT INT32-C: Precondition test to ensure that signed integer subtraction operation does not overflow...
static void AddUPTRSizetWithExit(uintptr_t op1, size_t op2, uintptr_t *result)
CERT INT30-C: Precondition test to ensure that uintptr_t and size_t add operation do not wrap.
#define ERR_INT31_C_CAST_U32TOS32
static int32_t CastU32toS32WithExit(uint32_t op)
static uint8_t CastU32toU8WithExit(uint32_t op)
#define ERR_INT31_C_CAST_U64TOU32
static bool NvConvertUint32toUint16(uint32_t op, uint16_t *result)
CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data.
static bool CastU64toU32(uint64_t op1, uint32_t *result)
CERT INT30-C: Precondition test to ensure casting unsigned long to unsigned integer do not wrap.
static bool CastU32toS32(uint32_t op1, int32_t *result)
CERT INT30-C: Precondition test to ensure casting unsigned integer to signed integer do not wrap.
static uint64_t CastS32toU64WithExit(int32_t op)
static bool NvConvertUint64toInt64(uint64_t op, int64_t *result)
CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data.
static bool CastS32toU16(int32_t op1, uint16_t *result)
CERT INT30-C: Precondition test to ensure casting signed integer to unsigned integer do not wrap.
#define ERR_INT31_C_CAST_U32TOU16
static void MultU32WithExit(uint32_t op1, uint32_t op2, uint32_t *result)
CERT INT30-C: Precondition test to ensure that unsigned integer multiplication operation do not wrap.
static uint32_t CastU64toU32WithExit(uint64_t op)
static bool NvConvertUint64toUint32(uint64_t op, uint32_t *result)
CERT INT31-C: Ensure that integer conversions do not result in lost or misinterpreted data.
#define NVOS_COV_WHITELIST(type, checker, comment_str)
#define ERR_INT31_C_CAST_S32TOU8
#define ERR_INT31_C_CAST_S64TOU32
static void SubSizetWithExit(size_t op1, size_t op2, size_t *result)
CERT INT30-C: Precondition test to ensure that size_t subtraction operation do not wrap.
static bool CastU64toS32(uint64_t op1, int32_t *result)
CERT INT30-C: Precondition test to ensure casting unsigned long to unsigned integer do not wrap.
static bool MultU32(uint32_t op1, uint32_t op2, uint32_t *result)
CERT INT30-C: Precondition test to ensure that unsigned integer multiplication operation do not wrap.
#define ERR_INT31_C_CAST_S32TOU32
static bool AddU16(uint16_t op1, uint16_t op2, uint16_t *result)
CERT INT30-C: Precondition test to ensure that unsigned integer add operation do not wrap.
#define ERR_INT30_C_ADDU32VPTR
#define ERR_INT31_C_CAST_U64TOU8
#define VA_ADDR_MASK
Define macro for virtual address bit mask.
static bool MultS64(int64_t op1, int64_t op2, int64_t *result)
CERT INT30-C Precondition test to ensure that signed integer multiplication operation do not wrap.
static bool AddS64(int64_t op1, int64_t op2, int64_t *result)
CERT INT30-C Precondition test to ensure that integer add operation do not wrap.
#define ERR_INT32_C_ADDS32
static void SubU32WithExit(uint32_t op1, uint32_t op2, uint32_t *result)
CERT INT30-C: Precondition test to ensure that unsigned integer subtraction operation do not wrap.
static bool CastS32toU32(int32_t op1, uint32_t *result)
CERT INT30-C: Precondition test to ensure casting signed integer to unsigned integer do not wrap.